Submission #433734

#TimeUsernameProblemLanguageResultExecution timeMemory
433734medmdgGondola (IOI14_gondola)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> #include "gondola.h" #define ll long long using namespace std; int valid(int n, int inputSeq[]) { int h=1; for(int i=1;i<n;i++){ if(inputSeq[i]!=(inputSeq[i-1]%n+1)) h=0; } return h; } int replacement(int n, int gs[], int rs[]) { vector<pair<ll,ll> > fi(n); fi[0]=make_pair(-1,-1); for(int i=0;i<n;i++){ if(gs[i]<=n){ for(int j=i;j<i+n;j++){ fi[j%n]=make_pair(-gs[j%n],(gs[i]-1+(j-i))%n+1); } break; } } ll pt=0; if(fi[0].second==-1) for(int i=0;i<n;i++){ fi[i]=make_pair(-gs[i],i+1); } sort(fi.begin(),fi.end()); ll ind=n+1; while(fi.size()){ ll k=fi.size()-1; while(ind<=-fi[k].first){ rs[pt]=fi[k].second; fi[k].second=ind; ind++; pt++; } fi.pop_back(); } return pt; } //---------------------- int countReplacement(int n, int inputSeq[]) { return -3; } int main(){ int arr[100000]; int b[7]={2,3,4,9,6,7,1}; ll a=replacement(7,b,arr); }

Compilation message (stderr)

gondola.cpp: In function 'int main()':
gondola.cpp:57:8: warning: unused variable 'a' [-Wunused-variable]
   57 |     ll a=replacement(7,b,arr);
      |        ^
/usr/bin/ld: /tmp/ccupmGnm.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/cclzcTdn.o:gondola.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status