| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 97365 | mayhoubsaleh | Wand (COCI19_wand) | C++14 | 154 ms | 5296 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
using namespace std;
int n,m,a,b;
vector<int>v[100005];
bool ans[100005],vis[100005];
void dfs(int nod){
    vis[nod]=1;
    for(auto i:v[nod]){
        ans[i]=1;
        if(!vis[i])dfs(i);
    }
}
int main(){
    cin>>n>>m;
    ans[1]=1;
    for(int i=0;i<m;i++){
        cin>>a>>b;
        if(b==1)ans[1]=0;
        v[b].pb(a);
    }
    dfs(1);
    for(int i=1;i<=n;i++){
        cout<<ans[i];
    }
    return 0;
}
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
