fountain.cpp:1:20: warning: extra tokens at end of #include directive
1 | #include <iostream>#include <vector>using namespace std;struct Reservoir{ int diameter, volume;};int main(){ int N, Q; cin>>N>>Q; vector<Reservoir> Res; Res.resize(N); for(size_t c=0; c<N; c++) cin>>Res[c].diameter>>Res[c].volume; for(size_t c=0; c<Q; c++) { int R, V; cin>>R>>V; R--; // make 0 indexed V-=Res[R].volume; int r = R; while(V>0 && r<N) { if(Res[r].diameter > Res[R].diameter) { V-=Res[r].volume; R=r; } r++; } R++; // return to 1 indexed if(r == N) R = 0; cout<<R<<endl; } return 0;}
| ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/crt1.o: in function `_start':
(.text+0x24): undefined reference to `main'
collect2: error: ld returned 1 exit status