# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
797456 | Sami_Massah | Bitaro’s Party (JOI18_bitaro) | C++17 | 768 ms | 150412 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
const int maxn = 200000 + 12, sq = 100;
int n, m, dp[maxn], best[maxn];
vector <int> bconn[maxn], now;
vector <pair<int, int>> pos[maxn];
bitset <maxn> marked;
int main(){
ios_base::sync_with_stdio(false), cin.tie(0);
int q;
cin >> n >> m >> q;
for(int i = 0; i < m; i++){
int a, b;
cin >> a >> b;
bconn[b].push_back(a);
}
for(int i = 1; i <= n; i++){
pos[i].push_back(make_pair(0, i));
marked = 0;
for(int j: bconn[i]){
for(auto q: pos[j]){
best[q.second] = max(best[q.second], q.first + 1);
marked[q.second] = 1;
}
}
for(int j: bconn[i])
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |