結果
| 問題 | No.3560 Giant Salamander |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-06-21 12:44:27 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 665 bytes |
| 記録 | |
| コンパイル時間 | 1,129 ms |
| コンパイル使用メモリ | 84,736 KB |
| 実行使用メモリ | 106,036 KB |
| 最終ジャッジ日時 | 2026-06-21 12:44:35 |
| 合計ジャッジ時間 | 7,060 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge2_0 |
(要ログイン)
| サブタスク | 配点 | 結果 |
|---|---|---|
| 部分点1 | 5 % | AC * 5 |
| 部分点2 | 20 % | AC * 1 WA * 5 |
| 部分点3 | 15 % | AC * 1 WA * 10 |
| 部分点4 | 40 % | AC * 6 WA * 16 |
| 満点 | 20 % | AC * 13 WA * 22 |
| 合計 | 5 点 |
ソースコード
T = int(input())
for _ in range(T):
N,M = map(int,input().split())
arr = []
for _ in range(M):
arr.append(tuple(map(int,input().split())))
lower = -float("inf")
upper = float("inf")
x = N
y = 0
pre = 0
for a,b in arr:
l = (a-pre)%N
u = (a+b-pre)%N
#print(l, u)
if l < u:
lower = max(lower, l)
upper = min(upper, u)
else:
x = min(x, u)
y = max(y, l)
pre += b
#print(lower, upper)
if lower < upper and (lower < x or y < upper):
print("Yes")
else:
print("No")