結果

問題 No.112 ややこしい鶴亀算
ユーザー knk_keiknk_kei
提出日時 2021-02-03 02:38:15
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 397 bytes
コンパイル時間 250 ms
コンパイル使用メモリ 10,740 KB
実行使用メモリ 7,992 KB
最終ジャッジ日時 2023-09-12 11:43:06
合計ジャッジ時間 2,023 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,896 KB
testcase_01 AC 15 ms
7,748 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 15 ms
7,832 KB
testcase_05 AC 15 ms
7,824 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 15 ms
7,772 KB
testcase_09 AC 16 ms
7,900 KB
testcase_10 WA -
testcase_11 AC 16 ms
7,824 KB
testcase_12 WA -
testcase_13 AC 15 ms
7,944 KB
testcase_14 AC 16 ms
7,860 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 15 ms
7,848 KB
testcase_20 AC 15 ms
7,752 KB
testcase_21 WA -
testcase_22 AC 15 ms
7,896 KB
testcase_23 WA -
testcase_24 AC 15 ms
7,960 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = list(map(int, input().split()))
# いろんな解き方があるが、1種類ならその値+2//n = 2になるかの判定
if len(set(a)) == 1:
    if (a[0] + 2) // n == 2:
        print(n, 0)
    else:
        print(0, n)
else:
    ma = max(a)
    c, t = 0, 0
    for i in range(n):
        if a[i] != ma:
            c += 1
        else:
            t += 1
    print(c, t)

0