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 <iostream>
#include <iomanip>
#include <stdlib.h>
#include <stdio.h>
#include <algorithm>
#include <assert.h>
#include <bitset>
#include <cstring>
#include <cstdlib>
#include <ctime>
#include <map>
#include <math.h>
#include <malloc.h>
#include <numeric>
#include <string>
#include <stack>
#include <queue>
#include <vector>
#pragma warning(disable:4996)
#define REP(variable, repeatnumber) for(int variable=0; variable<(repeatnumber); ++variable)
#define FOR(variable, start, end) for(int variable=(start); variable<=(end); ++variable)
#define RFOR(variable, start, end) for(int variable=(start); variable>=(end); --variable)
#define ULL unsigned long long
#define LL long long
using namespace std; // 700B
LL a = 0, b = 0, c = 0, d = 0, n;
int main(){
cin >> n;
FOR(i, 1, n-1){
FOR(j,1,n-1){
d += j;
d = d % n;
if (a == d) break;
c++;
a = b;
b = d;
}
if (a == d) break;
}
cout << c << endl;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |