結果

問題 No.1682 Unfair Game
ユーザー tassei903tassei903
提出日時 2021-09-17 22:38:52
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 73 ms / 2,000 ms
コード長 590 bytes
コンパイル時間 933 ms
コンパイル使用メモリ 86,968 KB
実行使用メモリ 71,472 KB
最終ジャッジ日時 2023-09-12 08:38:35
合計ジャッジ時間 2,922 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,424 KB
testcase_01 AC 73 ms
71,412 KB
testcase_02 AC 71 ms
71,364 KB
testcase_03 AC 71 ms
71,284 KB
testcase_04 AC 72 ms
71,440 KB
testcase_05 AC 71 ms
71,152 KB
testcase_06 AC 71 ms
71,328 KB
testcase_07 AC 70 ms
71,472 KB
testcase_08 AC 73 ms
71,392 KB
testcase_09 AC 72 ms
71,200 KB
testcase_10 AC 72 ms
71,388 KB
testcase_11 AC 72 ms
71,408 KB
testcase_12 AC 72 ms
71,420 KB
testcase_13 AC 72 ms
71,012 KB
testcase_14 AC 72 ms
71,236 KB
testcase_15 AC 72 ms
71,436 KB
testcase_16 AC 72 ms
71,128 KB
testcase_17 AC 72 ms
71,380 KB
testcase_18 AC 71 ms
71,328 KB
testcase_19 AC 72 ms
71,236 KB
testcase_20 AC 71 ms
71,156 KB
testcase_21 AC 71 ms
71,240 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda :sys.stdin.readline()[:-1]
ni = lambda :int(input())
na = lambda :list(map(int,input().split()))
sys.setrecursionlimit(10**7)
yes = lambda :print("yes");Yes = lambda :print("Yes");YES = lambda : print("YES")
no = lambda :print("no");No = lambda :print("No");NO = lambda : print("NO")
#######################################################################

n = ni()
p = na()
mod = 10**9+7
a,b,c = 0,0,0
for i in p:
    if i<50:
        a+=1
    elif i==50:
        b+=1
    else:
        c+=1
ans = pow(2,a+c,mod)-pow(2,a,mod)*pow(2,max(c-1,0),mod)
print(ans%mod)
0