結果

問題 No.1682 Unfair Game
ユーザー lam6er
提出日時 2025-03-20 18:46:20
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 43 ms / 2,000 ms
コード長 430 bytes
コンパイル時間 172 ms
コンパイル使用メモリ 82,280 KB
実行使用メモリ 53,660 KB
最終ジャッジ日時 2025-03-20 18:46:49
合計ジャッジ時間 2,082 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 10**9 + 7

N = int(input())
P = list(map(int, input().split()))

a_count = 0  # number of coins with p_i < 50 (s_i = +1)
b_count = 0  # number of coins with p_i > 50 (s_i = -1)

for p in P:
    if p < 50:
        a_count += 1
    elif p > 50:
        b_count += 1

if b_count == 0:
    print(0)
else:
    # The answer is 2^(a_count + b_count - 1) mod MOD
    exponent = a_count + b_count - 1
    print(pow(2, exponent, MOD))
0