# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
198129 | brcode | Uzastopni (COCI15_uzastopni) | C++14 | 142 ms | 19636 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 <iostream>
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5+5;
int arr[MAXN];
int n;
vector<int> v1[MAXN];
bitset<100> dp[MAXN][101];
void dfs(int curr,int par){
for(int x:v1[curr]){
if(x!=par){
dfs(x,curr);
}
}
for(int i=100;i>=1;i--){
if(arr[curr] == i){
dp[curr][i] = dp[curr][i+1];
dp[curr][i][i] = 1;
}
for(int j=i;j<=100;j++){
if(dp[curr][i][j]){
dp[curr][i]|=dp[curr][j+1];
}
}
}
if(arr[curr]!=1){
for(int i=100;i>=1;i--){
if(dp[curr][i][arr[curr]-1]){
dp[par][i]|=dp[curr][arr[curr]];
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |