結果
問題 | No.966 引き算をして門松列(その1) |
ユーザー | ttr |
提出日時 | 2020-02-02 14:37:59 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 946 bytes |
コンパイル時間 | 139 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 12,032 KB |
最終ジャッジ日時 | 2024-09-18 20:44:59 |
合計ジャッジ時間 | 980 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 31 ms
10,752 KB |
testcase_01 | AC | 31 ms
10,880 KB |
testcase_02 | AC | 28 ms
10,880 KB |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | AC | 82 ms
12,032 KB |
ソースコード
T = int(input())A = [0]*TB = [0]*TC = [0]*Tfor i in range(T):A[i], B[i], C[i] = map(int, input().split())inf = 3*10**9for i in range(T):if 0 < A[i] < B[i] and 0 < C[i] < B[i] and A[i] != C[i]:print(0)continueif 0 < B[i] and min(A[i], B[i], C[i]) == B[i] and A[i] != C[i]:print(0)continuea = max(B[i], C[i])-1if a == min(B[i], C[i]):a -= 1if a <= 0 or B[i] == C[i] or A[i] == min(A[i], B[i], C[i]):a = infelse:a = A[i]-ab = min(A[i], C[i])-1if b <= 0 or A[i] == C[i]:b = infelse:b = B[i]-bc = max(A[i], B[i])-1if c == min(A[i], B[i]):c -= 1if c <= 0 or A[i] == B[i] or C[i] == min(A[i], B[i], C[i]):c = infelse:c = C[i]-cans = min(a, b, c)if ans == inf:ans = -1if A[i] == B[i] and B[i] == C[i] and A[i] > 2:ans = 3print(ans)