Submission details
Task:Polut
Sender:Linuzzik
Submission time:2026-01-17 15:18:41 +0200
Language:C++ (C++11)
Status:READY
Result:0
Feedback
groupverdictscore
#10
#20
#30
#40
#50
Test results
testverdicttimegroup
#1ACCEPTED0.00 s1, 3, 4, 5details
#2ACCEPTED0.00 s1, 4, 5details
#3--1, 4, 5details
#4--1, 4, 5details
#5--2, 5details
#6--2, 5details
#7--2, 4, 5details
#8--3, 5details
#9--3, 5details
#10--3, 4, 5details
#11--4, 5details
#12--4, 5details
#13--5details
#14--5details
#15--4, 5details
#16ACCEPTED0.00 s1, 4, 5details

Compiler report

input/code.cpp: In function 'int main()':
input/code.cpp:20:14: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17' [-Wc++17-extensions]
   20 |         auto [t, i] = pq.top();
      |              ^
input/code.cpp:31:14: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17' [-Wc++17-extensions]
   31 |         auto [t, i] = pq.top();
      |              ^

Code

#include<bits/stdc++.h>

using namespace std;

vector<vector<int>> c;

int main() {
    int n, m, p; cin >> n >> m >> p;
    c.resize(n);
    for (int i = 0; i < m; i++) {
        int a, b; cin >> a >> b;
        c[a-1].push_back(b-1);
        c[b-1].push_back(a-1);
    }

    vector<int> dst(n, -1);
    priority_queue<pair<int, int>> pq;
    pq.push({0, 0});
    while (!pq.empty()) {
        auto [t, i] = pq.top();
        pq.pop();
        if (dst[i] != -1) continue;
        dst[i] = -t;
        for (auto& b : c[i]) {
            pq.push({t-1, b});
        }
    }
    vector<int> z(p);
    pq.push({0, 0});
    while (!pq.empty()) {
        auto [t, i] = pq.top();
        pq.pop();
        if (-t >= dst[n-1]+p) continue;
        if (i == n-1) {
            z[-t - dst[n-1]]++;
        }
        for (auto& b : c[i]) {
            pq.push({t-1, b});
        }
    }
    for (auto& x : z) cout << x << " ";
}

Test details

Test 1 (public)

Group: 1, 3, 4, 5

Verdict: ACCEPTED

input
4 5 3
1 2
1 3
2 3
2 4
...

correct output
2 2 10 

user output
2 2 10 

Test 2

Group: 1, 4, 5

Verdict: ACCEPTED

input
2 1 1
2 1

correct output

user output

Test 3

Group: 1, 4, 5

Verdict:

input
10 20 10
6 10
8 1
4 6
9 1
...

correct output
2 5 34 123 611 2503 11415 4882...

user output
(empty)

Test 4

Group: 1, 4, 5

Verdict:

input
10 20 10
4 10
2 3
8 4
7 8
...

correct output
1 7 26 140 509 2483 9454 43570...

user output
(empty)

Test 5

Group: 2, 5

Verdict:

input
100000 200000 2
96303 53915
64836 4748
6389 40954
60420 91374
...

correct output
1 0 

user output
(empty)

Test 6

Group: 2, 5

Verdict:

input
100000 200000 2
72817 17293
93269 856
51497 26888
41679 96276
...

correct output
5 8 

user output
(empty)

Test 7

Group: 2, 4, 5

Verdict:

input
474 517 2
1 2
1 3
2 4
3 4
...

correct output
0 0 

user output
(empty)

Test 8

Group: 3, 5

Verdict:

input
100000 200000 3
59846 53439
11468 57874
83443 13914
46177 15147
...

correct output
1 0 32 

user output
(empty)

Test 9

Group: 3, 5

Verdict:

input
100000 200000 3
23665 7205
83252 56604
14852 7299
2836 9864
...

correct output
1 0 33 

user output
(empty)

Test 10

Group: 3, 4, 5

Verdict:

input
474 517 3
1 2
1 3
2 4
3 4
...

correct output
0 0 986681410 

user output
(empty)

Test 11

Group: 4, 5

Verdict:

input
1000 2000 10
691 424
80 318
681 539
33 342
...

correct output
1 6 39 252 1242 7715 36269 212...

user output
(empty)

Test 12

Group: 4, 5

Verdict:

input
1000 2000 10
979 324
770 562
560 7
169 738
...

correct output
2 2 81 150 2435 6460 66843 223...

user output
(empty)

Test 13

Group: 5

Verdict:

input
100000 200000 10
54544 86042
14060 20746
47891 4317
76648 84193
...

correct output
1 3 54 169 1917 6237 56922 192...

user output
(empty)

Test 14

Group: 5

Verdict:

input
100000 200000 10
73275 88704
74521 54506
51906 57193
29561 44568
...

correct output
6 19 338 1212 12462 49357 3873...

user output
(empty)

Test 15

Group: 4, 5

Verdict:

input
1000 1989 10
822 821
979 989
138 139
968 981
...

correct output
1 44 2935 131120 6357888 28564...

user output
(empty)

Test 16

Group: 1, 4, 5

Verdict: ACCEPTED

input
3 3 1
1 2
1 3
2 3

correct output

user output