Submission #52969

#TimeUsernameProblemLanguageResultExecution timeMemory
52969zetapiGondola (IOI14_gondola)C++14
0 / 100
3 ms720 KiB
#include "gondola.h" #include "bits/stdc++.h" using namespace std; #define ll long long #define pb push_back #define mp make_pair #define itr ::iterator int valid(int n, int inputSeq[]) { return -1; } //---------------------- int replacement(int n, int gondolaSeq[], int replacementSeq[]) { return -2; } //---------------------- int countReplacement(int n, int inputSeq[]) { vector<int> vec; for(int A=0;A<n;A++) vec.pb(inputSeq[A]); sort(vec.begin(),vec.end()); for(int A=0;A<vec.size();A++) if(vec[A]!=A+1) return 0; if(vec.back()<=n+2) return 1; return 2; }

Compilation message (stderr)

gondola.cpp: In function 'int countReplacement(int, int*)':
gondola.cpp:30:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int A=0;A<vec.size();A++)
              ~^~~~~~~~~~~
#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...