제출 #418387

#제출 시각아이디문제언어결과실행 시간메모리
418387rGamerToy Train (IOI17_train)C++17
0 / 100
1975 ms262148 KiB
#include <bits/stdc++.h> using namespace std; vector<int> ans; int dp(vector<int> &a, vector<int> &r, vector<vector<int>> gp, int poz) { if(ans[poz] != -1) return ans[poz]; int cur; if(a[poz]) { cur = (gp[poz].size() > 1 and r[poz]) ? 1 : dp(a, r, gp, poz + 1); } else cur = (gp[poz].size() > 1 and !r[poz]) ? 0 : dp(a, r, gp, poz + 1); return ans[poz] = cur; } vector<int> who_wins(vector<int> a, vector<int> r, vector<int> u, vector<int> v) { int n = a.size(), m = u.size(); ans = vector<int>(n, -1); vector<vector<int>> gp(n); for(int i = 0; i < m; ++i) gp[u[i]].push_back(v[i]); ans[n - 1] = r[n - 1]; int kz = 0; while(kz < n) { if(ans[kz] == -1) dp(a, r, gp, kz); kz++; } return ans; }

컴파일 시 표준 에러 (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:7: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   26 |       if(ans[kz] == -1)
      |       ^~
train.cpp:28:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   28 |         kz++;
      |         ^~
#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...