# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
226634 | AaronNaidu | Werewolf (IOI18_werewolf) | C++14 | 333 ms | 32908 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
vector<int> graph[100001];
vector<bool> worksFromStart, worksFromEnd;
queue<int> q;
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<int> toRet;
for (int i = 0; i < x.size(); i++)
{
graph[x[i]].push_back(y[i]);
graph[y[i]].push_back(x[i]);
}
worksFromStart.resize(n);
worksFromEnd.resize(n);
//visited.resize(n);
for (int i = 0; i < s.size(); i++)
{
for (int j = 0; j < n; j++)
{
worksFromStart[j] = false;
worksFromEnd[j] = false;
//visited[j] = false;
}
worksFromStart[s[i]] = true;
q.push(s[i]);
while (!q.empty())
{
int x = q.front();
q.pop();
for (auto j : graph[x])
{
if (!worksFromStart[j] and j >= l[i])
{
worksFromStart[j] = true;
q.push(j);
}
}
}
worksFromEnd[e[i]] = true;
q.push(e[i]);
while (!q.empty())
{
int x = q.front();
q.pop();
for (auto j : graph[x])
{
if (!worksFromEnd[j] and j <= r[i])
{
worksFromEnd[j] = true;
q.push(j);
}
}
}
bool works = false;
for (int j = 0; j < n; j++)
{
if (worksFromStart[j] and worksFromEnd[j])
{
//cout << "Change at " << j << "\n";
works = true;
break;
}
}
toRet.push_back(works);
}
return toRet;
}
컴파일 시 표준 에러 (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... |