Submission #589271

#TimeUsernameProblemLanguageResultExecution timeMemory
589271yutabiGondola (IOI14_gondola)C++14
20 / 100
31 ms4620 KiB
#include "gondola.h" #include <bits/stdc++.h> using namespace std; int valid(int n, int s[]) { set <int> st; int diff=-1; bool flag=0; for(int i=0;i<n;i++) { st.insert(s[i]); if(s[i]<=n) { int num=(s[i]+n-i)%n; if(diff!=-1 && diff!=num) { flag=1; } diff=num; } } if(st.size()!=n) { flag=1; } if(flag) { return 0; } 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:33:17: warning: comparison of integer expressions of different signedness: 'std::set<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   33 |     if(st.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...