Submission #198129

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
1981292020-01-24 18:58:14brcodeUzastopni (COCI15_uzastopni)C++14
160 / 160
142 ms19636 KiB
#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]];
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...