結果

問題 No.1410 A lot of Bit Operations
ユーザー googol_S0googol_S0
提出日時 2021-02-26 21:56:03
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 631 bytes
コンパイル時間 180 ms
コンパイル使用メモリ 82,520 KB
実行使用メモリ 53,876 KB
最終ジャッジ日時 2024-04-10 12:36:11
合計ジャッジ時間 3,216 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
53,376 KB
testcase_01 AC 35 ms
53,356 KB
testcase_02 AC 34 ms
53,664 KB
testcase_03 AC 35 ms
53,088 KB
testcase_04 AC 35 ms
52,756 KB
testcase_05 AC 36 ms
52,064 KB
testcase_06 AC 34 ms
52,804 KB
testcase_07 AC 35 ms
52,688 KB
testcase_08 AC 34 ms
53,376 KB
testcase_09 AC 34 ms
52,668 KB
testcase_10 AC 35 ms
53,160 KB
testcase_11 AC 34 ms
53,076 KB
testcase_12 AC 35 ms
53,184 KB
testcase_13 AC 34 ms
53,332 KB
testcase_14 AC 35 ms
53,476 KB
testcase_15 AC 36 ms
53,200 KB
testcase_16 AC 35 ms
52,944 KB
testcase_17 AC 35 ms
53,352 KB
testcase_18 AC 34 ms
53,260 KB
testcase_19 AC 34 ms
52,688 KB
testcase_20 AC 34 ms
52,564 KB
testcase_21 AC 34 ms
53,152 KB
testcase_22 AC 33 ms
53,172 KB
testcase_23 AC 34 ms
52,380 KB
testcase_24 AC 34 ms
52,620 KB
testcase_25 AC 35 ms
53,488 KB
testcase_26 AC 32 ms
53,372 KB
testcase_27 AC 35 ms
53,784 KB
testcase_28 AC 35 ms
53,816 KB
testcase_29 AC 34 ms
53,668 KB
testcase_30 AC 33 ms
52,904 KB
testcase_31 AC 35 ms
53,252 KB
testcase_32 AC 36 ms
53,876 KB
testcase_33 AC 36 ms
53,476 KB
testcase_34 AC 37 ms
52,216 KB
testcase_35 AC 36 ms
52,668 KB
testcase_36 AC 35 ms
53,256 KB
testcase_37 AC 35 ms
52,700 KB
testcase_38 AC 34 ms
52,320 KB
testcase_39 AC 35 ms
52,740 KB
testcase_40 AC 35 ms
52,696 KB
testcase_41 AC 34 ms
52,572 KB
testcase_42 WA -
testcase_43 WA -
testcase_44 AC 34 ms
52,736 KB
testcase_45 AC 34 ms
52,724 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
K=input()
if N==1:
  ANS=0
  for i in range(8):
    if K[i]=='-':
      continue
    X=[(i&(1<<j))>>j for j in range(4)]
    for x in range(2):
      for y in range(2):
        for z in range(2):
          if (X[x*2+y]-z)*((1-X[x*2+y])-z)<=0:
            ANS+=1
  print(ANS)
  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