結果

問題 No.3110 Like CPCTF?
ユーザー Daniel Agatan
提出日時 2025-04-19 00:20:29
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 40 ms / 2,000 ms
コード長 544 bytes
コンパイル時間 250 ms
コンパイル使用メモリ 11,904 KB
実行使用メモリ 10,496 KB
最終ジャッジ日時 2025-04-19 00:20:31
合計ジャッジ時間 1,597 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
s = input()
result = 0

n = len(s)
for i in range(n):
    for j in range(i + 1, n):
        if s[i] == s[j]:
            continue
        for k in range(j + 1, n):
            if s[i] != s[k] or s[j] == s[k]:
                continue
            for l in range(k + 1, n):
                if s[l] in (s[i], s[j], s[k]):
                    continue
                for m in range(l + 1, n):
                    if s[m] in (s[i], s[j], s[k], s[l]):
                        continue
                    result += 1

print(result)
0