# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
97311 | E869120 | Werewolf (IOI18_werewolf) | C++14 | 248 ms | 28028 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "werewolf.h"
#include <bits/stdc++.h>
using namespace std;
int N, M, Q, dp[5009][2]; vector<int>G[5009];
vector<int> check_validity(int NN, vector<int> X, vector<int> Y, vector<int> S, vector<int> E, vector<int> L, vector<int> R) {
N = NN; M = X.size(); Q = S.size();
for (int i = 0; i < N; i++) { G[X[i]].push_back(Y[i]); G[Y[i]].push_back(X[i]); }
vector<int>ans;
for (int i = 0; i < Q; i++) {
for (int j = 1; j <= N; j++) { dp[j][0] = 0; dp[j][1] = 0; }
dp[S[i]][0] = 1; queue<pair<int, int>> que; que.push(make_pair(S[i], 0));
while(!que.empty()){
int pos1 = que.front().first, pos2 = que.front().second; que.pop();
if (pos2 == 0 && dp[pos1][1] == 0 && L[i] <= pos1 && pos1 <= R[i]) {
dp[pos1][1] = 1;
que.push(make_pair(pos1, 1));
}
for (int j = 0; j < G[pos1].size(); j++) {
int to = G[pos1][j];
if (pos2 == 0 && to < L[i]) continue;
if (pos2 == 1 && R[i] < to) continue;
if (dp[to][pos2] == 1) continue;
dp[to][pos2] = 1;
que.push(make_pair(to, pos2));
}
}
ans.push_back(dp[E[i]][1]);
}
return ans;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |