# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
77281 |
2018-09-24T15:33:06 Z |
MvC |
Gondola (IOI14_gondola) |
C++11 |
|
4 ms |
1788 KB |
#include "gondola.h"
#include<bits/stdc++.h>
#define rc(x) return cout<<x<<endl,0
#define pb push_back
#define in insert
#define er erase
#define fd find
#define fr first
#define sc second
typedef long long ll;
const ll INF=0x3f3f3f3f3f3f3f3f;
const ll llinf=(1LL<<61);
const int inf=(1<<30);
const int nmax=3e5+50;
const int mod=1e9+7;
using namespace std;
int valid(int n,int a[])
{
int i,v[nmax],j;
for(i=0;i<nmax;i++)v[i]=0;
for(i=0;i<n;i++)
{
if(a[i]<=n)j=i;
if(v[a[i]])return 0;
v[a[i]]=1;
}
if(i==n)return 1;
i=j;
int nr=a[i],lst=i+n-a[i]+1,cnt=0;
for(;cnt<n;i++,cnt++)
{
lst--;
if(i==n)i=0;
if(!lst)nr=1,lst=nmax;
if(a[i]<=n && a[i]>nr)nr=a[i];
else if(a[i]<=n && a[i]<nr)return 0;
}
return 1;
}
int replacement(int n, int gondolaSeq[], int replacementSeq[])
{
return 0;
}
int countReplacement(int n, int inputSeq[])
{
return 0;
}
/*int main()
{
//freopen("sol.in","r",stdin);
//freopen("sol.out","w",stdout);
ios_base::sync_with_stdio(false);cin.tie(0);cerr.tie(0);cout.tie(0);
return 0;
}*/
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
1528 KB |
Output is correct |
2 |
Incorrect |
4 ms |
1660 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
1660 KB |
Output is correct |
2 |
Incorrect |
3 ms |
1660 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
1788 KB |
Output is correct |
2 |
Incorrect |
3 ms |
1788 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
1788 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
1788 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
1788 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
1788 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
1788 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
1788 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
1788 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |