# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
441475 | sam571128 | Paths (BOI18_paths) | C++17 | 1339 ms | 23212 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>
#define int long long
#define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;
const int N = 3e5+5;
vector<int> adj[N];
int col[N], cnt[N], arr[N];
int ans = 0;
int n,m,k;
void solve(int kk){
for(int u = 1;u <= n;u++){
if(col[u]==arr[0]) cnt[u] = 1;
else cnt[u] = 0;
}
for(int i = 0;i < kk-1;i++){
for(int u = 1;u <= n;u++){
if(col[u]!=arr[i]) continue;
for(auto v : adj[u]){
if(col[v]==arr[i+1]) cnt[v] += cnt[u];
}
}
}
for(int u = 1;u <= n;u++){
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |