#include <bits/stdc++.h>
using namespace std;
int main ()
{int z; cin >>z; while(z--){long long q,d;long long s=0,t=0,x=0; cin >> q>>d; for(long long z2=0;z2<q;z2++) {long long q2; cin >> q2;
if(q2>=d ) { while(q2>=d){if(x==0) {s+=d; q2-=d; x=4; } else { t+=d; q2-=d; x=0;} } if(q2>0){if(x==0)s+=q2,q2=0,x=4;else t+=q2,q2=0,x=0; }}else { if(x==0) s+=q2,q2=0,x=4; else t+=q2,q2=0,x=0; }} if(s>t)cout<<1; else cout<<0; } }
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2047 ms |
204 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
292 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
35 ms |
536 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
189 ms |
936 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2062 ms |
300 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2023 ms |
204 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2052 ms |
636 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2031 ms |
888 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |