Submission #991581

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
9915812024-06-02 14:09:17snpmrnhlolSprinkler (JOI22_sprinkler)C++17
38 / 100
427 ms60756 KiB
#include<bits/stdc++.h>
using namespace std;
const int N = 2e5;
const int D = 40;
vector <int> e[N];
vector <int> path;
int pr[N];
int bonus[N][D];
int v[N];
void dfs(int node, int p){
pr[node] = p;
for(auto i:e[node]){
if(i == p)continue;
dfs(i, node);
}
}
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
int n,mod;
cin>>n>>mod;
for(int i = 0;i < n - 1;i++){
int u,w;
cin>>u>>w;
e[u - 1].push_back(w - 1);
e[w - 1].push_back(u - 1);
}
for(int i = 0;i < n;i++){
cin>>v[i];
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

sprinkler.cpp: In function 'int main()':
sprinkler.cpp:32:25: warning: iteration 40 invokes undefined behavior [-Waggressive-loop-optimizations]
   32 |             bonus[i][j] = 1;
      |             ~~~~~~~~~~~~^~~
sprinkler.cpp:31:25: note: within this loop
   31 |         for(int j = 0;j <= D;j++){
      |                       ~~^~~~
#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...