結果
問題 |
No.966 引き算をして門松列(その1)
|
ユーザー |
![]() |
提出日時 | 2020-01-13 21:55:57 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 595 bytes |
コンパイル時間 | 290 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-12-23 00:34:20 |
合計ジャッジ時間 | 878 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 1 WA * 4 |
ソースコード
# coding: utf-8 # Your code here! N=int(input()) for _ in range(N): A,B,C=map(int,input().split()) if A==B and B==C: if A>2: print(3) else: print(-1) exit() ans=0 if (B>A and B>C) or (B<A and B<C): if A==C: if A==1: print(-1) exit() else: ans+=1 print(ans) else: if B<3 or (A==1 and C==1): print(-1) else: mx=B-1 mi=min(A,C)-1 print(min(max(A,C)-mx,B-mi))