# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
624750 |
2022-08-08T16:47:56 Z |
1ne |
Werewolf (IOI18_werewolf) |
C++14 |
|
171 ms |
12664 KB |
#include "werewolf.h"
#include <bits/stdc++.h>
using namespace std;
struct DSU {
vector<int>parent,sz;
void build(int n){
parent.resize(n);
sz.resize(n);
for (int i = 0;i<n;++i){
parent[i] = i;
sz[i] = 1;
}
}
int findsets(int v){
if (v == parent[v])return v;
parent[v] = findsets(parent[v]);
return parent[v];
}
bool unionset(int u,int v){
u = findsets(u);
v = findsets(v);
if (u == v)return false;
if (sz[u] < sz[v])swap(u,v);
sz[u]+=sz[v];
parent[v] = u;
return true;
}
};
/*
6 6 3
1 5
1 2
1 3
3 4
0 3
2 5
4 2 1 2
4 2 2 2
5 4 3 4
*/
std::vector<int> check_validity(int N, std::vector<int> X, std::vector<int> Y,
std::vector<int> S, std::vector<int> E,
std::vector<int> L, std::vector<int> R) {
int q = (int)S.size();
vector<int>ans(q,0);
int m = (int)X.size();
vector<pair<int,int>>edges;
for (int i = 0;i<m;++i){
if (X[i] > Y[i])swap(X[i],Y[i]);
edges.push_back({X[i],Y[i]});
}
sort(edges.begin(),edges.end());
for (int i = 0;i<q;++i){
//cout<<'\n';
if (S[i] < L[i])ans[i] = 0;
else if (E[i] > R[i])ans[i] = 0;
else{
ans[i] = 1;
}
}
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
171 ms |
12664 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |