結果
問題 |
No.966 引き算をして門松列(その1)
|
ユーザー |
|
提出日時 | 2020-01-13 20:53:33 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 393 bytes |
コンパイル時間 | 263 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-12-21 17:05:29 |
合計ジャッジ時間 | 1,361 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 2 |
other | AC * 1 WA * 4 |
ソースコード
def solve(a,b,c): if a==c==1: return -1 if a==c: return 1+solve(a,b,c-1) if a>c: return solve(c,b,a) assert 1<=a<c if c<b or b<a: return 0 if a==1: return -1 if b==1 or b==2: return b-(a-1) return min(b-(a-1),c-(b-1)+min(a,b-2)-a) for _ in range(int(input())): a,b,c=map(int,input().split()) print(solve(a,b,c))