結果

問題 No.1185 完全な3の倍数
ユーザー tntn
提出日時 2022-03-10 15:47:06
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 805 bytes
コンパイル時間 195 ms
コンパイル使用メモリ 10,896 KB
実行使用メモリ 7,960 KB
最終ジャッジ日時 2023-10-12 18:01:37
合計ジャッジ時間 5,303 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 16 ms
7,840 KB
testcase_02 AC 15 ms
7,924 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 16 ms
7,800 KB
testcase_10 AC 15 ms
7,908 KB
testcase_11 AC 15 ms
7,844 KB
testcase_12 AC 15 ms
7,916 KB
testcase_13 AC 15 ms
7,768 KB
testcase_14 AC 15 ms
7,848 KB
testcase_15 AC 15 ms
7,796 KB
testcase_16 AC 15 ms
7,912 KB
testcase_17 AC 15 ms
7,844 KB
testcase_18 AC 15 ms
7,792 KB
testcase_19 AC 98 ms
7,852 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 95 ms
7,796 KB
testcase_24 WA -
testcase_25 AC 91 ms
7,888 KB
testcase_26 WA -
testcase_27 AC 98 ms
7,800 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 91 ms
7,780 KB
testcase_32 WA -
testcase_33 AC 94 ms
7,776 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 AC 15 ms
7,892 KB
testcase_40 AC 90 ms
7,856 KB
testcase_41 AC 90 ms
7,764 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: utf-8
# Your code here!
n = int(input())

cnt = 0

for i in range(10, min(100, n + 1)):
    cnt = cnt + 1 if (int(str(i)[0]) + int(str(i)[1])) % 3 == 0 and i % 3 == 0 else cnt
    
if n > 100:
    numList = ['0', '3', '6', '9']
    for a in range(4):
        for b in range(4):
            for c in range(4):
                for d in range(4):
                    for e in range(4):
                        for f in range(4):
                            for g in range(4):
                                for h in range(4):
                                    s = int(numList[a] + numList[b] + numList[c] + numList[d] + numList[e] + numList[f] + numList[g] + numList[h])
                                    if s <= n and s > 100:
                                        cnt += 1
    
print(cnt)
0