Submission #313682

#TimeUsernameProblemLanguageResultExecution timeMemory
313682nekiWand (COCI19_wand)C++14
70 / 70
131 ms6508 KiB
#include <bits/stdc++.h> #define loop(i, a, b) for(long long i=a;i<b;i++) #define pool(i, a, b) for(long long i=a-1;i>=b;i--) #define fore(i, a) for(auto&& i:a) #define fi first #define se second #define ps(a) push_back(a) #define pb(a) pop_back(a) #define sc scanf #define vc vector #define pa pair<ll, ll> #define ll long long #define lb lower_bound #define ub upper_bound #define all(a) a.begin(), a.end() #define llmax LLONG_MAX/2 #define llmin -LLONG_MAX/2 using namespace std; #define mn 101000 #define pa pair<ll, ll> #define ld long double ll vis[mn], can[mn]; vc<ll> edg[mn]; void dfs(ll u){ vis[u]=1; fore(v, edg[u]){ can[v]=1; if(!vis[v]) dfs(v); } } int main(){ ll n, m;cin >> n>> m; loop(i, 0, m){ ll a, b;cin >> a >>b; edg[b].ps(a); } dfs(1); if(edg[1].size()==0) can[1]=1; loop(i, 1, n+1) cout << can[i];cout << endl; }

Compilation message (stderr)

wand.cpp: In function 'int main()':
wand.cpp:2:23: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
    2 | #define loop(i, a, b) for(long long i=a;i<b;i++)
      |                       ^~~
wand.cpp:39:5: note: in expansion of macro 'loop'
   39 |     loop(i, 1, n+1) cout << can[i];cout << endl;
      |     ^~~~
wand.cpp:39:36: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   39 |     loop(i, 1, n+1) cout << can[i];cout << endl;
      |                                    ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...