Submission #1031165

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
10311652024-07-22 15:43:27belgianbotBitaro’s Party (JOI18_bitaro)C++14
14 / 100
91 ms24400 KiB
#include <bits/stdc++.h>
using namespace std;
int N, M, Q;
vector<vector<int>> adj, revAdj;
vector<int> memo;
int goal;
int dp(int pos) {
if (pos > goal) return INT_MIN;
if (pos == goal) return 0;
if (memo[pos] != -1) return memo[pos];
int ans = INT_MIN;
for (int x : adj[pos]) {
ans = max(ans, dp(x) + 1);
}
return memo[pos] = ans;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
cin >> N >> M >> Q;
adj.resize(N); revAdj.resize(N);
for (int i = 0; i < M; i++) {
int a, b; cin >> a >> b; a--; b--;
adj[a].push_back(b);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...