Submission #254536

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
2545362020-07-30 08:05:01b00n0rpGondola (IOI14_gondola)C++17
100 / 100
67 ms5112 KiB
#include "gondola.h"
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int valid(int n, int inputSeq[]){
set<int> s;
for(int i = 0; i < n; i ++){
s.insert(inputSeq[i]);
}
if(s.size() != n) return 0;
for(int i = 0; i < n; i ++){
if(inputSeq[i] <= n){
for(int j = (i+1)%n; j != i; j = (j+1)%n){
if(inputSeq[j] > n) continue;
if(inputSeq[j] != ((inputSeq[i]+(j-i)+n-1)%n)+1) return 0;
}
return 1;
}
}
return 1;
}
//----------------------
int a[100005];
int replacement(int n, int gondolaSeq[], int replacementSeq[]){
bool flag = 0;
for(int i = 0; i < n; i ++){
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

gondola.cpp: In function 'int valid(int, int*)':
gondola.cpp:12:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  if(s.size() != n) return 0;
     ~~~~~~~~~^~~~
gondola.cpp: In function 'int replacement(int, int*, int*)':
gondola.cpp:61:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i = 0; i < v.size(); i ++){
                 ~~^~~~~~~~~~
gondola.cpp: In function 'int countReplacement(int, int*)':
gondola.cpp:95:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  if(v.size() == n) ans = n;
     ~~~~~~~~~^~~~
gondola.cpp:97:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i = 1; i < v.size(); i ++){
                 ~~^~~~~~~~~~
gondola.cpp:87:6: warning: unused variable 'cur' [-Wunused-variable]
  int cur = 0;
      ^~~
#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...