답안 #676137

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
676137 2022-12-29T12:28:40 Z coding_snorlax 늑대인간 (IOI18_werewolf) C++14
15 / 100
899 ms 41856 KB
#include<bits/stdc++.h>
#include "werewolf.h"
using namespace std;
vector<int> G[200002];
int vis1[3002]={0};
int vis2[3002]={0};
void dfs_L(int node,int Left_bound){
    vis1[node]=1;
    for(int i:G[node]) {if(!vis1[i] && i>=Left_bound) dfs_L(i,Left_bound);};
}
void dfs_R(int node,int Right_bound){
    vis2[node]=1;
    for(int i:G[node]) {if(!vis2[i] && i<=Right_bound) dfs_R(i,Right_bound);};
}
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> answer;
    for(int i=0;i<(int)X.size();i++){G[X[i]].push_back(Y[i]);G[Y[i]].push_back(X[i]);}
    for(int i=0;i<(int)S.size();i++){
        for(int j=0;j<N;j++) vis1[j]=0;
        dfs_L(S[i],L[i]);
        for(int j=0;j<N;j++) vis2[j]=0;
        dfs_R(E[i],R[i]);
        int flag=0;
        for(int i=0;i<N;i++){
            if(vis1[i]&&vis2[i]) flag=1;
        }
        if(flag) answer.push_back(1);
        else answer.push_back(0);
    }
    return answer;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 4948 KB Output is correct
2 Correct 4 ms 4948 KB Output is correct
3 Correct 3 ms 4948 KB Output is correct
4 Correct 2 ms 5000 KB Output is correct
5 Correct 3 ms 4948 KB Output is correct
6 Correct 3 ms 5004 KB Output is correct
7 Correct 3 ms 4948 KB Output is correct
8 Correct 3 ms 4948 KB Output is correct
9 Correct 3 ms 4948 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 4948 KB Output is correct
2 Correct 4 ms 4948 KB Output is correct
3 Correct 3 ms 4948 KB Output is correct
4 Correct 2 ms 5000 KB Output is correct
5 Correct 3 ms 4948 KB Output is correct
6 Correct 3 ms 5004 KB Output is correct
7 Correct 3 ms 4948 KB Output is correct
8 Correct 3 ms 4948 KB Output is correct
9 Correct 3 ms 4948 KB Output is correct
10 Correct 244 ms 5500 KB Output is correct
11 Correct 144 ms 5356 KB Output is correct
12 Correct 21 ms 5428 KB Output is correct
13 Correct 261 ms 5392 KB Output is correct
14 Correct 175 ms 5352 KB Output is correct
15 Correct 210 ms 5436 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Runtime error 899 ms 41856 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 4948 KB Output is correct
2 Correct 4 ms 4948 KB Output is correct
3 Correct 3 ms 4948 KB Output is correct
4 Correct 2 ms 5000 KB Output is correct
5 Correct 3 ms 4948 KB Output is correct
6 Correct 3 ms 5004 KB Output is correct
7 Correct 3 ms 4948 KB Output is correct
8 Correct 3 ms 4948 KB Output is correct
9 Correct 3 ms 4948 KB Output is correct
10 Correct 244 ms 5500 KB Output is correct
11 Correct 144 ms 5356 KB Output is correct
12 Correct 21 ms 5428 KB Output is correct
13 Correct 261 ms 5392 KB Output is correct
14 Correct 175 ms 5352 KB Output is correct
15 Correct 210 ms 5436 KB Output is correct
16 Runtime error 899 ms 41856 KB Execution killed with signal 11
17 Halted 0 ms 0 KB -