結果
問題 | No.2119 一般化百五減算 |
ユーザー |
![]() |
提出日時 | 2022-11-04 21:33:11 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 121 ms / 2,000 ms |
コード長 | 272 bytes |
コンパイル時間 | 120 ms |
コンパイル使用メモリ | 82,104 KB |
実行使用メモリ | 77,312 KB |
最終ジャッジ日時 | 2024-07-18 19:16:10 |
合計ジャッジ時間 | 2,476 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 25 |
ソースコード
from collections import deque n = int(input()) d = deque([i for i in range(n+1)]) m = int(input()) for _ in range(m): b, c = map(int, input().split()) c %= b for i in range(len(d)): x = d.popleft() if x % b == c: d.append(x) print(d[0] if d else "NaN")