結果

問題 No.2119 一般化百五減算
ユーザー タコイモ
提出日時 2022-11-04 22:29:40
言語 PyPy3
(8.0.1 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
MLE  
(最新)
AC  
(最初)
実行時間 -
コード長 325 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 95 ms
コンパイル使用メモリ 64,664 KB
実行使用メモリ 1,338,160 KB
最終ジャッジ日時 2026-10-23 09:17:03
合計ジャッジ時間 8,287 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other MLE * 2 -- * 24
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

N = int(input())
M = int(input())
true = [set() for _ in range(M+1)]
true[0] = {i for i in range(N+1)}

for i in range(1,M+1):
  b,c = map(int,input().split())
  d = c%b
  
  for j in true[i-1]:
    if j % b == d:
      true[i].add(j)
if len(true[M]) == 0:
  print('NaN')
  exit()
print(min(true[M]))
    
  
  

  
  
  

  
0