Submission #797087

#TimeUsernameProblemLanguageResultExecution timeMemory
797087ShithilaAliens (IOI16_aliens)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; const int mod = 1e9; int main() { int n; int m; cin>>n>>m; int arr[n]; int blocksize=350; vector<int> cos((n/blocksize)+1); vector<multiset<int> > chek((n/blocksize)+1); for(int ll=0;ll<n;ll++) { cin>>arr[ll]; chek[ll/blocksize].insert(arr[ll]); } for(int ll=0;ll<m;ll++) { char com; cin>>com; if(com=='+') { int l; int r; int x; cin>>l>>r>>x; l--; r--; for(int i=l;i<=r;) { if(i%blocksize==0 && i+blocksize<r) { cos[i/blocksize]+=x; i+=blocksize; } else { chek[i/blocksize].erase(chek[i/blocksize].find(arr[i])); arr[i]=arr[i]+x; chek[i/blocksize].insert(arr[i]); i++; } } } else { int l; int r; int y; cin>>l>>r>>y; l--; r--; bool found=false; for(int i=l;i<=r;) { if(i%blocksize==0 && i+blocksize<r) { if(chek[i/blocksize].find(y-cos[i/blocksize])!=chek[i/blocksize].end()) { found=true; } i+=blocksize; } else { if(arr[i]+cos[i/blocksize]==y) { found=true; } i++; } } if(found==true) { cout<<"YES"<<endl; } else cout<<"NO"<<endl; } } }

Compilation message (stderr)

/usr/bin/ld: /tmp/cc0t3XFq.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/cco5jPQo.o:aliens.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/cc0t3XFq.o: in function `main':
grader.cpp:(.text.startup+0xf0): undefined reference to `take_photos(int, int, int, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status