# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1041865 | 2024-08-02T08:51:38 Z | 김은성(#11000) | Bring Down the Grading Server (CEOI23_gradingserver) | C++17 | 296 ms | 1048576 KB |
#include <bits/stdc++.h> using namespace std; int s,q; unordered_map<int, bool> dp[309][309][309]; bool win(int ch, int fh, int cg, int fg){ if(dp[ch][fh][cg].find(fg) != dp[ch][fh][cg].end()) return dp[ch][fh][cg][fg]; if(ch == 0) dp[ch][fh][cg][fg] = 0; else if(cg == 0) dp[ch][fh][cg][fg] = 1; else{ dp[ch][fh][cg][fg] = 0; if(fg > 0 && !win(cg, max(fg-1, 0), ch, fh)) dp[ch][fh][cg][fg] = 1; if(ch-fg*s > 0 && !win(max(cg-max(ch-fg*s, 0), 0), fg,ch,fh)) dp[ch][fh][cg][fg] = 1; } return dp[ch][fh][cg][fg]; } int main(){ int ch, fh, cg, fg, i; scanf("%d %d", &s, &q); while(q--){ scanf("%d %d %d %d", &ch, &fh, &cg, &fg); printf("%s\n", win(ch, fh, cg, fg) ? "YES" : "NO"); } return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 286 ms | 1048576 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 280 ms | 1048576 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 280 ms | 1048576 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 296 ms | 1048576 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 280 ms | 1048576 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 280 ms | 1048576 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 280 ms | 1048576 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 280 ms | 1048576 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |