Submission #1068243

#TimeUsernameProblemLanguageResultExecution timeMemory
1068243edogawa_somethingToy Train (IOI17_train)C++17
0 / 100
7 ms1628 KiB
#include "train.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll,ll> pii; typedef vector<ll> vii; #define F first #define S second #define all(v) v.begin(),v.end() #define pb push_back vii adj[5001],radj[5001]; vector<int>a,r,answer; ll dfs(ll x) { if(adj[x].size()==1) { if(adj[x][0]==x) return r[x]; else return dfs(x+1); } if(!(a[x]^r[x])) return dfs(x+1); return a[x]; } vector<int> who_wins(std::vector<int> A, std::vector<int> R, std::vector<int> u, std::vector<int> v) { a=A,r=R; for(int i=0;i<u.size();i++) adj[u[i]].pb(v[i]); for(int i=0;i<a.size();i++) { answer.pb(dfs(i)); } return answer; }

Compilation message (stderr)

train.cpp: In function 'std::vector<int> who_wins(std::vector<int>, std::vector<int>, std::vector<int>, std::vector<int>)':
train.cpp:26:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   26 |    for(int i=0;i<u.size();i++)
      |                ~^~~~~~~~~
train.cpp:28:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   28 |   for(int i=0;i<a.size();i++) {
      |               ~^~~~~~~~~
#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...