Submission #232070

#TimeUsernameProblemLanguageResultExecution timeMemory
232070anonymousGondola (IOI14_gondola)C++14
10 / 100
18 ms2044 KiB
#include "gondola.h" #include <vector> #include <iostream> #define MAXN 100005 #define MAXV 250005 using namespace std; int valid(int n, int inputSeq[]) { vector <int> Vals; bool b = true, has[MAXV]={}; for (int i=0; i<n; i++) { if (inputSeq[i] <= n) { Vals.push_back(inputSeq[i]); } if (has[inputSeq[i]]) {return(0);} has[inputSeq[i]]=true; } for (int i=0; i<Vals.size(); i++) { if (Vals[i] > Vals[(i+1)%Vals.size()] && !b) {return(0);} b &= Vals[i] < Vals[(i+1)%Vals.size()] ; } return(1); } //---------------------- int replacement(int n, int gondolaSeq[], int replacementSeq[]) { return -2; } //---------------------- int countReplacement(int n, int inputSeq[]) { return -3; }

Compilation message (stderr)

gondola.cpp: In function 'int valid(int, int*)':
gondola.cpp:20:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (int i=0; i<Vals.size(); i++) {
                 ~^~~~~~~~~~~~
#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...