結果
問題 | No.112 ややこしい鶴亀算 |
ユーザー |
![]() |
提出日時 | 2025-03-31 17:18:27 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 452 bytes |
コンパイル時間 | 431 ms |
コンパイル使用メモリ | 82,576 KB |
実行使用メモリ | 54,316 KB |
最終ジャッジ日時 | 2025-03-31 17:19:11 |
合計ジャッジ時間 | 2,215 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 18 WA * 5 |
ソースコード
n = int(input())a = list(map(int, input().split()))s_candidate1 = a[0] + 2s_candidate2 = a[0] + 4def is_valid(s):for num in a:if (num + 2 != s) and (num + 4 != s):return Falsereturn Trues = Noneif is_valid(s_candidate1):s = s_candidate1else:s = s_candidate2c = (4 * n - s) // 2t = n - c# Verify the count of cranescount_c = 0for num in a:if num + 2 == s:count_c += 1print(c, t)