Submission #171705

#TimeUsernameProblemLanguageResultExecution timeMemory
171705gs18103Gondola (IOI14_gondola)C++14
10 / 100
20 ms760 KiB
#include "gondola.h" #include <bits/stdc++.h> #define fi first #define se second #define eb emplace_back #define em emplace #define all(v) v.begin(), v.end() using namespace std; typedef long long ll; typedef pair <int, int> pii; typedef pair <ll, ll> pll; const int MAX = 101010; const int INF = INT_MAX >> 1; const ll LINF = LLONG_MAX >> 1; int valid(int n, int arr[]) { vector <bool> chk(250050); int idx = -1, val; for(int i = 0; i < n; i++) { if(arr[i] <= n) { idx = i; val = arr[i]; break; } } if(idx == -1) return 1; for(int i = 0; i < n; i++) { if(arr[(idx+i)%n] <= n && (arr[(idx+i)%n] % n) != ((arr[idx] + i) % n)) return 0; } sort(arr, arr+n); for(int i = 1; i < n; i++) { if(arr[i] == arr[i-1]) 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:20:16: warning: variable 'val' set but not used [-Wunused-but-set-variable]
  int idx = -1, val;
                ^~~
#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...