# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
878563 | 2023-11-24T17:46:42 Z | AlexMoysi | Fountain (eJOI20_fountain) | C++14 | 1500 ms | 3692 KB |
#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--; V-=Res[R].volume; while(V>0 && R<N-1) { if(Res[R+1].diameter > Res[R].diameter) V-=Res[R+1].volume; R++; } R++; cout<<R%N<<endl; } return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1561 ms | 3692 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |