| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 222091 | kartel | Wand (COCI19_wand) | C++14 | 43 ms | 7416 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define in(x) freopen(x,"r",stdin)
#define out(x) freopen(x,"w",stdout)
#define F first
#define S second
#define pb push_back
#define M ll(998244353)
#define inf ll(2e9+7)
#define N ll(200500)
#define sz(x) x.size()
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#define el '\n'
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
//typedef tree <ll, null_type, less_equal <ll>, rb_tree_tag, tree_order_statistics_node_update> os;
int mrk[N];
int q, n, x, y, i;
vector <int> g[N];
void dfs(int v)
{
    for (auto u : g[v])
        {
            if (mrk[u]) continue;
            mrk[u] = 1;
            dfs(u);
        }
}
int main()
{
//    in("input.txt");
//    out("output.txt");
    ios_base::sync_with_stdio(false);
    iostream::sync_with_stdio(false);
    cin.tie(NULL);
    cin >> n >> q;
    while (q--)
    {
        cin >> x >> y;
        g[y].pb(x);
    }
    if (g[1].size() == 0) mrk[1] = 1;
    dfs(1);
    for (i = 1; i <= n; i++) cout << mrk[i];
}
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
