# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
763646 | Ahmed57 | Gondola (IOI14_gondola) | C++17 | 51 ms | 7088 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>
using namespace std;
int valid(int n, int inputSeq[]){
bool ss = 0;
int ind = 0 , val = 0;
map<int,int> mp;
for(int i = 0;i<n;i++){
if(inputSeq[i]<=n){
ss = 1;
val = inputSeq[i]-1;
ind = i;
}else{
if(mp[inputSeq[i]]==1){
return 0;
}mp[inputSeq[i]] = 1;
}
}
if(!ss)return 1;
for(int i = ind+1;i<n;i++){
val++;
val%=n;
if(inputSeq[i]<=n){
if((inputSeq[i]-1)!=val)return 0;
}
}
for(int i = 0;i<ind;i++){
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... |