# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
521018 | 2022-01-31T15:40:59 Z | Valaki2 | Split the Attractions (IOI19_split) | C++14 | 82 ms | 10728 KB |
#include "split.h" using namespace std; #include <iostream> /* 10 9 3 5 2 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 0 */ int hatra; vector<int> res; vector<vector<int> > g; void dfs(int x) { if(!hatra) return; hatra--; res[x] = 2; for(int y : g[x]) { if(res[y] == 3) { dfs(y); } } } vector<int> find_split(int n, int a, int b, int c, vector<int> p, vector<int> q) { res.assign(n, 3); g.resize(n); for(int i = 0; i < p.size(); i++) { g[p[i]].push_back(q[i]); g[q[i]].push_back(p[i]); } hatra = b; dfs(1); for(int i = 0; i < n; i++) { if(res[i] == 3) { res[i] = 1; break; } } return res; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | ok, correct split |
2 | Correct | 1 ms | 204 KB | ok, correct split |
3 | Correct | 1 ms | 204 KB | ok, correct split |
4 | Incorrect | 1 ms | 204 KB | invalid split: #1=1, #2=1, #3=2 |
5 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | ok, correct split |
2 | Correct | 0 ms | 204 KB | ok, correct split |
3 | Correct | 1 ms | 204 KB | ok, correct split |
4 | Correct | 61 ms | 9592 KB | ok, correct split |
5 | Correct | 47 ms | 8548 KB | ok, correct split |
6 | Correct | 43 ms | 8476 KB | ok, correct split |
7 | Correct | 66 ms | 9472 KB | ok, correct split |
8 | Correct | 82 ms | 10728 KB | ok, correct split |
9 | Correct | 54 ms | 8516 KB | ok, correct split |
10 | Correct | 45 ms | 8584 KB | ok, correct split |
11 | Correct | 46 ms | 8644 KB | ok, correct split |
12 | Correct | 40 ms | 8888 KB | ok, correct split |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 288 KB | invalid split: #1=1, #2=1, #3=3 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 204 KB | invalid split: #1=1, #2=2, #3=6 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | ok, correct split |
2 | Correct | 1 ms | 204 KB | ok, correct split |
3 | Correct | 1 ms | 204 KB | ok, correct split |
4 | Incorrect | 1 ms | 204 KB | invalid split: #1=1, #2=1, #3=2 |
5 | Halted | 0 ms | 0 KB | - |