Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- #define ll long long
- #define fast()(ios_base::sync_with_stdio(0),cin.tie(NULL));
- int main()
- {
- fast()
- ll t;
- cin>>t;
- while(t--)
- {
- ll n;
- cin>>n;
- ll ara[n];
- bool use[n],flg=true;;
- fill(use,use+n,false);
- for(ll i=0;i<n;i++)
- {
- cin>>ara[i];
- ll x=(ara[i]+i)%n;
- x=(x+n)%n;
- if(use[x])flg=false;
- use[x]=true;
- }
- if(flg)cout<<"YES"<<endl;
- else cout<<"NO"<<endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement