# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
261834 | yabsed | Werewolf (IOI18_werewolf) | C++17 | 4070 ms | 32376 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "werewolf.h"
#include <bits/stdc++.h>
using namespace std;
int ok[3][200555];
vector <int> v[200555];
int f(int s, int e, int l, int r){
queue <int> q;
//printf("%d %d %d %d\n", s, e, l, r);
memset(ok, 0, sizeof(ok));
if(s<=r){
ok[0][s]=1;
q.push(0);
q.push(s);
}
if(l<=s){
ok[1][s]=1;
q.push(1);
q.push(s);
}
while(!q.empty()){
int type=q.front(); q.pop();
int x=q.front(); q.pop();
//printf("%d %d\n", type, x);
if(l<=x&&x<=r&&!ok[!type][x]){
ok[!type][x]=1;
q.push(!type);
q.push(x);
}
for(int i=0;i<v[x].size();i++){
if(type==0){
Compilation message (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... |