結果

問題 No.1410 A lot of Bit Operations
ユーザー googol_S0googol_S0
提出日時 2021-02-26 21:53:12
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 386 bytes
コンパイル時間 276 ms
コンパイル使用メモリ 82,852 KB
実行使用メモリ 54,480 KB
最終ジャッジ日時 2024-04-10 12:33:45
合計ジャッジ時間 3,164 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
52,232 KB
testcase_01 AC 37 ms
52,304 KB
testcase_02 AC 38 ms
52,928 KB
testcase_03 AC 37 ms
52,560 KB
testcase_04 AC 37 ms
53,464 KB
testcase_05 AC 37 ms
52,640 KB
testcase_06 AC 37 ms
52,928 KB
testcase_07 AC 36 ms
52,068 KB
testcase_08 AC 36 ms
53,856 KB
testcase_09 AC 37 ms
52,888 KB
testcase_10 AC 37 ms
52,740 KB
testcase_11 AC 36 ms
53,168 KB
testcase_12 AC 37 ms
53,784 KB
testcase_13 AC 37 ms
52,916 KB
testcase_14 AC 37 ms
52,200 KB
testcase_15 AC 38 ms
52,564 KB
testcase_16 AC 37 ms
53,272 KB
testcase_17 AC 38 ms
52,436 KB
testcase_18 AC 38 ms
52,132 KB
testcase_19 AC 36 ms
53,168 KB
testcase_20 AC 37 ms
52,772 KB
testcase_21 AC 36 ms
53,404 KB
testcase_22 AC 37 ms
53,144 KB
testcase_23 AC 37 ms
52,804 KB
testcase_24 AC 36 ms
52,880 KB
testcase_25 AC 36 ms
53,088 KB
testcase_26 AC 36 ms
53,352 KB
testcase_27 AC 37 ms
52,744 KB
testcase_28 AC 37 ms
53,068 KB
testcase_29 AC 37 ms
52,824 KB
testcase_30 AC 37 ms
53,384 KB
testcase_31 AC 36 ms
52,868 KB
testcase_32 AC 36 ms
52,012 KB
testcase_33 AC 38 ms
52,464 KB
testcase_34 AC 37 ms
53,096 KB
testcase_35 AC 38 ms
52,364 KB
testcase_36 AC 37 ms
53,124 KB
testcase_37 AC 37 ms
52,584 KB
testcase_38 AC 37 ms
52,920 KB
testcase_39 AC 37 ms
52,472 KB
testcase_40 AC 38 ms
52,564 KB
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 AC 36 ms
53,184 KB
testcase_45 AC 36 ms
52,628 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
K=input()
if N==0:
  print(1)
  exit()
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