結果
問題 | No.491 10^9+1と回文 |
ユーザー | 6soukiti29 |
提出日時 | 2017-03-21 22:16:04 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 735 bytes |
コンパイル時間 | 176 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-07-05 06:09:56 |
合計ジャッジ時間 | 5,379 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 32 ms
10,880 KB |
testcase_01 | AC | 31 ms
10,752 KB |
testcase_02 | WA | - |
testcase_03 | AC | 29 ms
10,752 KB |
testcase_04 | AC | 29 ms
10,880 KB |
testcase_05 | WA | - |
testcase_06 | AC | 30 ms
10,880 KB |
testcase_07 | AC | 29 ms
10,880 KB |
testcase_08 | AC | 29 ms
10,880 KB |
testcase_09 | WA | - |
testcase_10 | AC | 29 ms
10,752 KB |
testcase_11 | WA | - |
testcase_12 | AC | 28 ms
10,880 KB |
testcase_13 | AC | 29 ms
10,624 KB |
testcase_14 | AC | 28 ms
10,752 KB |
testcase_15 | AC | 28 ms
10,752 KB |
testcase_16 | AC | 27 ms
10,880 KB |
testcase_17 | AC | 28 ms
10,752 KB |
testcase_18 | AC | 29 ms
10,752 KB |
testcase_19 | AC | 29 ms
10,752 KB |
testcase_20 | WA | - |
testcase_21 | AC | 28 ms
10,880 KB |
testcase_22 | WA | - |
testcase_23 | AC | 28 ms
10,752 KB |
testcase_24 | WA | - |
testcase_25 | AC | 29 ms
10,752 KB |
testcase_26 | AC | 29 ms
10,624 KB |
testcase_27 | WA | - |
testcase_28 | AC | 30 ms
10,880 KB |
testcase_29 | WA | - |
testcase_30 | WA | - |
testcase_31 | AC | 28 ms
10,752 KB |
testcase_32 | WA | - |
testcase_33 | WA | - |
testcase_34 | AC | 28 ms
10,752 KB |
testcase_35 | WA | - |
testcase_36 | AC | 29 ms
10,624 KB |
testcase_37 | AC | 28 ms
10,880 KB |
testcase_38 | WA | - |
testcase_39 | AC | 28 ms
10,880 KB |
testcase_40 | AC | 28 ms
10,752 KB |
testcase_41 | AC | 29 ms
10,880 KB |
testcase_42 | WA | - |
testcase_43 | WA | - |
testcase_44 | AC | 29 ms
10,752 KB |
testcase_45 | WA | - |
testcase_46 | AC | 29 ms
10,880 KB |
testcase_47 | AC | 29 ms
10,752 KB |
testcase_48 | WA | - |
testcase_49 | AC | 29 ms
10,752 KB |
testcase_50 | AC | 29 ms
10,752 KB |
testcase_51 | WA | - |
testcase_52 | AC | 29 ms
10,752 KB |
testcase_53 | AC | 29 ms
10,752 KB |
testcase_54 | WA | - |
testcase_55 | WA | - |
testcase_56 | AC | 29 ms
10,752 KB |
testcase_57 | AC | 29 ms
10,752 KB |
testcase_58 | AC | 28 ms
10,752 KB |
testcase_59 | AC | 29 ms
10,880 KB |
testcase_60 | WA | - |
testcase_61 | WA | - |
testcase_62 | AC | 29 ms
10,880 KB |
testcase_63 | AC | 29 ms
10,752 KB |
testcase_64 | WA | - |
testcase_65 | WA | - |
testcase_66 | WA | - |
testcase_67 | AC | 28 ms
10,752 KB |
testcase_68 | WA | - |
testcase_69 | AC | 30 ms
10,624 KB |
testcase_70 | AC | 29 ms
10,752 KB |
testcase_71 | AC | 30 ms
10,880 KB |
testcase_72 | AC | 30 ms
10,752 KB |
testcase_73 | AC | 30 ms
10,752 KB |
testcase_74 | AC | 30 ms
10,880 KB |
testcase_75 | WA | - |
testcase_76 | WA | - |
testcase_77 | AC | 29 ms
10,752 KB |
testcase_78 | AC | 29 ms
10,880 KB |
testcase_79 | AC | 29 ms
10,752 KB |
testcase_80 | AC | 29 ms
10,752 KB |
testcase_81 | WA | - |
testcase_82 | WA | - |
testcase_83 | AC | 28 ms
10,752 KB |
testcase_84 | WA | - |
testcase_85 | AC | 29 ms
10,752 KB |
testcase_86 | WA | - |
testcase_87 | WA | - |
testcase_88 | AC | 29 ms
10,752 KB |
testcase_89 | AC | 29 ms
10,752 KB |
testcase_90 | AC | 29 ms
10,624 KB |
testcase_91 | AC | 29 ms
10,880 KB |
testcase_92 | WA | - |
testcase_93 | AC | 30 ms
10,752 KB |
testcase_94 | WA | - |
testcase_95 | WA | - |
testcase_96 | WA | - |
testcase_97 | AC | 30 ms
10,880 KB |
testcase_98 | WA | - |
testcase_99 | WA | - |
testcase_100 | WA | - |
testcase_101 | AC | 29 ms
10,880 KB |
testcase_102 | WA | - |
testcase_103 | WA | - |
testcase_104 | WA | - |
testcase_105 | WA | - |
ソースコード
def kaibun(y): x = len(str(y)) X = [9,9] i = 2 while x > i: if i % 2 == 0: X.append(X[i - 1] * 10) else: X.append(X[i - 1]) i = i + 1 a = sum(X[:x - 1]) for j in range(1, x // 2 + 1): if j == 1: a = a + (int(str(y)[j - 1]) - 1) * X[x - 2 * j + 1]//9 else: a = a + (int(str(y)[j - 1])) * X[x - 2 * j + 1] // 9 if str(y)[:x//2][::-1] and str(y)[x//2 + 1:] and int(str(y)[:x//2][::-1]) < int(str(y)[x//2:]) and x % 2 == 0: a = a + 1 elif str(y)[:x//2][::-1] and str(y)[x//2 + 1:] and int(str(y)[:x//2][::-1]) < int(str(y)[x//2 + 1:]) and x % 2 == 1: a = a + 1 + int(str(y)[x//2]) if x == 1: return y - 1 return a n = input() if len(n) < 10: print(0) else: n = n[:-9] n = int(n) print(kaibun(n))