# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
896518 |
2024-01-01T15:22:29 Z |
Abito |
Vinjete (COI22_vinjete) |
C++17 |
|
3000 ms |
495940 KB |
#include <bits/stdc++.h>
#define F first
#define S second
#define pb push_back
#define ppb pop_back
#define ep insert
#define endl '\n'
#define elif else if
#define pow pwr
#define sqrt sqrtt
//#define int long long
typedef unsigned long long ull;
using namespace std;
struct edge{
int x,l,r;
};
const int N=1e5+5;
int n,m,ans[N];
vector<edge> adj[N];
bitset<N> bs[N],vis;
void bfs(){
queue<int> q;q.push(1);vis[1]=1;
while (!q.empty()){
int x=q.front();
q.pop();
for (auto u:adj[x]){
if (vis[u.x]) continue;
bs[u.x]=bs[x];
for (int i=u.l;i<=u.r;i++) bs[u.x][i]=1;
vis[u.x]=1;
q.push(u.x);
}
}return;
}
int32_t main(){
ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
cin>>n>>m;
for (int i=1;i<n;i++){
int x,y,l,r;
cin>>x>>y>>l>>r;
adj[x].pb({y,l,r});
adj[y].pb({x,l,r});
}bfs();
for (int i=2;i<=n;i++) cout<<bs[i].count()<<endl;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
8 ms |
15452 KB |
Output is correct |
2 |
Correct |
8 ms |
15668 KB |
Output is correct |
3 |
Correct |
7 ms |
15452 KB |
Output is correct |
4 |
Correct |
7 ms |
15452 KB |
Output is correct |
5 |
Correct |
7 ms |
15684 KB |
Output is correct |
6 |
Correct |
6 ms |
15452 KB |
Output is correct |
7 |
Correct |
1 ms |
5212 KB |
Output is correct |
8 |
Correct |
1 ms |
5212 KB |
Output is correct |
9 |
Correct |
7 ms |
15696 KB |
Output is correct |
10 |
Correct |
8 ms |
15708 KB |
Output is correct |
11 |
Correct |
7 ms |
15696 KB |
Output is correct |
12 |
Correct |
6 ms |
15708 KB |
Output is correct |
13 |
Correct |
6 ms |
15700 KB |
Output is correct |
14 |
Correct |
6 ms |
15448 KB |
Output is correct |
15 |
Correct |
1 ms |
5212 KB |
Output is correct |
16 |
Correct |
2 ms |
5212 KB |
Output is correct |
17 |
Correct |
8 ms |
15704 KB |
Output is correct |
18 |
Correct |
8 ms |
15452 KB |
Output is correct |
19 |
Correct |
7 ms |
15448 KB |
Output is correct |
20 |
Correct |
7 ms |
15708 KB |
Output is correct |
21 |
Correct |
6 ms |
15708 KB |
Output is correct |
22 |
Correct |
6 ms |
15708 KB |
Output is correct |
23 |
Correct |
1 ms |
5212 KB |
Output is correct |
24 |
Correct |
2 ms |
5296 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
8 ms |
15452 KB |
Output is correct |
2 |
Correct |
8 ms |
15668 KB |
Output is correct |
3 |
Correct |
7 ms |
15452 KB |
Output is correct |
4 |
Correct |
7 ms |
15452 KB |
Output is correct |
5 |
Correct |
7 ms |
15684 KB |
Output is correct |
6 |
Correct |
6 ms |
15452 KB |
Output is correct |
7 |
Correct |
1 ms |
5212 KB |
Output is correct |
8 |
Correct |
1 ms |
5212 KB |
Output is correct |
9 |
Correct |
7 ms |
15696 KB |
Output is correct |
10 |
Correct |
8 ms |
15708 KB |
Output is correct |
11 |
Correct |
7 ms |
15696 KB |
Output is correct |
12 |
Correct |
6 ms |
15708 KB |
Output is correct |
13 |
Correct |
6 ms |
15700 KB |
Output is correct |
14 |
Correct |
6 ms |
15448 KB |
Output is correct |
15 |
Correct |
1 ms |
5212 KB |
Output is correct |
16 |
Correct |
2 ms |
5212 KB |
Output is correct |
17 |
Correct |
8 ms |
15704 KB |
Output is correct |
18 |
Correct |
8 ms |
15452 KB |
Output is correct |
19 |
Correct |
7 ms |
15448 KB |
Output is correct |
20 |
Correct |
7 ms |
15708 KB |
Output is correct |
21 |
Correct |
6 ms |
15708 KB |
Output is correct |
22 |
Correct |
6 ms |
15708 KB |
Output is correct |
23 |
Correct |
1 ms |
5212 KB |
Output is correct |
24 |
Correct |
2 ms |
5296 KB |
Output is correct |
25 |
Execution timed out |
3052 ms |
126416 KB |
Time limit exceeded |
26 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
8 ms |
15452 KB |
Output is correct |
2 |
Correct |
8 ms |
15668 KB |
Output is correct |
3 |
Correct |
7 ms |
15452 KB |
Output is correct |
4 |
Correct |
7 ms |
15452 KB |
Output is correct |
5 |
Correct |
7 ms |
15684 KB |
Output is correct |
6 |
Correct |
6 ms |
15452 KB |
Output is correct |
7 |
Correct |
1 ms |
5212 KB |
Output is correct |
8 |
Correct |
1 ms |
5212 KB |
Output is correct |
9 |
Correct |
7 ms |
15696 KB |
Output is correct |
10 |
Correct |
8 ms |
15708 KB |
Output is correct |
11 |
Correct |
7 ms |
15696 KB |
Output is correct |
12 |
Correct |
6 ms |
15708 KB |
Output is correct |
13 |
Correct |
6 ms |
15700 KB |
Output is correct |
14 |
Correct |
6 ms |
15448 KB |
Output is correct |
15 |
Correct |
1 ms |
5212 KB |
Output is correct |
16 |
Correct |
2 ms |
5212 KB |
Output is correct |
17 |
Correct |
8 ms |
15704 KB |
Output is correct |
18 |
Correct |
8 ms |
15452 KB |
Output is correct |
19 |
Correct |
7 ms |
15448 KB |
Output is correct |
20 |
Correct |
7 ms |
15708 KB |
Output is correct |
21 |
Correct |
6 ms |
15708 KB |
Output is correct |
22 |
Correct |
6 ms |
15708 KB |
Output is correct |
23 |
Correct |
1 ms |
5212 KB |
Output is correct |
24 |
Correct |
2 ms |
5296 KB |
Output is correct |
25 |
Correct |
2696 ms |
495032 KB |
Output is correct |
26 |
Correct |
2691 ms |
495464 KB |
Output is correct |
27 |
Correct |
829 ms |
495284 KB |
Output is correct |
28 |
Correct |
837 ms |
495148 KB |
Output is correct |
29 |
Correct |
206 ms |
495188 KB |
Output is correct |
30 |
Correct |
209 ms |
495188 KB |
Output is correct |
31 |
Correct |
32 ms |
64860 KB |
Output is correct |
32 |
Correct |
28 ms |
65064 KB |
Output is correct |
33 |
Correct |
27 ms |
65056 KB |
Output is correct |
34 |
Correct |
27 ms |
64856 KB |
Output is correct |
35 |
Correct |
2735 ms |
495492 KB |
Output is correct |
36 |
Correct |
2715 ms |
495764 KB |
Output is correct |
37 |
Correct |
860 ms |
495444 KB |
Output is correct |
38 |
Correct |
856 ms |
495572 KB |
Output is correct |
39 |
Correct |
239 ms |
495436 KB |
Output is correct |
40 |
Correct |
250 ms |
495360 KB |
Output is correct |
41 |
Correct |
31 ms |
65112 KB |
Output is correct |
42 |
Correct |
31 ms |
65116 KB |
Output is correct |
43 |
Correct |
2719 ms |
495940 KB |
Output is correct |
44 |
Correct |
2708 ms |
495724 KB |
Output is correct |
45 |
Correct |
868 ms |
495696 KB |
Output is correct |
46 |
Correct |
876 ms |
495856 KB |
Output is correct |
47 |
Correct |
249 ms |
495444 KB |
Output is correct |
48 |
Correct |
247 ms |
495792 KB |
Output is correct |
49 |
Correct |
31 ms |
65116 KB |
Output is correct |
50 |
Correct |
31 ms |
65116 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
8 ms |
15452 KB |
Output is correct |
2 |
Correct |
8 ms |
15668 KB |
Output is correct |
3 |
Correct |
7 ms |
15452 KB |
Output is correct |
4 |
Correct |
7 ms |
15452 KB |
Output is correct |
5 |
Correct |
7 ms |
15684 KB |
Output is correct |
6 |
Correct |
6 ms |
15452 KB |
Output is correct |
7 |
Correct |
1 ms |
5212 KB |
Output is correct |
8 |
Correct |
1 ms |
5212 KB |
Output is correct |
9 |
Correct |
7 ms |
15696 KB |
Output is correct |
10 |
Correct |
8 ms |
15708 KB |
Output is correct |
11 |
Correct |
7 ms |
15696 KB |
Output is correct |
12 |
Correct |
6 ms |
15708 KB |
Output is correct |
13 |
Correct |
6 ms |
15700 KB |
Output is correct |
14 |
Correct |
6 ms |
15448 KB |
Output is correct |
15 |
Correct |
1 ms |
5212 KB |
Output is correct |
16 |
Correct |
2 ms |
5212 KB |
Output is correct |
17 |
Correct |
8 ms |
15704 KB |
Output is correct |
18 |
Correct |
8 ms |
15452 KB |
Output is correct |
19 |
Correct |
7 ms |
15448 KB |
Output is correct |
20 |
Correct |
7 ms |
15708 KB |
Output is correct |
21 |
Correct |
6 ms |
15708 KB |
Output is correct |
22 |
Correct |
6 ms |
15708 KB |
Output is correct |
23 |
Correct |
1 ms |
5212 KB |
Output is correct |
24 |
Correct |
2 ms |
5296 KB |
Output is correct |
25 |
Correct |
2696 ms |
495032 KB |
Output is correct |
26 |
Correct |
2691 ms |
495464 KB |
Output is correct |
27 |
Correct |
829 ms |
495284 KB |
Output is correct |
28 |
Correct |
837 ms |
495148 KB |
Output is correct |
29 |
Correct |
206 ms |
495188 KB |
Output is correct |
30 |
Correct |
209 ms |
495188 KB |
Output is correct |
31 |
Correct |
32 ms |
64860 KB |
Output is correct |
32 |
Correct |
28 ms |
65064 KB |
Output is correct |
33 |
Correct |
27 ms |
65056 KB |
Output is correct |
34 |
Correct |
27 ms |
64856 KB |
Output is correct |
35 |
Correct |
2735 ms |
495492 KB |
Output is correct |
36 |
Correct |
2715 ms |
495764 KB |
Output is correct |
37 |
Correct |
860 ms |
495444 KB |
Output is correct |
38 |
Correct |
856 ms |
495572 KB |
Output is correct |
39 |
Correct |
239 ms |
495436 KB |
Output is correct |
40 |
Correct |
250 ms |
495360 KB |
Output is correct |
41 |
Correct |
31 ms |
65112 KB |
Output is correct |
42 |
Correct |
31 ms |
65116 KB |
Output is correct |
43 |
Correct |
2719 ms |
495940 KB |
Output is correct |
44 |
Correct |
2708 ms |
495724 KB |
Output is correct |
45 |
Correct |
868 ms |
495696 KB |
Output is correct |
46 |
Correct |
876 ms |
495856 KB |
Output is correct |
47 |
Correct |
249 ms |
495444 KB |
Output is correct |
48 |
Correct |
247 ms |
495792 KB |
Output is correct |
49 |
Correct |
31 ms |
65116 KB |
Output is correct |
50 |
Correct |
31 ms |
65116 KB |
Output is correct |
51 |
Execution timed out |
3073 ms |
246312 KB |
Time limit exceeded |
52 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
8 ms |
15452 KB |
Output is correct |
2 |
Correct |
8 ms |
15668 KB |
Output is correct |
3 |
Correct |
7 ms |
15452 KB |
Output is correct |
4 |
Correct |
7 ms |
15452 KB |
Output is correct |
5 |
Correct |
7 ms |
15684 KB |
Output is correct |
6 |
Correct |
6 ms |
15452 KB |
Output is correct |
7 |
Correct |
1 ms |
5212 KB |
Output is correct |
8 |
Correct |
1 ms |
5212 KB |
Output is correct |
9 |
Correct |
7 ms |
15696 KB |
Output is correct |
10 |
Correct |
8 ms |
15708 KB |
Output is correct |
11 |
Correct |
7 ms |
15696 KB |
Output is correct |
12 |
Correct |
6 ms |
15708 KB |
Output is correct |
13 |
Correct |
6 ms |
15700 KB |
Output is correct |
14 |
Correct |
6 ms |
15448 KB |
Output is correct |
15 |
Correct |
1 ms |
5212 KB |
Output is correct |
16 |
Correct |
2 ms |
5212 KB |
Output is correct |
17 |
Correct |
8 ms |
15704 KB |
Output is correct |
18 |
Correct |
8 ms |
15452 KB |
Output is correct |
19 |
Correct |
7 ms |
15448 KB |
Output is correct |
20 |
Correct |
7 ms |
15708 KB |
Output is correct |
21 |
Correct |
6 ms |
15708 KB |
Output is correct |
22 |
Correct |
6 ms |
15708 KB |
Output is correct |
23 |
Correct |
1 ms |
5212 KB |
Output is correct |
24 |
Correct |
2 ms |
5296 KB |
Output is correct |
25 |
Execution timed out |
3052 ms |
126416 KB |
Time limit exceeded |
26 |
Halted |
0 ms |
0 KB |
- |