이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
int main() { ios_base::sync_with_stdio(0),ios::sync_with_stdio(0),cin.tie(0),cout.tie(0); int z; cin >>z; while(z--){long long q,d,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 |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |