QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#508362#7658. German Conference for Public CountingUmokWA 0ms3692kbC++20982b2024-08-07 14:08:032024-08-07 14:08:05

Judging History

你现在查看的是最新测评结果

  • [2024-08-07 14:08:05]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3692kb
  • [2024-08-07 14:08:03]
  • 提交

answer

#include <iostream>

using namespace std;

int main(void)
{
        long long x;
        cin >> x;

        long long t = x;
        long long sum = 0;

        if (x == 0)
        {
                cout << 1 << endl;
                return 0;
        }
        else if (x <= 9)
        {
                cout << (x + 1) << endl;
                return 0;
        }
        else if (x == 10)
        {
                cout << 10 << endl;
                return 0;
        }

        int k = 0;
        long long num = 0;
        while (x > 10)
        {
                num++;
                sum += 10;
                k = x % 10;
                x = x / 10;
        }

        long long xt = x;
        while (num > 0)
        {
                xt *= 10;
                xt += x;
                num--;
        }

        long long suman = sum + x;
        if (xt > t) suman--;
        cout << suman << endl;

        return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3540kb

input:

5

output:

6

result:

ok single line: '6'

Test #2:

score: 0
Accepted
time: 0ms
memory: 3624kb

input:

20

output:

11

result:

ok single line: '11'

Test #3:

score: 0
Accepted
time: 0ms
memory: 3496kb

input:

44

output:

14

result:

ok single line: '14'

Test #4:

score: 0
Accepted
time: 0ms
memory: 3536kb

input:

271828182

output:

82

result:

ok single line: '82'

Test #5:

score: 0
Accepted
time: 0ms
memory: 3492kb

input:

314159265

output:

82

result:

ok single line: '82'

Test #6:

score: 0
Accepted
time: 0ms
memory: 3688kb

input:

1

output:

2

result:

ok single line: '2'

Test #7:

score: 0
Accepted
time: 0ms
memory: 3672kb

input:

2

output:

3

result:

ok single line: '3'

Test #8:

score: 0
Accepted
time: 0ms
memory: 3608kb

input:

3

output:

4

result:

ok single line: '4'

Test #9:

score: 0
Accepted
time: 0ms
memory: 3684kb

input:

4

output:

5

result:

ok single line: '5'

Test #10:

score: 0
Accepted
time: 0ms
memory: 3536kb

input:

6

output:

7

result:

ok single line: '7'

Test #11:

score: 0
Accepted
time: 0ms
memory: 3608kb

input:

7

output:

8

result:

ok single line: '8'

Test #12:

score: 0
Accepted
time: 0ms
memory: 3536kb

input:

8

output:

9

result:

ok single line: '9'

Test #13:

score: 0
Accepted
time: 0ms
memory: 3616kb

input:

9

output:

10

result:

ok single line: '10'

Test #14:

score: 0
Accepted
time: 0ms
memory: 3588kb

input:

10

output:

10

result:

ok single line: '10'

Test #15:

score: 0
Accepted
time: 0ms
memory: 3600kb

input:

11

output:

11

result:

ok single line: '11'

Test #16:

score: 0
Accepted
time: 0ms
memory: 3500kb

input:

12

output:

11

result:

ok single line: '11'

Test #17:

score: 0
Accepted
time: 0ms
memory: 3612kb

input:

13

output:

11

result:

ok single line: '11'

Test #18:

score: 0
Accepted
time: 0ms
memory: 3616kb

input:

14

output:

11

result:

ok single line: '11'

Test #19:

score: 0
Accepted
time: 0ms
memory: 3540kb

input:

15

output:

11

result:

ok single line: '11'

Test #20:

score: 0
Accepted
time: 0ms
memory: 3496kb

input:

16

output:

11

result:

ok single line: '11'

Test #21:

score: 0
Accepted
time: 0ms
memory: 3500kb

input:

17

output:

11

result:

ok single line: '11'

Test #22:

score: 0
Accepted
time: 0ms
memory: 3688kb

input:

18

output:

11

result:

ok single line: '11'

Test #23:

score: 0
Accepted
time: 0ms
memory: 3636kb

input:

19

output:

11

result:

ok single line: '11'

Test #24:

score: 0
Accepted
time: 0ms
memory: 3668kb

input:

21

output:

11

result:

ok single line: '11'

Test #25:

score: 0
Accepted
time: 0ms
memory: 3664kb

input:

22

output:

12

result:

ok single line: '12'

Test #26:

score: 0
Accepted
time: 0ms
memory: 3472kb

input:

23

output:

12

result:

ok single line: '12'

Test #27:

score: 0
Accepted
time: 0ms
memory: 3668kb

input:

24

output:

12

result:

ok single line: '12'

Test #28:

score: 0
Accepted
time: 0ms
memory: 3604kb

input:

25

output:

12

result:

ok single line: '12'

Test #29:

score: 0
Accepted
time: 0ms
memory: 3612kb

input:

999999998

output:

88

result:

ok single line: '88'

Test #30:

score: 0
Accepted
time: 0ms
memory: 3668kb

input:

999999999

output:

89

result:

ok single line: '89'

Test #31:

score: -100
Wrong Answer
time: 0ms
memory: 3692kb

input:

1000000000

output:

89

result:

wrong answer 1st lines differ - expected: '90', found: '89'