CSES - Aalto Competitive Programming 2024 - wk12 - Wed - Results
Submission details
Task:Broken Clock
Sender:bielaltes
Submission time:2024-11-27 17:35:14 +0200
Language:C++ (C++11)
Status:READY
Result:
Test results
testverdicttime
#10.00 sdetails
#20.00 sdetails
#3ACCEPTED0.00 sdetails
#40.00 sdetails
#5ACCEPTED0.00 sdetails
#6ACCEPTED0.00 sdetails
#70.00 sdetails
#8ACCEPTED0.00 sdetails
#9ACCEPTED0.00 sdetails
#10ACCEPTED0.00 sdetails
#110.00 sdetails
#12ACCEPTED0.00 sdetails
#13ACCEPTED0.00 sdetails
#140.00 sdetails
#15ACCEPTED0.00 sdetails
#16ACCEPTED0.00 sdetails
#170.00 sdetails
#180.00 sdetails
#19ACCEPTED0.00 sdetails
#20ACCEPTED0.00 sdetails
#21ACCEPTED0.00 sdetails
#220.00 sdetails
#23ACCEPTED0.00 sdetails
#240.00 sdetails
#25ACCEPTED0.00 sdetails
#260.00 sdetails
#270.00 sdetails
#280.00 sdetails
#290.00 sdetails
#300.00 sdetails
#310.00 sdetails
#320.00 sdetails
#330.00 sdetails
#340.00 sdetails
#350.00 sdetails
#360.00 sdetails

Code

#include <iostream>
#include <vector>
#include <math.h>
#include <set>
using namespace std;

const double EPS = 1e-3;

int main() {
    double x;
    cin >> x;

    if (x == 0.0) {
        cout << 2 << endl;
        return 0;
    }

    set<int> matches;
    for (double t = 0; t < 23.99; t += EPS) {
        double real_time = fmod(t, 12);
        double fast_time = fmod(t * x, 12);
        
        if (fabs(real_time - fast_time) < EPS || 
            fabs(real_time - fast_time - 12) < EPS) {
            int match = round(t * 100);
            matches.insert(match);
        }
    }

    cout << matches.size() << endl;
    return 0;
}

Test details

Test 1

Verdict:

input
0.9971848082

correct output
1

user output
37

Test 2

Verdict:

input
0.1850820816

correct output
2

user output
3

Test 3

Verdict: ACCEPTED

input
0.0707248805

correct output
2

user output
2

Test 4

Verdict:

input
0.9006214549

correct output
1

user output
2

Test 5

Verdict: ACCEPTED

input
0.1103602416

correct output
2

user output
2

Test 6

Verdict: ACCEPTED

input
1.8949521528

correct output
2

user output
2

Test 7

Verdict:

input
0.4546781499

correct output
2

user output
3

Test 8

Verdict: ACCEPTED

input
0.0222288765

correct output
2

user output
2

Test 9

Verdict: ACCEPTED

input
0.7289220523

correct output
1

user output
1

Test 10

Verdict: ACCEPTED

input
0.3415342411

correct output
2

user output
2

Test 11

Verdict:

input
3.5098148931

correct output
6

user output
5

Test 12

Verdict: ACCEPTED

input
4.1380954486

correct output
7

user output
7

Test 13

Verdict: ACCEPTED

input
2.5952502394

correct output
4

user output
4

Test 14

Verdict:

input
4.8654862770

correct output
8

user output
5

Test 15

Verdict: ACCEPTED

input
1.3678163674

correct output
1

user output
1

Test 16

Verdict: ACCEPTED

input
0.2589275239

correct output
2

user output
2

Test 17

Verdict:

input
4.8654294622

correct output
8

user output
5

Test 18

Verdict:

input
6.5028570446

correct output
12

user output
5

Test 19

Verdict: ACCEPTED

input
1.2075778391

correct output
1

user output
1

Test 20

Verdict: ACCEPTED

input
2.1243024932

correct output
3

user output
3

Test 21

Verdict: ACCEPTED

input
3.4317726189

correct output
5

user output
5

Test 22

Verdict:

input
7.5915124659

correct output
14

user output
4

Test 23

Verdict: ACCEPTED

input
3.0255238309

correct output
5

user output
5

Test 24

Verdict:

input
1.0261771146

correct output
1

user output
5

Test 25

Verdict: ACCEPTED

input
6.4644975568

correct output
11

user output
11

Test 26

Verdict:

input
6.2380263835

correct output
11

user output
4

Test 27

Verdict:

input
1.5098866001

correct output
2

user output
3

Test 28

Verdict:

input
43.0019451095

correct output
85

user output
4

Test 29

Verdict:

input
91.2845645502

correct output
181

user output
8

Test 30

Verdict:

input
41.9205573795

correct output
82

user output
6

Test 31

Verdict:

input
40.0930977879

correct output
79

user output
5

Test 32

Verdict:

input
16.8983402792

correct output
32

user output
3

Test 33

Verdict:

input
95.8596173978

correct output
190

user output
6

Test 34

Verdict:

input
21.3799957375

correct output
41

user output
3

Test 35

Verdict:

input
83.9752180260

correct output
166

user output
4

Test 36

Verdict:

input
80.6444465607

correct output
160

user output
5