Submission #253330

#TimeUsernameProblemLanguageResultExecution timeMemory
253330mamadmokhiPlaninarenje (COCI18_planinarenje)C++17
160 / 160
11 ms896 KiB
// In the name of Allah // There is no power but from God the Almighty // No God except Allah #include <bits/stdc++.h> #define mp make_pair #define f1 first #define f2 second #define pb push_back #define pii pair<int ,int> #define ios ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); using namespace std; const int mox=5e3+9; vector<int> v[2*mox]; bool visit[2*mox]; int mach[2*mox]; bool win[mox]; bool dfs(int x) { if(visit[x]) return 0; visit[x]=1; win[x]=1; for(int i:v[x]) { if(mach[i]==0||dfs(mach[i])) { mach[i]=x; mach[x]=i; return 1; } } return 0; } int32_t main() { ios int n,m; cin>>n>>m; for(int i=0 ; i<m ; i++) { int a,b; cin>>a>>b; v[a].pb(b+n); } for(int i=1 ; i<=n ; i++) { dfs(i); memset(visit,0,sizeof(visit)); } memset(win,0,sizeof(win)); for(int i=1 ; i<=n ; i++) { if(mach[i]==0) { dfs(i); memset(visit,0,sizeof(visit)); } } for(int i=1 ; i<=n ; i++) { if(win[i]) { cout<<"Mirko"<<'\n'; } else cout<<"Slavko"<<'\n'; } }

Compilation message (stderr)

planinarenje.cpp: In function 'bool dfs(int)':
planinarenje.cpp:19:8: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
        if(visit[x])
        ^~
planinarenje.cpp:21:10: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
          visit[x]=1;
          ^~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...