| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1360555 | takoshanava | Gondola (IOI14_gondola) | C++20 | 0 ms | 344 KiB |
#include "gondola.h"
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define fs first
#define sc second;
using namespace std;
const ll N = 250005, MOD = 1e9 + 7;
int a[N];
ll binpow(ll a, ll b){
ll res = 1;
while(b > 0){
if(b % 2) res = (res * a) % MOD;
a = (a * a) % MOD;
b /= 2;
}
return res;
}
int valid(int n, int inputSeq[]){
set<int> sn;
for(int i = 0; i < n; i++) a[i] = inputSeq[i];
for(int i = 0; i < n; i++){
if(sn.count(a[i])) return 0;
sn.insert(a[i]);
}
int st = -1;
for(int i = 0; i < n; i++){
if(a[i] <= n){
st = i;
break;
}
}
if(st == -1) return 1;
int k = a[st];
for(int i = 0; i < n; i++){
int idx = (st + k) % n;
if(a[idx] <= n){
if(a[idx] != k) return 0;
}
k++;
if(k > n) k = 1;
}
return 1;
}
int replacement(int n, int gondolaSeq[], int replacementSeq[]){
return -2;
}
int countReplacement(int n, int inputSeq[])
{
return -3;
}| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
