提出 #20888362


ソースコード 拡げる

import sys
input = sys.stdin.readline
import numpy as np

#    int(input())
#    input().split().strip()
#    map(int, input().strip().split())




n_s = input().strip()
n = int(n_s)

n_len = len(n_s)

n_co = (n_len-1)//3

ans = 0


if n <= 999:
    pass
else:
    for i in range(4, n_len):
        ans += 9* ((i-1)//3) * 10**(i-1)


    ans += (int(n_s[1:])+1)*n_co
    ans += (int(n_s[0])-1)*n_co*10**(n_len-1)


print(ans)

提出情報

提出日時
問題 C - Comma
ユーザ rsypoz
言語 Python (3.8.2)
得点 300
コード長 459 Byte
結果 AC
実行時間 117 ms
メモリ 27164 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 300 / 300
結果
AC × 2
AC × 20
セット名 テストケース
Sample sample_01.txt, sample_02.txt
All hand_01.txt, hand_02.txt, hand_03.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, sample_01.txt, sample_02.txt
ケース名 結果 実行時間 メモリ
hand_01.txt AC 117 ms 26812 KiB
hand_02.txt AC 112 ms 26568 KiB
hand_03.txt AC 110 ms 26984 KiB
random_01.txt AC 112 ms 27016 KiB
random_02.txt AC 110 ms 26844 KiB
random_03.txt AC 109 ms 26544 KiB
random_04.txt AC 111 ms 26644 KiB
random_05.txt AC 114 ms 27148 KiB
random_06.txt AC 112 ms 26892 KiB
random_07.txt AC 110 ms 27164 KiB
random_08.txt AC 113 ms 26940 KiB
random_09.txt AC 114 ms 26928 KiB
random_10.txt AC 113 ms 26988 KiB
random_11.txt AC 113 ms 26940 KiB
random_12.txt AC 115 ms 27144 KiB
random_13.txt AC 112 ms 26912 KiB
random_14.txt AC 113 ms 27112 KiB
random_15.txt AC 111 ms 26896 KiB
sample_01.txt AC 112 ms 27088 KiB
sample_02.txt AC 109 ms 26668 KiB