結果
| 問題 |
No.112 ややこしい鶴亀算
|
| ユーザー |
lam6er
|
| 提出日時 | 2025-03-26 15:43:55 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 41 ms / 5,000 ms |
| コード長 | 292 bytes |
| コンパイル時間 | 228 ms |
| コンパイル使用メモリ | 81,916 KB |
| 実行使用メモリ | 52,096 KB |
| 最終ジャッジ日時 | 2025-03-26 15:44:01 |
| 合計ジャッジ時間 | 2,211 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 23 |
ソースコード
n = int(input())
a = list(map(int, input().split()))
sum_a = sum(a)
t = sum_a // (n - 1)
# Check each a_i to ensure (t - a_i) is 2 or 4
# According to problem statement, the input guarantees this is valid
for ai in a:
assert (t - ai) in (2, 4)
x = (4 * n - t) // 2
y = n - x
print(x, y)
lam6er