結果
| 問題 |
No.966 引き算をして門松列(その1)
|
| コンテスト | |
| ユーザー |
kekure
|
| 提出日時 | 2020-01-28 11:41:16 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 1,035 bytes |
| コンパイル時間 | 100 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 10,880 KB |
| 最終ジャッジ日時 | 2024-09-15 08:57:26 |
| 合計ジャッジ時間 | 798 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge6 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 2 |
| other | RE * 5 |
ソースコード
from collections import deque
N = int(input())
f = open('input.txt')
A = [int(line.rstrip()) for line in f.readlines()]
for n in range(N):
a, b, c = map(int, input().split())
if c > a:
a, c = c, a
ans = -1
if a == b == c and a >= 3:
ans = 3
elif b > a > c or a > c > b:
ans = 0
elif a > b and b == c and b >= 2:
ans = 1
elif a == b and b > c:
if b > c + 1:
ans = 1
elif b == c + 1 and c >= 2:
ans = 2
elif a == c and b > a and a >= 2:
ans = 1
elif a == c and b < a:
if a > b + 1:
ans = 1
if a == b + 1 and b >= 2:
ans = 2
elif (not a == b and not b == c and not c == a) and (c >= 2 or c == 1 and b > c + 1):
t = 10000000000
if c >= 2:
t = min(t, b - c + 1)
if b > c + 1:
t = min(t, a - b + 1)
if t == 10000000000:
ans = -1
else:
ans = t
else:
ans = -1
print(ans)
kekure