結果
| 問題 | No.2119 一般化百五減算 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-11-04 22:35:49 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 182 ms / 2,000 ms |
| コード長 | 407 bytes |
| コンパイル時間 | 154 ms |
| コンパイル使用メモリ | 82,048 KB |
| 実行使用メモリ | 94,168 KB |
| 最終ジャッジ日時 | 2024-07-18 20:31:49 |
| 合計ジャッジ時間 | 2,406 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 25 |
ソースコード
n = int(input())
m = int(input())
BC = []
dic = {}
for i in range(m):
b,c = map(int,input().split())
c %= b
if b in dic and dic[b] != c:
print("NaN")
exit()
dic[b] = c
BC.append([b,c])
nums = [0]*(n+1)
for b,c in BC:
for i in range(c,n+1,b):
nums[i] += 1
le = len(BC)
for i in range(n+1):
if nums[i] == le:
print(i)
exit()
print("NaN")