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

Compiler report

input/code.cpp: In function 'int main()':
input/code.cpp:19:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (int i = 0; i < N; i++) { \
                         ^
input/code.cpp:27:5: note: in expansion of macro 'FOO'
     FOO(1)
     ^
input/code.cpp:19:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (int i = 0; i < N; i++) { \
                         ^
input/code.cpp:28:5: note: in expansion of macro 'FOO'
     FOO(2)
     ^
input/code.cpp:19:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (int i = 0; i < N; i++) { \
                         ^
input/code.cpp:29:5: note: in expansion of macro 'FOO'
     FOO(3)
     ^
input/code.cpp:19:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (int i = 0; i < N; i++) { \
                         ^
input/code.cpp:30:5: note: in expansion of macro 'FO...

Code

#include <bits/stdc++.h>

using namespace std;

typedef unsigned long long int ull;

const ull N = 10000000;

ull counts[100];

int main() {
    ull a, realb;
    cin >> a >> realb;
    
    int cur = 1;
    
#define FOO(testb) \
    if (realb == testb) {\
    for (int i = 0; i < N; i++) { \
        if (cur*2 <= cur) cur /= testb; \
        cur *= 2; \
        int c = cur; \
        while (c >= testb) c /= testb; \
        counts[c]++; \
    }}
        
    FOO(1)
    FOO(2)
    FOO(3)
    FOO(4)
    FOO(5)
    FOO(6)
    FOO(7)
    FOO(8)
    FOO(9)
    FOO(10)
    
    
    //for (int i = 0; i < 10; i++)
    //    cout<<i<<": "<<counts[i]<<endl;
    cout << fixed << setprecision(15) << double(counts[a])/N << endl;
    
    return 0;
}

Test details

Test 1

Verdict: ACCEPTED

input
1 2

correct output
1

user output
1.000000000000000

Test 2

Verdict: ACCEPTED

input
1 3

correct output
0.630929754

user output
0.630929700000000

Test 3

Verdict: ACCEPTED

input
2 3

correct output
0.369070246

user output
0.369070300000000

Test 4

Verdict: ACCEPTED

input
1 4

correct output
0.5

user output
0.500000000000000

Test 5

Verdict: ACCEPTED

input
2 4

correct output
0.5

user output
0.500000000000000

Test 6

Verdict: ACCEPTED

input
3 4

correct output
0

user output
0.000000000000000

Test 7

Verdict: ACCEPTED

input
1 5

correct output
0.430676558

user output
0.430676500000000

Test 8

Verdict: ACCEPTED

input
2 5

correct output
0.251929636

user output
0.251930100000000

Test 9

Verdict: ACCEPTED

input
3 5

correct output
0.178746922

user output
0.178746500000000

Test 10

Verdict: ACCEPTED

input
4 5

correct output
0.138646884

user output
0.138646900000000

Test 11

Verdict: ACCEPTED

input
1 6

correct output
0.386852807

user output
0.386852800000000

Test 12

Verdict: ACCEPTED

input
2 6

correct output
0.226294386

user output
0.226294400000000

Test 13

Verdict: ACCEPTED

input
3 6

correct output
0.160558422

user output
0.160558400000000

Test 14

Verdict: ACCEPTED

input
4 6

correct output
0.124538787

user output
0.124538000000000

Test 15

Verdict: ACCEPTED

input
5 6

correct output
0.101755598

user output
0.101756400000000

Test 16

Verdict: ACCEPTED

input
1 7

correct output
0.356207187

user output
0.356207100000000

Test 17

Verdict:

input
2 7

correct output
0.208367847

user output
0.208369400000000

Test 18

Verdict:

input
3 7

correct output
0.147839340

user output
0.147837800000000

Test 19

Verdict: ACCEPTED

input
4 7

correct output
0.114673101

user output
0.114674000000000

Test 20

Verdict: ACCEPTED

input
5 7

correct output
0.093694746

user output
0.093695400000000

Test 21

Verdict:

input
6 7

correct output
0.079217779

user output
0.079216300000000

Test 22

Verdict: ACCEPTED

input
1 8

correct output
0.333333333

user output
0.333333300000000

Test 23

Verdict: ACCEPTED

input
2 8

correct output
0.333333333

user output
0.333333400000000

Test 24

Verdict: ACCEPTED

input
3 8

correct output
0

user output
0.000000000000000

Test 25

Verdict: ACCEPTED

input
4 8

correct output
0.333333333

user output
0.333333300000000

Test 26

Verdict: ACCEPTED

input
5 8

correct output
0

user output
0.000000000000000

Test 27

Verdict: ACCEPTED

input
6 8

correct output
0

user output
0.000000000000000

Test 28

Verdict: ACCEPTED

input
7 8

correct output
0

user output
0.000000000000000

Test 29

Verdict: ACCEPTED

input
1 9

correct output
0.315464877

user output
0.315464800000000

Test 30

Verdict: ACCEPTED

input
2 9

correct output
0.184535123

user output
0.184535100000000

Test 31

Verdict: ACCEPTED

input
3 9

correct output
0.130929754

user output
0.130929800000000

Test 32

Verdict: ACCEPTED

input
4 9

correct output
0.101557007

user output
0.101557700000000

Test 33

Verdict: ACCEPTED

input
5 9

correct output
0.082978116

user output
0.082977400000000

Test 34

Verdict: ACCEPTED

input
6 9

correct output
0.070156998

user output
0.070157100000000

Test 35

Verdict: ACCEPTED

input
7 9

correct output
0.060772756

user output
0.060772700000000

Test 36

Verdict: ACCEPTED

input
8 9

correct output
0.053605370

user output
0.053605400000000

Test 37

Verdict: ACCEPTED

input
1 10

correct output
0.301029996

user output
0.301029900000000

Test 38

Verdict: ACCEPTED

input
2 10

correct output
0.176091259

user output
0.176091500000000

Test 39

Verdict: ACCEPTED

input
3 10

correct output
0.124938737

user output
0.124938500000000

Test 40

Verdict: ACCEPTED

input
4 10

correct output
0.096910013

user output
0.096910100000000

Test 41

Verdict: ACCEPTED

input
5 10

correct output
0.079181246

user output
0.079181400000000

Test 42

Verdict: ACCEPTED

input
6 10

correct output
0.066946790

user output
0.066946500000000

Test 43

Verdict: ACCEPTED

input
7 10

correct output
0.057991947

user output
0.057992000000000

Test 44

Verdict: ACCEPTED

input
8 10

correct output
0.051152522

user output
0.051152400000000

Test 45

Verdict: ACCEPTED

input
9 10

correct output
0.045757491

user output
0.045757700000000