Submission #291995

#TimeUsernameProblemLanguageResultExecution timeMemory
291995BadrangiikhGondola (IOI14_gondola)C++14
10 / 100
20 ms2328 KiB
#include<bits/stdc++.h> #include "gondola.h" using namespace std; int valid(int n, int inputSeq[]){ vector < pair < int , int > > vec ; for ( int i = 0 ; i < n ; i ++ ) { if ( inputSeq [ i ] <= n ) { vec . push_back ( { inputSeq [ i ] , i } ) ; } } sort ( vec . begin ( ) , vec . end ( ) ) ; for ( int i = 1 ; i < vec . size ( ) ; i ++ ) { if ( vec [ i ] . first - vec [ i - 1 ] . first != ( ( vec [ i ] . second - vec [ i - 1 ] . second ) % n + n ) % n ) { return 0 ; } } return 1 ; } int replacement(int n, int gondolaSeq[], int replacementSeq[]){ return 0 ; } int countReplacement(int n, int inputSeq[]) { return 0 ; }

Compilation message (stderr)

gondola.cpp: In function 'int valid(int, int*)':
gondola.cpp:13:25: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   13 |     for ( int i = 1 ; i < vec . 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...