Submission #983771

#TimeUsernameProblemLanguageResultExecution timeMemory
983771AmaarsaaBitaro’s Party (JOI18_bitaro)C++14
0 / 100
1 ms3416 KiB
#include<bits/stdc++.h> using namespace std; using ll = long long ; vector < ll > adj[100004]; int main() { // freopen("moocast.in", "r", stdin); // freopen("moocast.out", "w", stdout); ios::sync_with_stdio(false); cin.tie(NULL); ll t, n, m, ans, s, sum, x, y, r, p, i, j, Q; cin >> n >> m >> Q; for ( i = 1; i <= m; i ++) { cin >> x >> y; adj[y].push_back(x); } ll d[100004]; for (i = 1; i <= n; i ++) d[i] = 0; queue < ll > q; cin >> x; ll xx = x; q.push(x); d[x] = 0; while(!q.empty()) { x = q.front(); q.pop(); for ( ll X : adj[x]) { if ( d[X] < d[x] + 1) { d[X]= d[x] + 1; q.push(X); } } } cin >> m; for (i = 1; i <= m; i ++) { cin >> x; d[x]= -1; } ans = -1; for (i = 1; i <= n; i ++) { if (i == xx) continue; ans = max(ans, d[i]); } cout << ans << endl; }

Compilation message (stderr)

bitaro.cpp: In function 'int main()':
bitaro.cpp:11:5: warning: unused variable 't' [-Wunused-variable]
   11 |  ll t, n, m, ans, s, sum, x, y, r, p, i, j, Q;
      |     ^
bitaro.cpp:11:19: warning: unused variable 's' [-Wunused-variable]
   11 |  ll t, n, m, ans, s, sum, x, y, r, p, i, j, Q;
      |                   ^
bitaro.cpp:11:22: warning: unused variable 'sum' [-Wunused-variable]
   11 |  ll t, n, m, ans, s, sum, x, y, r, p, i, j, Q;
      |                      ^~~
bitaro.cpp:11:33: warning: unused variable 'r' [-Wunused-variable]
   11 |  ll t, n, m, ans, s, sum, x, y, r, p, i, j, Q;
      |                                 ^
bitaro.cpp:11:36: warning: unused variable 'p' [-Wunused-variable]
   11 |  ll t, n, m, ans, s, sum, x, y, r, p, i, j, Q;
      |                                    ^
bitaro.cpp:11:42: warning: unused variable 'j' [-Wunused-variable]
   11 |  ll t, n, m, ans, s, sum, x, y, r, p, i, j, Q;
      |                                          ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...