# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
642588 | andreast12 | Paths (BOI18_paths) | C++17 | 3091 ms | 9184 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 ll long long
#define pb push_back
#define fi first
#define se second
const int mod=998244353, maxn=1e5+5;
int n, m, k, c[maxn], u, v, ans;
vector<int> adj[maxn];
bool vis[maxn];
void dfs(int now, int state, int jml) {
if(!vis[now]&&(((1<<c[now])&state)==0)) {
if(jml==1) {
ans++;
} else {
vis[now]=true;
for(auto nxt:adj[now]) {
dfs(nxt, state|(1<<c[now]), jml-1);
}
}
vis[now]=false;
}
}
int main() {
ios_base::sync_with_stdio(false); cin.tie(NULL);
cin >> n >> m >> k;
for(int i=1; i<=n; i++) cin >> c[i];
while(m--) {
# | 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... |