Submission #238931

#TimeUsernameProblemLanguageResultExecution timeMemory
238931tleontest1Gondola (IOI14_gondola)C++14
25 / 100
25 ms1152 KiB
#include "gondola.h" #pragma GCC optimize ("O3") #pragma GCC target ("sse4") #pragma GCC optimize ("unroll-loops") #pragma GCC target ("avx2") #include <bits/stdc++.h> using namespace std; typedef long long lo; typedef pair< lo,lo > PII; #define fi first #define se second #define mp make_pair #define pb push_back #define fio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL) #define FOR for(int i=1;i<=n;i++) #define mid ((start+end)/2) #define ort ((bas+son)/2) const lo MAX = -1000000000000000000; const lo MIN = 1000000000000000000; const lo inf = 1000000000000000000; const lo KOK = 100000; const lo LOG = 30; const lo li = 500005; const lo mod = 1000000007; int m,k,flag,t,vis[li]; int cev; string s; vector<int> v; int valid(int n, int a[]){ int con=-1; for(int i=0;i<n;i++){ if(a[i]<=n && con==-1){ if(i>=a[i]-1)con=i-(a[i]-1); else con=i+1+(n-a[i]); } else if(a[i]<=n){ int con1=0; if(i>=a[i]-1)con1=i-(a[i]-1); else con1=i+1+(n-a[i]); if(con1!=con)flag=1; } } sort(a,a+n); for(int i=1;i<n;i++){ if(a[i]==a[i-1])flag=1; } if(flag)return 0; return 1; } //---------------------- int replacement(int n, int a[], int b[]){ for(int i=0;i<n;i++){ vis[a[i]]=1; } FOR v.pb(i); int maxi=n; int len=0; for(int i=0;i<(int)v.size();i++){ if(vis[v[i]]==1)continue; b[len++]=v[i]; v[i]=++maxi; i--; } return len; } //---------------------- int countReplacement(int n, int inputSeq[]){ return -3; }
#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...