Submission #1062575

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
10625752024-08-17 08:46:16alexddSeptember (APIO24_september)C++17
100 / 100
133 ms24784 KiB
#include "september.h"
#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
vector<int> con[100005];
int mint[100005],maxt[100005];
int submin[100005],submax[100005];
int mars[100005];
void same_day(int le, int ri)
{
if(le>=ri)
return;
//cout<<le<<" "<<ri<<" same day\n";
mars[le+1]++;
mars[ri+1]--;
}
void dfs(int nod)
{
submin[nod]=mint[nod];
submax[nod]=maxt[nod];
for(auto adj:con[nod])
{
dfs(adj);
submin[nod] = min(submin[nod], submin[adj]);
submax[nod] = max(submax[nod], submax[adj]);
}
//cout<<nod<<" "<<mint[nod]<<" "<<submax[nod]<<" zzz\n";
if(nod>0) same_day(mint[nod],submax[nod]);
}
int solve(int N, int M, std::vector<int> F, std::vector<std::vector<int>> S)
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...