CSES - Aalto Competitive Programming 2024 - wk5 - Mon - Results
Submission details
Task:Pukkitappelu battle royale
Sender:aalto2024e_003
Submission time:2024-09-30 17:41:19 +0300
Language:C++ (C++17)
Status:READY
Result:
Test results
testverdicttime
#1ACCEPTED0.00 sdetails
#20.00 sdetails
#30.00 sdetails
#40.00 sdetails
#5ACCEPTED0.00 sdetails
#60.00 sdetails
#7ACCEPTED0.00 sdetails
#8ACCEPTED0.00 sdetails
#9ACCEPTED0.00 sdetails
#100.00 sdetails
#110.00 sdetails
#120.00 sdetails
#130.00 sdetails
#140.00 sdetails
#150.00 sdetails
#160.00 sdetails
#170.00 sdetails
#180.00 sdetails
#190.00 sdetails
#200.00 sdetails
#210.00 sdetails
#220.00 sdetails
#230.00 sdetails
#240.00 sdetails
#250.00 sdetails
#260.00 sdetails
#270.00 sdetails
#280.00 sdetails
#29ACCEPTED0.00 sdetails
#300.00 sdetails
#310.00 sdetails
#320.00 sdetails
#330.00 sdetails
#340.00 sdetails
#350.00 sdetails
#36ACCEPTED0.00 sdetails
#370.00 sdetails
#38ACCEPTED0.00 sdetails
#390.00 sdetails
#400.00 sdetails
#410.00 sdetails
#420.00 sdetails
#430.00 sdetails
#440.00 sdetails
#450.00 sdetails
#46ACCEPTED0.00 sdetails
#470.00 sdetails
#480.00 sdetails
#490.00 sdetails
#500.00 sdetails
#510.00 sdetails
#520.00 sdetails
#530.00 sdetails
#540.00 sdetails
#550.00 sdetails
#560.00 sdetails
#570.00 sdetails
#580.00 sdetails
#590.00 sdetails
#600.00 sdetails
#610.00 sdetails
#620.00 sdetails
#630.00 sdetails
#640.00 sdetails
#650.00 sdetails
#660.00 sdetails
#670.00 sdetails
#680.00 sdetails
#690.00 sdetails
#700.00 sdetails
#710.00 sdetails
#720.00 sdetails
#730.00 sdetails
#740.00 sdetails
#750.00 sdetails
#760.00 sdetails
#770.00 sdetails
#780.00 sdetails
#790.00 sdetails
#800.02 sdetails
#810.02 sdetails
#820.02 sdetails
#830.02 sdetails
#840.02 sdetails
#850.02 sdetails
#860.02 sdetails
#870.02 sdetails
#880.02 sdetails
#890.01 sdetails

Code

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    ll n, x;
    cin >> n >> x;
    vector<ll> a(n);
    for (ll& pos : a) cin >> pos;

    ll total_moves = 0;

    total_moves += a[0] - 1;

    for (ll i = 0; i < n - 1; ++i) {
        total_moves += a[i + 1] - a[i] - 1;
    }

    total_moves += x - a[n - 1];

    ll winner_index = (total_moves % n) + 1;

    cout << winner_index << '\n';

    return 0;
}

Test details

Test 1

Verdict: ACCEPTED

input
1 14
10 

correct output
1

user output
1

Test 2

Verdict:

input
2 10
1 2 

correct output
2

user output
1

Test 3

Verdict:

input
2 7
3 5 

correct output
1

user output
2

Test 4

Verdict:

input
2 13
4 12 

correct output
1

user output
2

Test 5

Verdict: ACCEPTED

input
2 12
6 10 

correct output
1

user output
1

Test 6

Verdict:

input
2 6
3 6 

correct output
2

user output
1

Test 7

Verdict: ACCEPTED

input
2 19
6 15 

correct output
2

user output
2

Test 8

Verdict: ACCEPTED

input
2 16
2 14 

correct output
1

user output
1

Test 9

Verdict: ACCEPTED

input
2 20
11 13 

correct output
1

user output
1

Test 10

Verdict:

input
2 17
7 15 

correct output
1

user output
2

Test 11

Verdict:

input
2 18
7 18 

correct output
2

user output
1

Test 12

Verdict:

input
3 8
1 6 8 

correct output
2

user output
3

Test 13

Verdict:

input
3 20
11 13 15 

correct output
1

user output
3

Test 14

Verdict:

input
3 8
3 6 8 

correct output
2

user output
3

Test 15

Verdict:

input
3 14
5 8 10 

correct output
2

user output
3

Test 16

Verdict:

input
3 3
1 2 3 

correct output
3

user output
1

Test 17

Verdict:

input
3 7
1 6 7 

correct output
3

user output
2

Test 18

Verdict:

input
3 12
3 10 11 

correct output
3

user output
1

Test 19

Verdict:

input
3 3
1 2 3 

correct output
3

user output
1

Test 20

Verdict:

input
3 3
1 2 3 

correct output
3

user output
1

Test 21

Verdict:

input
3 15
1 4 5 

correct output
3

user output
1

Test 22

Verdict:

input
3 10
6 8 9 

correct output
3

user output
2

Test 23

Verdict:

input
3 13
8 9 12 

correct output
3

user output
2

Test 24

Verdict:

input
4 20
2 8 13 14 

correct output
4

user output
1

Test 25

Verdict:

input
4 20
12 13 14 18 

correct output
3

user output
1

Test 26

Verdict:

input
4 13
2 4 12 13 

correct output
4

user output
2

Test 27

Verdict:

input
4 13
1 3 7 13 

correct output
1

user output
2

Test 28

Verdict:

input
4 16
5 7 8 15 

correct output
4

user output
1

Test 29

Verdict: ACCEPTED

input
4 11
7 8 10 11 

correct output
4

user output
4

Test 30

Verdict:

input
5 13
6 8 10 11 12 

correct output
5

user output
4

Test 31

Verdict:

input
5 11
1 2 4 8 11 

correct output
5

user output
2

Test 32

Verdict:

input
5 11
1 3 5 7 11 

correct output
1

user output
2

Test 33

Verdict:

input
5 13
1 2 4 10 11 

correct output
5

user output
4

Test 34

Verdict:

input
5 20
4 11 18 19 20 

correct output
5

user output
1

Test 35

Verdict:

input
5 8
1 2 3 7 8 

correct output
5

user output
4

Test 36

Verdict: ACCEPTED

input
5 19
2 4 7 16 19 

correct output
5

user output
5

Test 37

Verdict:

input
5 6
2 3 4 5 6 

correct output
5

user output
2

Test 38

Verdict: ACCEPTED

input
5 18
1 5 7 16 18 

correct output
4

user output
4

Test 39

Verdict:

input
5 5
1 2 3 4 5 

correct output
5

user output
1

Test 40

Verdict:

input
10 16
1 5 7 8 9 10 11 12 14 15 

correct output
10

user output
7

Test 41

Verdict:

input
10 14
1 2 3 4 5 6 8 10 11 14 

correct output
10

user output
5

Test 42

Verdict:

input
10 14
1 2 3 5 6 7 8 9 10 14 

correct output
9

user output
5

Test 43

Verdict:

input
10 16
1 2 3 5 7 9 10 12 14 15 

correct output
10

user output
7

Test 44

Verdict:

input
10 20
4 5 11 12 13 14 15 18 19 20 

correct output
10

user output
1

Test 45

Verdict:

input
10 12
1 2 3 5 6 7 8 10 11 12 

correct output
10

user output
3

Test 46

Verdict: ACCEPTED

input
10 19
1 2 3 4 7 8 11 12 16 19 

correct output
10

user output
10

Test 47

Verdict:

input
10 10
1 2 3 4 5 6 7 8 9 10 

correct output
10

user output
1

Test 48

Verdict:

input
10 19
1 5 8 9 11 12 15 16 17 19 

correct output
9

user output
10

Test 49

Verdict:

input
10 10
1 2 3 4 5 6 7 8 9 10 

correct output
10

user output
1

Test 50

Verdict:

input
100 589284111
11528796 12405338 23576564 347...

correct output
100

user output
12

Test 51

Verdict:

input
100 447774061
54585 8727508 9242273 13069870...

correct output
98

user output
62

Test 52

Verdict:

input
100 468146062
12372478 31155934 38008300 391...

correct output
99

user output
63

Test 53

Verdict:

input
100 591414846
11503156 12648374 14184172 147...

correct output
94

user output
47

Test 54

Verdict:

input
100 967035023
5539596 6689688 9648746 204276...

correct output
92

user output
24

Test 55

Verdict:

input
100 238363452
391838 528333 1368439 3479103 ...

correct output
95

user output
53

Test 56

Verdict:

input
100 958701382
44771412 58491554 63972355 689...

correct output
97

user output
83

Test 57

Verdict:

input
100 81935503
1314125 2056565 5446047 595110...

correct output
100

user output
4

Test 58

Verdict:

input
100 937837780
11934038 12239373 22850648 308...

correct output
100

user output
81

Test 59

Verdict:

input
100 11139267
84150 148618 432268 440149 520...

correct output
100

user output
68

Test 60

Verdict:

input
200 589284211
2880992 5740962 8327109 115287...

correct output
200

user output
12

Test 61

Verdict:

input
200 447774161
54585 1369773 4298783 5568757 ...

correct output
199

user output
162

Test 62

Verdict:

input
200 468146162
2645901 6212116 12193387 12372...

correct output
200

user output
163

Test 63

Verdict:

input
200 591414946
11503156 12648374 13023409 141...

correct output
197

user output
147

Test 64

Verdict:

input
200 967035123
3142409 4210032 5539596 668968...

correct output
200

user output
124

Test 65

Verdict:

input
200 238363552
391838 528333 1368439 2951457 ...

correct output
200

user output
153

Test 66

Verdict:

input
200 958701482
915344 26318971 39308105 44426...

correct output
200

user output
83

Test 67

Verdict:

input
200 81935603
117854 1314125 2056565 3274591...

correct output
200

user output
4

Test 68

Verdict:

input
200 937837880
798751 8921056 9526547 1193403...

correct output
200

user output
81

Test 69

Verdict:

input
200 11139367
50914 81279 84150 90865 148618...

correct output
200

user output
168

Test 70

Verdict:

input
1000 589285011
33962 2483784 2880992 4837424 ...

correct output
998

user output
12

Test 71

Verdict:

input
1000 447774961
54585 191853 483557 1369773 14...

correct output
1000

user output
962

Test 72

Verdict:

input
1000 468146962
58977 735268 898440 1184659 12...

correct output
1000

user output
963

Test 73

Verdict:

input
1000 591415746
293786 457427 1304174 2617747 ...

correct output
995

user output
747

Test 74

Verdict:

input
1000 967035923
838480 973536 1455856 3142409 ...

correct output
1000

user output
924

Test 75

Verdict:

input
1000 238364352
91364 391838 528333 959636 117...

correct output
998

user output
353

Test 76

Verdict:

input
1000 958702282
557448 915344 2438616 2817236 ...

correct output
1000

user output
283

Test 77

Verdict:

input
1000 81936403
117854 134799 153186 216760 34...

correct output
999

user output
404

Test 78

Verdict:

input
1000 937838680
798751 996213 1265361 2336515 ...

correct output
1000

user output
681

Test 79

Verdict:

input
1000 11140167
3811 29493 33378 46013 50914 5...

correct output
1000

user output
168

Test 80

Verdict:

input
100000 589384011
2462 12290 14854 19988 28400 3...

correct output
99996

user output
84012

Test 81

Verdict:

input
100000 447873961
324 4948 5149 18319 22491 2468...

correct output
100000

user output
73962

Test 82

Verdict:

input
100000 468245962
9543 11563 11899 20558 24392 2...

correct output
100000

user output
45963

Test 83

Verdict:

input
100000 591514746
7688 9041 14326 23056 27308 28...

correct output
99998

user output
14747

Test 84

Verdict:

input
100000 967134923
1024 2994 6645 24256 27426 329...

correct output
99997

user output
34924

Test 85

Verdict:

input
100000 238463352
675 900 4012 15115 15476 22069...

correct output
100000

user output
63353

Test 86

Verdict:

input
100000 958801282
7177 18494 20083 35163 36876 4...

correct output
99999

user output
1283

Test 87

Verdict:

input
100000 82035403
237 539 626 1804 2747 3269 358...

correct output
100000

user output
35404

Test 88

Verdict:

input
100000 937937680
1191 7701 13173 20679 24337 30...

correct output
100000

user output
37681

Test 89

Verdict:

input
100000 11239167
70 124 318 547 595 692 784 880...

correct output
99999

user output
39168