제출 #309575

#제출 시각아이디문제언어결과실행 시간메모리
309575aZvezda곤돌라 (IOI14_gondola)C++14
10 / 100
12 ms640 KiB
#include "gondola.h" #include <bits/stdc++.h> using namespace std; //#pragma GCC optimize ("O3") //#pragma GCC target ("sse4") #define endl "\n" typedef long long ll; typedef long double ld; typedef unsigned long long ull; template<class T, class T2> inline bool chkmax(T &x, const T2 &y) { return x < y ? x = y, 1 : 0; } template<class T, class T2> inline bool chkmin(T &x, const T2 &y) { return x > y ? x = y, 1 : 0; } const ll mod = 1e9 + 7; template<class T> inline void fix(T &x) {if(labs(x) >= mod) {x %= mod;} if(x < 0) {x += mod;}} #define out(x) cout << __LINE__ << ": " << (#x) << " = " << (x) << endl int valid(int n, int inputSeq[]) { int ind = -1; for(int i = 0; i < n; i ++) { if(inputSeq[i] <= n) { ind = i; break; } } if(ind == -1) {return 1;} int rot = (-inputSeq[ind] + ind + 1 + n) % n; rotate(inputSeq, inputSeq + rot, inputSeq + n); for(int i = 0; i < n; i ++) { if(inputSeq[i] <= n && inputSeq[i] != i + 1) { return 0; } } return 1; } //---------------------- int replacement(int n, int gondolaSeq[], int replacementSeq[]) { return -2; } //---------------------- int countReplacement(int n, int inputSeq[]) { return -3; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...