# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1029450 | 2024-07-20T22:04:58 Z | vjudge1 | CATS (NOI14_cats) | C++11 | 1500 ms | 262144 KB |
#include <bits/stdc++.h> #define F first #define S second using namespace std; typedef long long ll; typedef vector<ll> vll; ll X,L,N,t; int main(){ scanf("%lld",&t); while(t--){ scanf("%lld %lld %lld",&X,&L,&N); ll con=X; vector<pair<ll,ll>> S1; ll flip=0; while(con>0){ ll T1; ll aux; if(S1.empty()){ T1=0; aux=0; }else{ T1=S1.back().F; aux=S1.back().S; S1.pop_back(); } if((flip-aux)%2==1){ T1^=1; } //FLIP LAST BINARY BIT OF ALL NUMBERS IN S1 flip++; if(T1>L){ con--; if(con==0){ printf("%lld\n",T1); } }else{ ll f1=T1+2*N; S1.push_back({f1,flip}); S1.push_back({f1,flip}); } } } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 12 ms | 344 KB | Output is correct |
2 | Correct | 9 ms | 432 KB | Output is correct |
3 | Correct | 9 ms | 348 KB | Output is correct |
4 | Correct | 7 ms | 436 KB | Output is correct |
5 | Correct | 7 ms | 440 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 482 ms | 416 KB | Output is correct |
2 | Correct | 270 ms | 344 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1521 ms | 344 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1513 ms | 8376 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 325 ms | 262144 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 316 ms | 262144 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |