Submission #794180

#TimeUsernameProblemLanguageResultExecution timeMemory
794180alvingogoToy Train (IOI17_train)C++14
5 / 100
5 ms1236 KiB
#include "train.h" #include <bits/stdc++.h> #pragma GCC optimize("Ofast") #define AquA cin.tie(0);ios_base::sync_with_stdio(0); #define fs first #define sc second #define p_q priority_queue using namespace std; typedef long long ll; const ll inf=1e9; void print(auto& a){ return; for(auto h:a){ cerr << h << " "; } cerr << "\n"; } vector<int> who_wins(vector<int> a, vector<int> r, vector<int> u, vector<int> v) { int n=a.size(),m=u.size(); vector<int> ans(n); vector<vector<int> > e(n); for(int i=0;i<m;i++){ e[u[i]].push_back(v[i]); } for(int i=n-1;i>=0;i--){ int mx=0,mn=1; for(auto y:e[i]){ if(y==i){ if(r[i]==1){ mx=1; } else{ mn=0; } } else{ mx=max(mx,ans[y]); mn=min(mn,ans[y]); } } if(a[i]==0){ ans[i]=mn; } else{ ans[i]=mx; } } return ans; }

Compilation message (stderr)

train.cpp:12:12: warning: use of 'auto' in parameter declaration only available with '-fconcepts-ts'
   12 | void print(auto& a){
      |            ^~~~
#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...