# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
960955 | Trisanu_Das | Simurgh (IOI17_simurgh) | C++17 | 252 ms | 3676 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"simurgh.h"
#ifndef EVAL
#include"grader.cpp"
#endif
#include<bits/stdc++.h>
using namespace std;
int g[55][55],good[3025],n,used[55];
vector<int>cur;
void init(int v){
used[v]=1;
for(int i=0;i<n;i++)
if(!used[i]&&g[v][i]>=0){
cur.push_back(g[v][i]);
init(i);
}
}
void dfs(int v){
used[v]=1;
for(int i=0;i<n;i++)
if(used[i]==0&&g[v][i]>=0&&good[g[v][i]]==1)dfs(i);
}
bool check(){
memset(used,0,sizeof(used));
memset(good,0,sizeof(good));
for(int i:cur)good[i]=1;
dfs(0);
for(int i=0;i<n;i++)
if(used[i]==0)return 0;
return 1;
}
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |