| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 431631 | Bench0310 | 늑대인간 (IOI18_werewolf) | C++17 | 4013 ms | 30628 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "werewolf.h"
using namespace std;
typedef long long ll;
const int N=200005;
int n,m,q;
vector<int> v[N];
vector<int> solve_small(vector<int> ns,vector<int> ne,vector<int> nl,vector<int> nr)
{
vector<int> res(m,0);
for(int o=0;o<q;o++)
{
int s=ns[o];
int e=ne[o];
int l=nl[o];
int r=nr[o];
vector<array<int,2>> dp(n,{0,0});
queue<array<int,2>> b;
auto add=[&](int a,int t)
{
if(dp[a][t]==0)
{
dp[a][t]=1;
b.push({a,t});
}
};
add(s,0);
while(!b.empty())
{
auto [a,t]=b.front();
b.pop();
if(l<=a&&a<=r&&t==0) add(a,1);
for(int to:v[a])
{
if(t==0&&to>=l) add(to,0);
if(t==1&&to<=r) add(to,1);
}
}
res[o]=dp[e][1];
}
return res;
}
vector<int> check_validity(int nn,vector<int> nx,vector<int> ny,vector<int> ns,vector<int> ne,vector<int> nl,vector<int> nr)
{
n=nn;
m=nx.size();
q=ns.size();
for(int i=0;i<m;i++)
{
v[nx[i]].push_back(ny[i]);
v[ny[i]].push_back(nx[i]);
}
if(n<=3000&&m<=6000&&q<=3000) return solve_small(ns,ne,nl,nr);
}
//int main()
//{
//
// return 0;
//}
컴파일 시 표준 에러 (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... | ||||
