Submission #320129

#TimeUsernameProblemLanguageResultExecution timeMemory
320129lukameladzeGondola (IOI14_gondola)C++14
Compilation error
0 ms0 KiB
# include <bits/stdc++.h> using namespace std; long long n,a[300005],x,num,idx,mp[300005]; int valid(int n , int a[]) { //cin>>n; idx=-1; for (int i=0; i<n; i++) { // cin>>a[i]; if (mp[a[i]]) x=1; mp[a[i]]=1; if (a[i]<=n) idx=i; } if (x==1) { return 0; } if (!idx) { return 1; } num=a[idx]; for (int i=idx+1; i<n; i++) { num++; if (num==n+1) num=1; // cout<<a[i]<<" "<<num<<endl; if (a[i]<=n && a[i]!=num) { return 0; } } // cout<<num<<endl; for (int i=0; i<idx; i++) { num++; if (num==n+1) num=1; if (a[i]<=n && a[i]!=num) { return 0; } } return 0; }

Compilation message (stderr)

/tmp/ccTELK34.o: In function `main':
grader.cpp:(.text.startup+0xb6): undefined reference to `valid'
grader.cpp:(.text.startup+0x108): undefined reference to `countReplacement'
grader.cpp:(.text.startup+0x132): undefined reference to `replacement'
collect2: error: ld returned 1 exit status