結果
問題 |
No.3264 岩井数
|
ユーザー |
|
提出日時 | 2025-09-06 15:04:47 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 640 bytes |
コンパイル時間 | 244 ms |
コンパイル使用メモリ | 82,568 KB |
実行使用メモリ | 84,004 KB |
最終ジャッジ日時 | 2025-09-06 15:05:01 |
合計ジャッジ時間 | 4,852 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 2 |
other | AC * 7 TLE * 1 -- * 22 |
ソースコード
def ip():return int(input()) def mp():return map(int, input().split()) def lmp():return list(map(int, input().split())) # 岩プロコン2 F No.3264 岩井数 N = ip() i = 1000 M = 10**9 K = [1] for j in range(1100): K.append(K[-1] * 10 % N) # print(K[:10]) while True: si = str(i) si_ = si[::-1] ti = int(si + si_ + '9') L = len(si) if ti >= M and ((i % N) * (K[L+1] % N) + (int(si_) % N * 10 % N) + 9) % N == 0: print(ti) exit() for j in range(10): ti = int(si + str(j) + si_ + '9') if ((i % N) * (K[L+2] % N) + (j * K[L+1] % N) + (int(si_) % N * 10 % N) + 9) % N == 0: print(ti) exit() i += 1