Submission #9480

#TimeUsernameProblemLanguageResultExecution timeMemory
9480shashackWiring (kriii2_W)C++98
1 / 4
1000 ms1672 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...