結果
問題 | No.966 引き算をして門松列(その1) |
ユーザー |
![]() |
提出日時 | 2024-04-19 15:55:56 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 323 bytes |
コンパイル時間 | 161 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-10-11 08:02:33 |
合計ジャッジ時間 | 1,379 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 3 WA * 2 |
ソースコード
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: ans=min(ans,max(A-B+2,0)+max(C-B+1,0)+s) if ans==inf: ans=-1 print(ans)