제출 #400363

#제출 시각아이디문제언어결과실행 시간메모리
400363nikatamlianiBitaro’s Party (JOI18_bitaro)C++14
0 / 100
1 ms204 KiB
#include <bits/stdc++.h> using namespace std; void maxi(int &x, int y) { if(x < y) x = y; } int main() { ios::sync_with_stdio(0); cin.tie(0); const int C = 1005; int n, m, q; cin >> n >> m >> q; vector<vector<int>> g(n+1); vector<vector<int>> r(n+1); for(int i = 1; i <= m; ++i) { int u, v; cin >> u >> v; g[u].push_back(v); r[v].push_back(u); } vector<bool> blocked(n+1); while(q--) { int t, x; cin >> t >> x; vector<int> v(x); for(int i = 0; i < x; ++i) { cin >> v[i]; blocked[v[i]] = 1; } vector<int> dp(n+1, -1e6); dp[t] = 0; for(int i = 1; i <= t; ++i) { if(!blocked[i]) { dp[i] = 0; } for(int x : r[i]) { maxi(dp[i], dp[x]+1); } } cout << dp[t] << '\n'; for(int i : v) blocked[i] = 0; } }

컴파일 시 표준 에러 (stderr) 메시지

bitaro.cpp: In function 'int main()':
bitaro.cpp:8:12: warning: unused variable 'C' [-Wunused-variable]
    8 |  const int C = 1005;
      |            ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...