結果
問題 | No.491 10^9+1と回文 |
ユーザー |
![]() |
提出日時 | 2023-06-15 04:01:57 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 343 ms / 1,000 ms |
コード長 | 352 bytes |
コンパイル時間 | 186 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-06-23 07:23:39 |
合計ジャッジ時間 | 34,785 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 103 |
ソースコード
import sysinput = sys.stdin.readlinen=int(input())count=0for i in range(10**5+1):S=str(i)T=S+S[::-1]U=S+S[:-1][::-1]ANS=T+(9-len(T))*"0"+T[::-1]if 1<=int(ANS)<=n and int(ANS)%(10**9+1)==0:count+=1ANS=U+(9-len(U))*"0"+U[::-1]if 1<=int(ANS)<=n and int(ANS)%(10**9+1)==0:count+=1print(count)