# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
836374 | Jarif_Rahman | Gondola (IOI14_gondola) | C++17 | 13 ms | 1716 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "gondola.h"
#include <bits/stdc++.h>
#define pb push_back
#define f first
#define sc second
using namespace std;
typedef long long int ll;
typedef string str;
const ll md = 1e9+7;
bool distinct(deque<int> S){
sort(S.begin(), S.end());
for(int i = 1; i < S.size(); i++) if(S[i] == S[i-1]) return 0;
return 1;
}
int valid(int n, int _S[]){
deque<int> S;
for(int i = 0; i < n; i++) S.pb(_S[i]);
int mn = *min_element(S.begin(), S.end());
while(S[0] != mn) S.pb(S[0]), S.pop_front();
if(!distinct(S)) return 0;
for(int i = 1; i < n; i++) if(S[i] <= n){
if(S[i] != (mn+i-1)%n+1) return 0;
}
return 1;
}
int replacement(int n, int _S[], int R[]){
deque<int> S;
for(int i = 0; i < n; i++) S.pb(_S[i]);
int mn = *min_element(S.begin(), S.end());
while(S[0] != mn) S.pb(S[0]), S.pop_front();
return 0;
}
int countReplacement(int n, int _S[]){
deque<int> S;
for(int i = 0; i < n; i++) S.pb(_S[i]);
int mn = *min_element(S.begin(), S.end());
while(S[0] != mn) S.pb(S[0]), S.pop_front();
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |