# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1009276 | 2024-06-27T10:50:27 Z | HappyCapybara | 늑대인간 (IOI18_werewolf) | C++17 | 4000 ms | 31100 KB |
#include "werewolf.h" #include<bits/stdc++.h> using namespace std; vector<int> check_validity(int N, vector<int> X, vector<int> Y, vector<int> S, vector<int> E, vector<int> L, vector<int> R){ vector<vector<int>> g(N); for (int i=0; i<X.size(); i++){ g[X[i]].push_back(Y[i]); g[Y[i]].push_back(X[i]); } vector<int> A(S.size(), 0); for (int i=0; i<S.size(); i++){ vector<bool> seen(N, false); queue<int> q; q.push(S[i]); unordered_set<int> reach; while (!q.empty()){ int cur = q.front(); q.pop(); if (seen[cur]) continue; if (cur < L[i]) continue; seen[cur] = true; reach.insert(cur); for (int next : g[cur]) q.push(next); } for (int j=0; j<seen.size(); j++) seen[j] = false; q.push(E[i]); while (!q.empty()){ int cur = q.front(); q.pop(); if (seen[cur]) continue; if (cur > R[i]) continue; seen[cur] = true; if (reach.find(cur) != reach.end()){ A[i] = 1; break; } for (int next : g[cur]) q.push(next); } } return A; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 344 KB | Output is correct |
2 | Correct | 1 ms | 348 KB | Output is correct |
3 | Correct | 1 ms | 348 KB | Output is correct |
4 | Correct | 1 ms | 344 KB | Output is correct |
5 | Correct | 1 ms | 604 KB | Output is correct |
6 | Correct | 1 ms | 348 KB | Output is correct |
7 | Correct | 1 ms | 348 KB | Output is correct |
8 | Correct | 1 ms | 348 KB | Output is correct |
9 | Correct | 1 ms | 348 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 344 KB | Output is correct |
2 | Correct | 1 ms | 348 KB | Output is correct |
3 | Correct | 1 ms | 348 KB | Output is correct |
4 | Correct | 1 ms | 344 KB | Output is correct |
5 | Correct | 1 ms | 604 KB | Output is correct |
6 | Correct | 1 ms | 348 KB | Output is correct |
7 | Correct | 1 ms | 348 KB | Output is correct |
8 | Correct | 1 ms | 348 KB | Output is correct |
9 | Correct | 1 ms | 348 KB | Output is correct |
10 | Correct | 359 ms | 1000 KB | Output is correct |
11 | Correct | 257 ms | 1016 KB | Output is correct |
12 | Correct | 29 ms | 856 KB | Output is correct |
13 | Correct | 236 ms | 856 KB | Output is correct |
14 | Correct | 107 ms | 992 KB | Output is correct |
15 | Correct | 345 ms | 1072 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 4067 ms | 31100 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 344 KB | Output is correct |
2 | Correct | 1 ms | 348 KB | Output is correct |
3 | Correct | 1 ms | 348 KB | Output is correct |
4 | Correct | 1 ms | 344 KB | Output is correct |
5 | Correct | 1 ms | 604 KB | Output is correct |
6 | Correct | 1 ms | 348 KB | Output is correct |
7 | Correct | 1 ms | 348 KB | Output is correct |
8 | Correct | 1 ms | 348 KB | Output is correct |
9 | Correct | 1 ms | 348 KB | Output is correct |
10 | Correct | 359 ms | 1000 KB | Output is correct |
11 | Correct | 257 ms | 1016 KB | Output is correct |
12 | Correct | 29 ms | 856 KB | Output is correct |
13 | Correct | 236 ms | 856 KB | Output is correct |
14 | Correct | 107 ms | 992 KB | Output is correct |
15 | Correct | 345 ms | 1072 KB | Output is correct |
16 | Execution timed out | 4067 ms | 31100 KB | Time limit exceeded |
17 | Halted | 0 ms | 0 KB | - |