# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1066926 | 2024-08-20T08:51:31 Z | Muhammad_Aneeq | 늑대인간 (IOI18_werewolf) | C++17 | 4000 ms | 30412 KB |
#include <vector> #include <queue> #include <iostream> #include <algorithm> #include "bits/stdc++.h" using namespace std; int const N=2e5+10; vector<int>nei[N]={}; bool reach[N]={}; bool bfs(int u,int v,int l,int r) { queue<pair<int,int>>Q; Q.push({0,u}); reach[u]=1; while (Q.size()) { int city,form; tie(form,city)=Q.front(); Q.pop(); for (auto j:nei[city]) { if (city<l&&j>r) continue; if (city>r&&j<l) continue; if (reach[j]) continue; if (j>r&&form==1) continue; if (j<l) Q.push({1,j}); else if (j>r&&form==0) Q.push({0,j}); else Q.push({form,j}); reach[j]=1; } } return reach[v]; } vector<int> check_validity(int N, vector<int> X, vector<int> Y,vector<int> S, vector<int> E,vector<int> L, vector<int> R) { for (int i=0;i<X.size();i++) { nei[X[i]].push_back(Y[i]); nei[Y[i]].push_back(X[i]); } vector<int>ans; for (int i=0;i<S.size();i++) { ans.push_back(bfs(S[i],E[i],L[i],R[i])); for (int j=0;j<N;j++) reach[j]=0; } return ans; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 4956 KB | Output is correct |
2 | Correct | 2 ms | 4956 KB | Output is correct |
3 | Correct | 3 ms | 4956 KB | Output is correct |
4 | Correct | 2 ms | 4956 KB | Output is correct |
5 | Correct | 2 ms | 4956 KB | Output is correct |
6 | Correct | 2 ms | 5140 KB | Output is correct |
7 | Correct | 3 ms | 4956 KB | Output is correct |
8 | Correct | 2 ms | 4956 KB | Output is correct |
9 | Correct | 2 ms | 4956 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 4956 KB | Output is correct |
2 | Correct | 2 ms | 4956 KB | Output is correct |
3 | Correct | 3 ms | 4956 KB | Output is correct |
4 | Correct | 2 ms | 4956 KB | Output is correct |
5 | Correct | 2 ms | 4956 KB | Output is correct |
6 | Correct | 2 ms | 5140 KB | Output is correct |
7 | Correct | 3 ms | 4956 KB | Output is correct |
8 | Correct | 2 ms | 4956 KB | Output is correct |
9 | Correct | 2 ms | 4956 KB | Output is correct |
10 | Incorrect | 204 ms | 5492 KB | Output isn't correct |
11 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 4062 ms | 30412 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 4956 KB | Output is correct |
2 | Correct | 2 ms | 4956 KB | Output is correct |
3 | Correct | 3 ms | 4956 KB | Output is correct |
4 | Correct | 2 ms | 4956 KB | Output is correct |
5 | Correct | 2 ms | 4956 KB | Output is correct |
6 | Correct | 2 ms | 5140 KB | Output is correct |
7 | Correct | 3 ms | 4956 KB | Output is correct |
8 | Correct | 2 ms | 4956 KB | Output is correct |
9 | Correct | 2 ms | 4956 KB | Output is correct |
10 | Incorrect | 204 ms | 5492 KB | Output isn't correct |
11 | Halted | 0 ms | 0 KB | - |