結果

問題 No.112 ややこしい鶴亀算
ユーザー brthyyjpbrthyyjp
提出日時 2021-06-28 19:03:50
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 40 ms / 5,000 ms
コード長 342 bytes
コンパイル時間 217 ms
コンパイル使用メモリ 82,228 KB
実行使用メモリ 53,892 KB
最終ジャッジ日時 2024-06-25 13:42:59
合計ジャッジ時間 2,061 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
A = list(map(int, input().split()))
S = [A[0]+2, A[0]+4]
for s in S:
    t = 0
    k = 0
    flag = True
    for a in A:
        if s-a == 2:
            t += 1
        elif s-a == 4:
            k += 1
        else:
            flag = False
            break
    if flag and s == 2*t+4*k:
        print(t, k)
        exit()
0