QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#524712 | #7277. Bring Down the | Dan4Life# | 0 | 1096ms | 3576kb | C++23 | 919b | 2024-08-20 02:15:37 | 2024-08-20 02:15:38 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define sz(a) (int)a.size()
#define all(a) begin(a),end(a)
using ll = long long;
using vi = vector<int>;
using ar2 = array<int,2>;
int main(){
ios_base::sync_with_stdio(false); cin.tie(0);
ll S; int q; cin >> S >> q;
for(int _ = 0; _ < q; _++){
ll CH, FH, CG, FG;
cin >> CH >> FH >> CG >> FG;
bool ans = 0;
for(int fg = 0; fg <= FG; fg++){
bool ok = 1;
for(int fh = 0; fh <= FH; fh++){
bool turn = 0, won = 0;
ll ch = CH, cg = CG;
while(1){
if(cg<=fh*S and ch<=fg*S){
won=1; break;
}
if(turn and cg>fh*S){
ch-=cg-fh*S;
if(ch<=0) { won=1; break;}
}
else if(!turn and ch>fg*S){
cg-=ch-fg*S;
if(cg<=0) break;
}
turn^=1;
}
ok&=won;
}
if(ok) { ans=1; break; }
}
cout << (!ans?"YES":"NO") << "\n";
}
}
详细
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 5
Accepted
time: 0ms
memory: 3576kb
input:
17 2 42 1 33 1 42 1 33 7
output:
YES NO
result:
ok 2 token(s): yes count is 1, no count is 1
Test #2:
score: 0
Wrong Answer
time: 1096ms
memory: 3564kb
input:
2 250000 75 16 56 55 50 9 49 60 18 67 62 5 30 54 61 39 22 39 42 31 26 30 55 1 23 30 53 16 55 13 6 44 69 8 58 72 53 7 60 12 29 14 26 34 37 64 24 71 19 3 40 1 64 13 33 65 67 24 68 3 64 17 50 66 71 6 62 13 15 29 26 24 51 30 34 45 46 5 40 72 54 52 60 49 35 21 18 30 39 31 35 34 30 74 72 5 74 12 6 15 11 4...
output:
NO NO YES NO NO YES NO NO NO YES NO NO NO NO YES NO YES NO NO NO NO NO NO YES YES NO YES YES NO YES YES NO NO YES NO NO NO NO NO NO NO NO NO NO NO NO NO NO YES NO NO NO NO YES NO YES NO NO NO NO NO NO NO NO NO NO NO NO NO YES NO YES NO YES YES NO YES NO NO NO NO NO NO NO NO NO NO YES NO NO NO NO NO ...
result:
wrong answer expected YES, found NO [4th token]
Subtask #2:
score: 0
Skipped
Dependency #1:
0%
Subtask #3:
score: 0
Time Limit Exceeded
Test #28:
score: 0
Time Limit Exceeded
input:
1 250000 554333015044 833858497873 833858497874 554333015044 655160857180 306396306924 306396306917 655160857187 374728598365 176680698490 176680698490 374728598365 764650258714 835600427315 835600427309 764650258720 521594231110 318048536486 318048536482 521594231115 273627794040 449769302710 10899...
output:
result:
Subtask #4:
score: 0
Skipped
Dependency #2:
0%
Subtask #5:
score: 0
Skipped
Dependency #3:
0%
Subtask #6:
score: 0
Skipped
Dependency #1:
0%
Subtask #7:
score: 0
Skipped
Dependency #1:
0%