This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <cstdio>
int n;
bool link[1005][1005];
int ans;
int main()
{
scanf("%d",&n);
int k=0,p,p2;
for(p=1;p<=n*n;p++){
int a=(k+p)%n;
if(k!=a&&link[a][k]==false&&link[k][a]==false){
ans++;
link[a][k]=true;
link[k][a]=true;
}
k=(k+p)%n;
}
printf("%d",ans);
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |