結果
問題 |
No.965 門松列が嫌い
|
ユーザー |
|
提出日時 | 2020-04-18 15:15:36 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 374 bytes |
コンパイル時間 | 341 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-10-03 23:42:22 |
合計ジャッジ時間 | 1,082 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 7 WA * 2 |
ソースコード
A, B, C = map(int, input().split()) if A > B > C or A < B < C: print(0) else: ans1 = 0 ans2 = abs(A - C) if A == C: C -= 1 ans1 += 1 if C > A: tmp = A A = C C = tmp if B >= A: ans1 += B - A + 1 B = A - 1 if B <= C: ans1 += C - B + 1 C = B - 1 print(min(ans1, ans2))