博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
A. Hilbert‘s Hotel(数论)
阅读量:241 次
发布时间:2019-03-01

本文共 489 字,大约阅读时间需要 1 分钟。

证明参考:

#include
#include
#include
#include
#include
#include
#include
#include
#include
#define debug(a) cout<<#a<<"="<
<
map1;LL a[maxn];int main(void){ cin.tie(0);std::ios::sync_with_stdio(false); LL t;cin>>t; while(t--){ map1.clear(); LL n;cin>>n; for(LL i=0;i
>a[i],map1[ ( (a[i]+i)%n+n)%n]++; bool flag=1; for(auto i:map1){ if(i.second>=2){ flag=0; } } if(flag){ cout<<"YES"<<"\n"; } else{ cout<<"NO"<<"\n"; } } return 0;}

 

转载地址:http://pact.baihongyu.com/

你可能感兴趣的文章