# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
286192 | 2020-08-30T08:13:53 Z | spdskatr | Viruses (BOI20_viruses) | C++14 | 1 ms | 384 KB |
#include <cstdio> #include <cstdlib> #include <algorithm> #include <vector> using namespace std; int G, N, M, dp[105]; vector<int> rec[105]; vector<int> mut[105]; vector<int> nice[105]; int main() { scanf("%d %d %d", &G, &N, &M); for (int i = 0; i < N; i++) { int a, k; scanf("%d %d", &a, &k); rec[a].push_back(i); for (int j = 0; j < k; j++) { int v; scanf("%d", &v); mut[i].push_back(v); } } dp[0] = dp[1] = 1; for (int i = 2; i < G; i++) dp[i] = 696969; for (int t = 0; t < G; t++) { for (int g = 2; g < G; g++) { for (int i : rec[g]) { int val = 0; for (int v : mut[i]) { val += dp[v]; } dp[g] = min(dp[g], val); } } } for (int i = 2; i < G; i++) { if (dp[i] >= 696969) { printf("YES\n"); } else { printf("NO %d\n", dp[i]); } } }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 256 KB | Output is correct |
2 | Correct | 1 ms | 256 KB | Output is correct |
3 | Incorrect | 0 ms | 256 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 256 KB | Output is correct |
2 | Correct | 1 ms | 256 KB | Output is correct |
3 | Incorrect | 1 ms | 384 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 384 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 256 KB | Output is correct |
2 | Correct | 1 ms | 256 KB | Output is correct |
3 | Incorrect | 0 ms | 256 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 256 KB | Output is correct |
2 | Correct | 1 ms | 256 KB | Output is correct |
3 | Incorrect | 0 ms | 256 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |