結果

問題 No.112 ややこしい鶴亀算
ユーザー ohana
提出日時 2023-09-29 17:13:50
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 39 ms / 5,000 ms
コード長 324 bytes
コンパイル時間 232 ms
コンパイル使用メモリ 82,560 KB
実行使用メモリ 52,480 KB
最終ジャッジ日時 2024-07-22 11:16:21
合計ジャッジ時間 1,917 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
C = list(map(int, input().split()))
A, B = [], []

for c in C:
    a = (4 * (n - 1) - c) // 2
    b = (c - 2 * (n - 1)) // 2
    A.append(a)
    B.append(b)


if len(set(A)) == 1:
    a, b = A[0], B[0]
    if a == 0:
        print(a, b + 1)
    else:
        print(a + 1, b)
else:
    print(max(A), max(B))
0