CSES - HIIT Open 2017 - Results
Submission details
Task:Epic set
Sender:KnowYourArchitecture
Submission time:2017-05-27 12:10:54 +0300
Language:C++
Status:READY
Result:
Test results
testverdicttime
#1--details
#2--details
#3--details
#4--details
#5--details
#6--details
#7--details
#8--details
#9--details
#10--details
#11--details
#12--details
#13--details
#14--details
#15--details
#16--details
#17--details
#18--details
#19--details
#20--details
#210.49 sdetails
#22--details
#23--details
#24ACCEPTED0.48 sdetails
#25--details
#26--details
#27ACCEPTED0.46 sdetails
#28--details
#29--details
#30ACCEPTED0.48 sdetails
#31--details
#32ACCEPTED0.49 sdetails
#330.49 sdetails
#34ACCEPTED0.49 sdetails
#35--details
#36ACCEPTED0.47 sdetails
#37ACCEPTED0.46 sdetails
#38ACCEPTED0.46 sdetails
#39ACCEPTED0.45 sdetails
#40ACCEPTED0.44 sdetails
#41--details
#42ACCEPTED0.47 sdetails
#43ACCEPTED0.46 sdetails
#44ACCEPTED0.46 sdetails
#45ACCEPTED0.45 sdetails

Compiler report

input/code.cpp: In function 'int main()':
input/code.cpp:17:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (int i = 0; i < N; i++) {
                         ^
input/code.cpp:23:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         while (c >= b) c /= b;
                     ^

Code

#include <bits/stdc++.h>

using namespace std;

typedef unsigned long long int ull;

const ull N = 4000000;

ull counts[100];

int main() {
    ull a, b;
    cin >> a >> b;
    
    int cur = 1;
    
    for (int i = 0; i < N; i++) {
        //cout<<cur<<endl;
        if (cur*2 <= cur)
            cur /= b;
        cur *= 2;
        int c = cur;
        while (c >= b) c /= b;
        counts[c]++;
    }
    
    //for (int i = 0; i < 10; i++)
    //    cout<<i<<": "<<counts[i]<<endl;
    cout << setprecision(15) << double(counts[a])/N << endl;
    
    return 0;
}

Test details

Test 1

Verdict:

input
1 2

correct output
1

user output
(empty)

Test 2

Verdict:

input
1 3

correct output
0.630929754

user output
(empty)

Test 3

Verdict:

input
2 3

correct output
0.369070246

user output
(empty)

Test 4

Verdict:

input
1 4

correct output
0.5

user output
(empty)

Test 5

Verdict:

input
2 4

correct output
0.5

user output
(empty)

Test 6

Verdict:

input
3 4

correct output
0

user output
(empty)

Test 7

Verdict:

input
1 5

correct output
0.430676558

user output
(empty)

Test 8

Verdict:

input
2 5

correct output
0.251929636

user output
(empty)

Test 9

Verdict:

input
3 5

correct output
0.178746922

user output
(empty)

Test 10

Verdict:

input
4 5

correct output
0.138646884

user output
(empty)

Test 11

Verdict:

input
1 6

correct output
0.386852807

user output
(empty)

Test 12

Verdict:

input
2 6

correct output
0.226294386

user output
(empty)

Test 13

Verdict:

input
3 6

correct output
0.160558422

user output
(empty)

Test 14

Verdict:

input
4 6

correct output
0.124538787

user output
(empty)

Test 15

Verdict:

input
5 6

correct output
0.101755598

user output
(empty)

Test 16

Verdict:

input
1 7

correct output
0.356207187

user output
(empty)

Test 17

Verdict:

input
2 7

correct output
0.208367847

user output
(empty)

Test 18

Verdict:

input
3 7

correct output
0.147839340

user output
(empty)

Test 19

Verdict:

input
4 7

correct output
0.114673101

user output
(empty)

Test 20

Verdict:

input
5 7

correct output
0.093694746

user output
(empty)

Test 21

Verdict:

input
6 7

correct output
0.079217779

user output
0.07921525

Test 22

Verdict:

input
1 8

correct output
0.333333333

user output
(empty)

Test 23

Verdict:

input
2 8

correct output
0.333333333

user output
(empty)

Test 24

Verdict: ACCEPTED

input
3 8

correct output
0

user output
0

Test 25

Verdict:

input
4 8

correct output
0.333333333

user output
(empty)

Test 26

Verdict:

input
5 8

correct output
0

user output
(empty)

Test 27

Verdict: ACCEPTED

input
6 8

correct output
0

user output
0

Test 28

Verdict:

input
7 8

correct output
0

user output
(empty)

Test 29

Verdict:

input
1 9

correct output
0.315464877

user output
(empty)

Test 30

Verdict: ACCEPTED

input
2 9

correct output
0.184535123

user output
0.184535

Test 31

Verdict:

input
3 9

correct output
0.130929754

user output
(empty)

Test 32

Verdict: ACCEPTED

input
4 9

correct output
0.101557007

user output
0.101558

Test 33

Verdict:

input
5 9

correct output
0.082978116

user output
0.082977

Test 34

Verdict: ACCEPTED

input
6 9

correct output
0.070156998

user output
0.07015675

Test 35

Verdict:

input
7 9

correct output
0.060772756

user output
(empty)

Test 36

Verdict: ACCEPTED

input
8 9

correct output
0.053605370

user output
0.0536055

Test 37

Verdict: ACCEPTED

input
1 10

correct output
0.301029996

user output
0.30102975

Test 38

Verdict: ACCEPTED

input
2 10

correct output
0.176091259

user output
0.17609175

Test 39

Verdict: ACCEPTED

input
3 10

correct output
0.124938737

user output
0.12493825

Test 40

Verdict: ACCEPTED

input
4 10

correct output
0.096910013

user output
0.09691025

Test 41

Verdict:

input
5 10

correct output
0.079181246

user output
(empty)

Test 42

Verdict: ACCEPTED

input
6 10

correct output
0.066946790

user output
0.06694625

Test 43

Verdict: ACCEPTED

input
7 10

correct output
0.057991947

user output
0.057992

Test 44

Verdict: ACCEPTED

input
8 10

correct output
0.051152522

user output
0.051152

Test 45

Verdict: ACCEPTED

input
9 10

correct output
0.045757491

user output
0.04575825