제출 #374170

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
3741702021-03-06 19:37:46ritul_kr_singh곤돌라 (IOI14_gondola)C++17
100 / 100
79 ms9068 KiB
//#pragma GCC optimize("Ofast,unroll-loops")
#include <bits/stdc++.h>
#include "gondola.h"
using namespace std;
#define sp << " " <<
#define nl << "\n"
#define ll long long
int valid(int n, int a[]){
ll least = n+1, ind = -1;
map<ll, ll> m;
for(ll i=0; i<n; ++i){
if(a[i] < least) least = a[i], ind = i;
if(m[a[i]]) return 0;
++m[a[i]];
}
if(least<=n){
for(ll ii=0, i=ind; ii<n; ++ii, i=(i+1)%n){
if(a[i]<=n and a[i]!=ii+least) return 0;
}
}
return 1;
}
int replacement(int n, int* inp, int* ans){
ll least = n+1, ind = 0;
for(ll i=0; i<n; ++i){
if(inp[i] < least) least = inp[i], ind = i;
}
if(least>n) least = 1;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#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...