Submission #194136

#TimeUsernameProblemLanguageResultExecution timeMemory
194136oscarsierra12Gondola (IOI14_gondola)C++14
10 / 100
41 ms4820 KiB
#include "gondola.h" #include <bits/stdc++.h> using namespace std ; int valid(int n, int inputSeq[]) { int x = min_element ( inputSeq, inputSeq+n ) - inputSeq ; vector <int> nwSeq ; set <int> rep ; for ( int i = x ; i < n ; ++i ) nwSeq.push_back ( inputSeq[i] ), rep.insert ( inputSeq[i] ) ; for ( int i = 0 ; i < x ; ++i ) nwSeq.push_back ( inputSeq[i] ), rep.insert ( inputSeq[i] ) ; int mx = 0 ; int posible = ( rep.size()==n ) ; for ( int i = 0 ; i < n ; ++i ) { if ( nwSeq[i] <= n ) { if ( nwSeq[i] <= mx ) posible = 0 ; mx = nwSeq[i] ; } else mx++ ; } return posible; } //---------------------- 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:12:29: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   int posible = ( rep.size()==n ) ;
                   ~~~~~~~~~~^~~
#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...