結果

問題 No.1410 A lot of Bit Operations
ユーザー googol_S0googol_S0
提出日時 2021-02-26 21:52:24
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 357 bytes
コンパイル時間 448 ms
コンパイル使用メモリ 82,532 KB
実行使用メモリ 54,432 KB
最終ジャッジ日時 2024-04-10 12:32:31
合計ジャッジ時間 3,522 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,572 KB
testcase_01 AC 36 ms
52,240 KB
testcase_02 AC 36 ms
52,620 KB
testcase_03 AC 37 ms
52,528 KB
testcase_04 AC 37 ms
52,792 KB
testcase_05 AC 36 ms
53,052 KB
testcase_06 AC 36 ms
53,816 KB
testcase_07 AC 36 ms
52,668 KB
testcase_08 AC 37 ms
52,320 KB
testcase_09 AC 36 ms
52,816 KB
testcase_10 AC 36 ms
52,096 KB
testcase_11 AC 37 ms
52,892 KB
testcase_12 AC 36 ms
52,192 KB
testcase_13 AC 37 ms
52,364 KB
testcase_14 AC 36 ms
52,380 KB
testcase_15 AC 36 ms
52,756 KB
testcase_16 AC 37 ms
52,256 KB
testcase_17 AC 36 ms
52,192 KB
testcase_18 AC 37 ms
52,400 KB
testcase_19 AC 37 ms
54,432 KB
testcase_20 AC 37 ms
53,328 KB
testcase_21 AC 36 ms
52,448 KB
testcase_22 AC 36 ms
52,816 KB
testcase_23 AC 35 ms
52,892 KB
testcase_24 AC 35 ms
53,212 KB
testcase_25 AC 36 ms
53,288 KB
testcase_26 AC 37 ms
52,376 KB
testcase_27 AC 36 ms
53,264 KB
testcase_28 AC 37 ms
53,072 KB
testcase_29 AC 36 ms
52,520 KB
testcase_30 AC 36 ms
52,628 KB
testcase_31 AC 36 ms
52,748 KB
testcase_32 AC 37 ms
53,380 KB
testcase_33 AC 36 ms
53,088 KB
testcase_34 AC 37 ms
53,264 KB
testcase_35 AC 36 ms
52,608 KB
testcase_36 AC 36 ms
52,864 KB
testcase_37 AC 35 ms
53,852 KB
testcase_38 AC 36 ms
52,572 KB
testcase_39 AC 37 ms
52,588 KB
testcase_40 AC 36 ms
52,256 KB
testcase_41 AC 37 ms
52,268 KB
testcase_42 WA -
testcase_43 WA -
testcase_44 AC 36 ms
53,060 KB
testcase_45 AC 37 ms
54,136 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
K=input()
mod=10**9+7
ANS=0
t=pow(2,2*N,mod)
x=(pow(2,N-1,mod)-1)%mod
for i in range(8):
  if K[i]=='-':
    continue
  X=[(i&(1<<j))>>j for j in range(4)]
  Y=[X.count(0),X.count(1)]
  ANS+=t
  ANS+=x*pow(4,N-2,mod)*(Y[0]*Y[0]+Y[1]*Y[1])%mod
  ANS-=x*pow(4,N-2,mod)*(Y[0]*Y[1]+Y[1]*Y[0])%mod
  ANS+=pow(4,N,mod)*pow(2,N-1,mod)
print(ANS%mod)
0