結果
| 問題 |
No.966 引き算をして門松列(その1)
|
| コンテスト | |
| ユーザー |
vwxyz
|
| 提出日時 | 2024-04-19 15:57:43 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 121 ms / 2,000 ms |
| コード長 | 332 bytes |
| コンパイル時間 | 117 ms |
| コンパイル使用メモリ | 12,416 KB |
| 実行使用メモリ | 10,880 KB |
| 最終ジャッジ日時 | 2024-10-11 08:04:00 |
| 合計ジャッジ時間 | 996 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 5 |
ソースコード
T=int(input())
inf=1<<60
for t in range(T):
A,B,C=map(int,input().split())
s=0
if A==C:
s+=1
C-=1
if A>C:
A,C=C,A
ans=inf
if A>=2:
ans=min(ans,max(B-A+1,0)+s)
if B>=3 and C>=2:
ans=min(ans,max(A-B+2,0)+max(C-B+1,0)+s)
if ans==inf:
ans=-1
print(ans)
vwxyz