제출 #285519

#제출 시각아이디문제언어결과실행 시간메모리
285519ToMmyDong곤돌라 (IOI14_gondola)C++11
20 / 100
44 ms4848 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> pii; #define first X #define second Y #define eb emplace_back #define ALL(i) i.begin(),i.end() #define SZ(i) int(i.size()) #ifdef tmd #define debug(...) fprintf(stderr,"#%d-(%s)=",__LINE__,#__VA_ARGS__);_do(__VA_ARGS__); template<typename T> void _do (T &&x) {cerr<<x<<endl;} template<typename T, typename ...S> void _do(T &&x, S &&...y) {cerr<<x<<",";_do(y...);} #else #define debug(...) #endif #include "gondola.h" int valid(int n, int inputSeq[]) { vector<int> sm; set<int> val; for (int i=0; i<n; i++) { if (inputSeq[i] <= n) { sm.push_back(inputSeq[i]); val.insert(inputSeq[i]); } } if (SZ(val) != n) return 0; int st = min_element(ALL(sm)) - sm.begin(); for (int i=0; i<SZ(sm)-1; i++) { if (inputSeq[(st+i)%SZ(sm)] >= inputSeq[(st+i+1)%SZ(sm)]) { 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...