結果

問題 No.966 引き算をして門松列(その1)
ユーザー komkompikomkompi
提出日時 2020-01-13 21:53:46
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 480 bytes
コンパイル時間 94 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-06-02 06:17:11
合計ジャッジ時間 897 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
10,752 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 94 ms
10,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: utf-8
# Your code here!
N=int(input())

for _ in range(N):
    A,B,C=map(int,input().split())
    
    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))
        
0