結果
問題 | No.491 10^9+1と回文 |
ユーザー | ノットカワズ |
提出日時 | 2017-03-28 07:45:46 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 783 bytes |
コンパイル時間 | 76 ms |
コンパイル使用メモリ | 12,800 KB |
実行使用メモリ | 11,008 KB |
最終ジャッジ日時 | 2024-07-06 12:58:41 |
合計ジャッジ時間 | 6,136 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | WA | - |
testcase_01 | AC | 26 ms
10,880 KB |
testcase_02 | WA | - |
testcase_03 | AC | 36 ms
10,752 KB |
testcase_04 | AC | 28 ms
10,752 KB |
testcase_05 | AC | 38 ms
10,752 KB |
testcase_06 | AC | 134 ms
10,752 KB |
testcase_07 | AC | 29 ms
10,752 KB |
testcase_08 | AC | 27 ms
10,752 KB |
testcase_09 | WA | - |
testcase_10 | AC | 27 ms
10,752 KB |
testcase_11 | AC | 27 ms
10,752 KB |
testcase_12 | AC | 28 ms
10,752 KB |
testcase_13 | AC | 28 ms
10,752 KB |
testcase_14 | AC | 30 ms
10,880 KB |
testcase_15 | AC | 29 ms
10,880 KB |
testcase_16 | AC | 28 ms
10,624 KB |
testcase_17 | AC | 28 ms
10,752 KB |
testcase_18 | AC | 27 ms
10,752 KB |
testcase_19 | AC | 28 ms
10,752 KB |
testcase_20 | AC | 27 ms
10,752 KB |
testcase_21 | AC | 28 ms
10,752 KB |
testcase_22 | WA | - |
testcase_23 | AC | 30 ms
10,752 KB |
testcase_24 | WA | - |
testcase_25 | AC | 28 ms
10,752 KB |
testcase_26 | AC | 26 ms
10,752 KB |
testcase_27 | AC | 27 ms
10,752 KB |
testcase_28 | AC | 28 ms
10,624 KB |
testcase_29 | WA | - |
testcase_30 | AC | 30 ms
10,752 KB |
testcase_31 | AC | 28 ms
10,752 KB |
testcase_32 | AC | 28 ms
10,752 KB |
testcase_33 | WA | - |
testcase_34 | AC | 28 ms
10,752 KB |
testcase_35 | AC | 29 ms
10,752 KB |
testcase_36 | AC | 29 ms
10,752 KB |
testcase_37 | AC | 27 ms
10,752 KB |
testcase_38 | AC | 27 ms
10,752 KB |
testcase_39 | AC | 28 ms
10,752 KB |
testcase_40 | AC | 28 ms
10,752 KB |
testcase_41 | AC | 29 ms
10,752 KB |
testcase_42 | AC | 27 ms
10,752 KB |
testcase_43 | AC | 27 ms
10,752 KB |
testcase_44 | AC | 28 ms
10,752 KB |
testcase_45 | AC | 29 ms
10,752 KB |
testcase_46 | AC | 27 ms
10,752 KB |
testcase_47 | AC | 26 ms
10,624 KB |
testcase_48 | AC | 28 ms
10,752 KB |
testcase_49 | AC | 27 ms
10,752 KB |
testcase_50 | AC | 27 ms
10,752 KB |
testcase_51 | AC | 28 ms
10,752 KB |
testcase_52 | AC | 28 ms
10,752 KB |
testcase_53 | AC | 28 ms
10,880 KB |
testcase_54 | AC | 28 ms
10,752 KB |
testcase_55 | AC | 27 ms
10,752 KB |
testcase_56 | AC | 27 ms
10,752 KB |
testcase_57 | AC | 28 ms
10,752 KB |
testcase_58 | AC | 29 ms
10,752 KB |
testcase_59 | AC | 28 ms
10,880 KB |
testcase_60 | AC | 27 ms
10,752 KB |
testcase_61 | WA | - |
testcase_62 | AC | 28 ms
10,752 KB |
testcase_63 | AC | 29 ms
10,752 KB |
testcase_64 | AC | 28 ms
10,752 KB |
testcase_65 | AC | 28 ms
10,752 KB |
testcase_66 | AC | 29 ms
10,752 KB |
testcase_67 | AC | 38 ms
10,752 KB |
testcase_68 | AC | 28 ms
10,752 KB |
testcase_69 | AC | 29 ms
10,752 KB |
testcase_70 | AC | 28 ms
10,752 KB |
testcase_71 | AC | 28 ms
10,752 KB |
testcase_72 | AC | 28 ms
10,880 KB |
testcase_73 | AC | 29 ms
10,752 KB |
testcase_74 | AC | 30 ms
10,752 KB |
testcase_75 | WA | - |
testcase_76 | AC | 29 ms
10,752 KB |
testcase_77 | AC | 28 ms
10,752 KB |
testcase_78 | AC | 28 ms
10,752 KB |
testcase_79 | AC | 29 ms
10,624 KB |
testcase_80 | AC | 30 ms
10,880 KB |
testcase_81 | WA | - |
testcase_82 | AC | 28 ms
10,624 KB |
testcase_83 | AC | 28 ms
10,880 KB |
testcase_84 | WA | - |
testcase_85 | AC | 29 ms
10,752 KB |
testcase_86 | WA | - |
testcase_87 | AC | 29 ms
10,752 KB |
testcase_88 | AC | 28 ms
10,752 KB |
testcase_89 | AC | 29 ms
10,752 KB |
testcase_90 | AC | 28 ms
10,752 KB |
testcase_91 | AC | 28 ms
10,752 KB |
testcase_92 | WA | - |
testcase_93 | AC | 28 ms
10,880 KB |
testcase_94 | AC | 28 ms
10,880 KB |
testcase_95 | WA | - |
testcase_96 | AC | 29 ms
10,752 KB |
testcase_97 | AC | 103 ms
10,752 KB |
testcase_98 | AC | 109 ms
10,752 KB |
testcase_99 | AC | 108 ms
10,752 KB |
testcase_100 | WA | - |
testcase_101 | AC | 117 ms
10,752 KB |
testcase_102 | AC | 107 ms
10,752 KB |
testcase_103 | AC | 111 ms
10,624 KB |
testcase_104 | WA | - |
testcase_105 | WA | - |
ソースコード
# -*- coding: utf-8 -*- import sys s = input() if int(s) < 10 ** 9 + 1: print(0) sys.exit() index = len(s)-9 total = 0 kaibunsu_dict = { 0: 0, 1: 9, 2: 18, 3: 108, 4: 198, 5: 1098, 6: 1998, 7: 10998, 8: 19998, 9: 109998 } total += kaibunsu_dict[index-1] def gen_palindromic(k, B, l=0): if l == k: yield 0 elif l == k - 1: for d in range(B): yield d else: begin = 1 if l == 0 else 0 m = B ** (k - l - 1) + 1 for d in range(begin, B): for n in gen_palindromic(k, B, l + 2): yield n * B + d * m left_numbers = s[:index] for x in gen_palindromic(index, 10): if x <= int(left_numbers): total += 1 len(left_numbers) print(total)