結果
| 問題 |
No.966 引き算をして門松列(その1)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-04-30 11:01:26 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 747 bytes |
| コンパイル時間 | 225 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 10,624 KB |
| 最終ジャッジ日時 | 2024-12-14 19:05:51 |
| 合計ジャッジ時間 | 1,175 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 2 WA * 3 |
ソースコード
T = int(input())
for i in range(T):
A, B, C = list(map(int, input().split()))
if A == B == C:
print(3)
elif A <= B <= C:
ba = B - A + 1
cb = C - B + 1
if C - cb == A:
cb += 1
if B <= ba and C <= cb:
print(-1)
elif B <= ba:
print(cb)
elif C <= cb:
print(ba)
else:
print(min([ba, cb]))
elif C <= B <= A:
bc = B - C + 1
ab = A - B + 1
if A - ab == C:
ab += 1
if B <= bc and A <= ab:
print(-1)
elif B <= bc:
print(ab)
elif A <= ab:
print(bc)
else:
print(min([bc, ab]))
else:
print(0)