結果

問題 No.2021 Not A but B
ユーザー shotoyooshotoyoo
提出日時 2023-08-04 00:13:11
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 250 ms / 2,000 ms
コード長 837 bytes
コンパイル時間 209 ms
コンパイル使用メモリ 82,560 KB
実行使用メモリ 113,200 KB
最終ジャッジ日時 2024-04-21 22:48:51
合計ジャッジ時間 5,675 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 46 ms
54,272 KB
testcase_01 AC 47 ms
53,888 KB
testcase_02 AC 47 ms
53,888 KB
testcase_03 AC 47 ms
54,016 KB
testcase_04 AC 47 ms
54,016 KB
testcase_05 AC 46 ms
53,632 KB
testcase_06 AC 46 ms
54,016 KB
testcase_07 AC 46 ms
53,888 KB
testcase_08 AC 205 ms
97,460 KB
testcase_09 AC 204 ms
97,296 KB
testcase_10 AC 202 ms
97,500 KB
testcase_11 AC 201 ms
96,948 KB
testcase_12 AC 200 ms
97,448 KB
testcase_13 AC 199 ms
97,032 KB
testcase_14 AC 203 ms
97,336 KB
testcase_15 AC 200 ms
97,304 KB
testcase_16 AC 202 ms
96,844 KB
testcase_17 AC 200 ms
96,932 KB
testcase_18 AC 203 ms
97,272 KB
testcase_19 AC 206 ms
97,100 KB
testcase_20 AC 206 ms
97,108 KB
testcase_21 AC 82 ms
77,312 KB
testcase_22 AC 73 ms
72,576 KB
testcase_23 AC 71 ms
72,064 KB
testcase_24 AC 65 ms
66,560 KB
testcase_25 AC 77 ms
72,320 KB
testcase_26 AC 98 ms
78,720 KB
testcase_27 AC 240 ms
111,024 KB
testcase_28 AC 236 ms
111,476 KB
testcase_29 AC 250 ms
113,200 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys, random
input = lambda : sys.stdin.readline().rstrip()


write = lambda x: sys.stdout.write(x+"\n"); writef = lambda x: print("{:.12f}".format(x))
debug = lambda x: sys.stderr.write(x+"\n")
YES="Yes"; NO="No"; pans = lambda v: print(YES if v else NO); INF=10**18
LI = lambda : list(map(int, input().split())); II=lambda : int(input()); SI=lambda : [ord(c)-ord("a") for c in input()]
def debug(_l_):
    for s in _l_.split():
        print(f"{s}={eval(s)}", end=" ")
    print()
def dlist(*l, fill=0):
    if len(l)==1:
        return [fill]*l[0]
    ll = l[1:]
    return [dlist(*ll, fill=fill) for _ in range(l[0])]

n = int(input())
s = [int(c=="B") for c in input()]
l = set()
for i in range(n-1):
    tmp = set()
    for j in (i, i+1):
        if s[j]==0:
            tmp.add(j)
    l.add(tuple(sorted(tmp)))
print(len(l))
0