# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
916727 | penguin133 | Paths (BOI18_paths) | C++17 | 413 ms | 74368 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;
#define int long long
#define pi pair<int, int>
#define pii pair<int, pi>
#define fi first
#define se second
#ifdef _WIN32
#define getchar_unlocked _getchar_nolock
#endif
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
int A[300005];
vector <int> adj[300005];
vector < vector <int> > memo;
int dp(int x, int bm){
if(memo[x][bm] != -1)return memo[x][bm];
int ans = 1;
for(auto i : adj[x])if(bm >> A[i] & 1)ans += dp(i, bm ^ (1 << A[i]));
return memo[x][bm] = ans;
}
void solve(){
int n, m, k; cin >> n >> m >> k;
for(int i=1;i<=n;i++){
cin >> A[i];
A[i]--;
}
while(m--){
int a, b; cin >> a >> b;
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |