Submission #896514

# Submission time Handle Problem Language Result Execution time Memory
896514 2024-01-01T15:16:13 Z Abito Vinjete (COI22_vinjete) C++17
27 / 100
3000 ms 252904 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=5e4+5;
int n,m,ans[N];
vector<edge> adj[N];
bitset<N> bs[N];
void dfs(int node,int p){
    bs[node].count();
    for (auto u:adj[node]){
        if (p==u.x) continue;
        bs[u.x]=bs[node];
        for (int i=u.l;i<=u.r;i++) bs[u.x][i]=1;
        dfs(u.x,node);
    }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});
    }dfs(1,0);
    for (int i=2;i<=n;i++) cout<<bs[i].count()<<endl;
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 5 ms 8028 KB Output is correct
2 Correct 5 ms 8028 KB Output is correct
3 Correct 5 ms 8024 KB Output is correct
4 Correct 4 ms 8028 KB Output is correct
5 Correct 4 ms 8028 KB Output is correct
6 Correct 3 ms 8028 KB Output is correct
7 Correct 1 ms 3684 KB Output is correct
8 Correct 2 ms 3676 KB Output is correct
9 Correct 5 ms 8028 KB Output is correct
10 Correct 5 ms 8276 KB Output is correct
11 Correct 4 ms 7800 KB Output is correct
12 Correct 4 ms 8028 KB Output is correct
13 Correct 4 ms 8024 KB Output is correct
14 Correct 4 ms 7840 KB Output is correct
15 Correct 1 ms 3676 KB Output is correct
16 Correct 1 ms 3628 KB Output is correct
17 Correct 5 ms 8028 KB Output is correct
18 Correct 5 ms 8028 KB Output is correct
19 Correct 4 ms 8028 KB Output is correct
20 Correct 4 ms 8028 KB Output is correct
21 Correct 4 ms 8028 KB Output is correct
22 Correct 4 ms 8028 KB Output is correct
23 Correct 1 ms 3676 KB Output is correct
24 Correct 2 ms 3676 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 8028 KB Output is correct
2 Correct 5 ms 8028 KB Output is correct
3 Correct 5 ms 8024 KB Output is correct
4 Correct 4 ms 8028 KB Output is correct
5 Correct 4 ms 8028 KB Output is correct
6 Correct 3 ms 8028 KB Output is correct
7 Correct 1 ms 3684 KB Output is correct
8 Correct 2 ms 3676 KB Output is correct
9 Correct 5 ms 8028 KB Output is correct
10 Correct 5 ms 8276 KB Output is correct
11 Correct 4 ms 7800 KB Output is correct
12 Correct 4 ms 8028 KB Output is correct
13 Correct 4 ms 8024 KB Output is correct
14 Correct 4 ms 7840 KB Output is correct
15 Correct 1 ms 3676 KB Output is correct
16 Correct 1 ms 3628 KB Output is correct
17 Correct 5 ms 8028 KB Output is correct
18 Correct 5 ms 8028 KB Output is correct
19 Correct 4 ms 8028 KB Output is correct
20 Correct 4 ms 8028 KB Output is correct
21 Correct 4 ms 8028 KB Output is correct
22 Correct 4 ms 8028 KB Output is correct
23 Correct 1 ms 3676 KB Output is correct
24 Correct 2 ms 3676 KB Output is correct
25 Execution timed out 3100 ms 125248 KB Time limit exceeded
26 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 5 ms 8028 KB Output is correct
2 Correct 5 ms 8028 KB Output is correct
3 Correct 5 ms 8024 KB Output is correct
4 Correct 4 ms 8028 KB Output is correct
5 Correct 4 ms 8028 KB Output is correct
6 Correct 3 ms 8028 KB Output is correct
7 Correct 1 ms 3684 KB Output is correct
8 Correct 2 ms 3676 KB Output is correct
9 Correct 5 ms 8028 KB Output is correct
10 Correct 5 ms 8276 KB Output is correct
11 Correct 4 ms 7800 KB Output is correct
12 Correct 4 ms 8028 KB Output is correct
13 Correct 4 ms 8024 KB Output is correct
14 Correct 4 ms 7840 KB Output is correct
15 Correct 1 ms 3676 KB Output is correct
16 Correct 1 ms 3628 KB Output is correct
17 Correct 5 ms 8028 KB Output is correct
18 Correct 5 ms 8028 KB Output is correct
19 Correct 4 ms 8028 KB Output is correct
20 Correct 4 ms 8028 KB Output is correct
21 Correct 4 ms 8028 KB Output is correct
22 Correct 4 ms 8028 KB Output is correct
23 Correct 1 ms 3676 KB Output is correct
24 Correct 2 ms 3676 KB Output is correct
25 Correct 2573 ms 252724 KB Output is correct
26 Correct 2526 ms 252584 KB Output is correct
27 Correct 734 ms 252904 KB Output is correct
28 Correct 720 ms 252756 KB Output is correct
29 Correct 118 ms 252756 KB Output is correct
30 Correct 116 ms 252752 KB Output is correct
31 Correct 15 ms 33116 KB Output is correct
32 Correct 16 ms 33368 KB Output is correct
33 Correct 21 ms 33032 KB Output is correct
34 Correct 16 ms 33116 KB Output is correct
35 Correct 2579 ms 251052 KB Output is correct
36 Correct 2578 ms 251016 KB Output is correct
37 Correct 757 ms 250972 KB Output is correct
38 Correct 747 ms 251224 KB Output is correct
39 Correct 136 ms 250976 KB Output is correct
40 Correct 142 ms 250772 KB Output is correct
41 Correct 18 ms 32856 KB Output is correct
42 Correct 17 ms 32860 KB Output is correct
43 Correct 2574 ms 250832 KB Output is correct
44 Correct 2563 ms 250800 KB Output is correct
45 Correct 754 ms 251024 KB Output is correct
46 Correct 751 ms 250964 KB Output is correct
47 Correct 146 ms 250708 KB Output is correct
48 Correct 140 ms 250728 KB Output is correct
49 Correct 17 ms 32884 KB Output is correct
50 Correct 17 ms 32856 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 8028 KB Output is correct
2 Correct 5 ms 8028 KB Output is correct
3 Correct 5 ms 8024 KB Output is correct
4 Correct 4 ms 8028 KB Output is correct
5 Correct 4 ms 8028 KB Output is correct
6 Correct 3 ms 8028 KB Output is correct
7 Correct 1 ms 3684 KB Output is correct
8 Correct 2 ms 3676 KB Output is correct
9 Correct 5 ms 8028 KB Output is correct
10 Correct 5 ms 8276 KB Output is correct
11 Correct 4 ms 7800 KB Output is correct
12 Correct 4 ms 8028 KB Output is correct
13 Correct 4 ms 8024 KB Output is correct
14 Correct 4 ms 7840 KB Output is correct
15 Correct 1 ms 3676 KB Output is correct
16 Correct 1 ms 3628 KB Output is correct
17 Correct 5 ms 8028 KB Output is correct
18 Correct 5 ms 8028 KB Output is correct
19 Correct 4 ms 8028 KB Output is correct
20 Correct 4 ms 8028 KB Output is correct
21 Correct 4 ms 8028 KB Output is correct
22 Correct 4 ms 8028 KB Output is correct
23 Correct 1 ms 3676 KB Output is correct
24 Correct 2 ms 3676 KB Output is correct
25 Correct 2573 ms 252724 KB Output is correct
26 Correct 2526 ms 252584 KB Output is correct
27 Correct 734 ms 252904 KB Output is correct
28 Correct 720 ms 252756 KB Output is correct
29 Correct 118 ms 252756 KB Output is correct
30 Correct 116 ms 252752 KB Output is correct
31 Correct 15 ms 33116 KB Output is correct
32 Correct 16 ms 33368 KB Output is correct
33 Correct 21 ms 33032 KB Output is correct
34 Correct 16 ms 33116 KB Output is correct
35 Correct 2579 ms 251052 KB Output is correct
36 Correct 2578 ms 251016 KB Output is correct
37 Correct 757 ms 250972 KB Output is correct
38 Correct 747 ms 251224 KB Output is correct
39 Correct 136 ms 250976 KB Output is correct
40 Correct 142 ms 250772 KB Output is correct
41 Correct 18 ms 32856 KB Output is correct
42 Correct 17 ms 32860 KB Output is correct
43 Correct 2574 ms 250832 KB Output is correct
44 Correct 2563 ms 250800 KB Output is correct
45 Correct 754 ms 251024 KB Output is correct
46 Correct 751 ms 250964 KB Output is correct
47 Correct 146 ms 250708 KB Output is correct
48 Correct 140 ms 250728 KB Output is correct
49 Correct 17 ms 32884 KB Output is correct
50 Correct 17 ms 32856 KB Output is correct
51 Runtime error 25 ms 8276 KB Execution killed with signal 11
52 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 5 ms 8028 KB Output is correct
2 Correct 5 ms 8028 KB Output is correct
3 Correct 5 ms 8024 KB Output is correct
4 Correct 4 ms 8028 KB Output is correct
5 Correct 4 ms 8028 KB Output is correct
6 Correct 3 ms 8028 KB Output is correct
7 Correct 1 ms 3684 KB Output is correct
8 Correct 2 ms 3676 KB Output is correct
9 Correct 5 ms 8028 KB Output is correct
10 Correct 5 ms 8276 KB Output is correct
11 Correct 4 ms 7800 KB Output is correct
12 Correct 4 ms 8028 KB Output is correct
13 Correct 4 ms 8024 KB Output is correct
14 Correct 4 ms 7840 KB Output is correct
15 Correct 1 ms 3676 KB Output is correct
16 Correct 1 ms 3628 KB Output is correct
17 Correct 5 ms 8028 KB Output is correct
18 Correct 5 ms 8028 KB Output is correct
19 Correct 4 ms 8028 KB Output is correct
20 Correct 4 ms 8028 KB Output is correct
21 Correct 4 ms 8028 KB Output is correct
22 Correct 4 ms 8028 KB Output is correct
23 Correct 1 ms 3676 KB Output is correct
24 Correct 2 ms 3676 KB Output is correct
25 Execution timed out 3100 ms 125248 KB Time limit exceeded
26 Halted 0 ms 0 KB -