結果

問題 No.346 チワワ数え上げ問題
ユーザー Nagisa
提出日時 2016-02-27 03:08:50
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
実行時間 -
コード長 508 bytes
コンパイル時間 295 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 48,544 KB
最終ジャッジ日時 2024-09-24 11:01:21
合計ジャッジ時間 7,171 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample -- * 3
other AC * 10 TLE * 1 -- * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

S = input()
c = []
w1 = []
w2 = []

for k in range(len(S)):
    if S[k] == "c":
        c.append(k)

for l in c:
    for m in range(l+1,len(S)):
        if S[m] == "w":
            w1.append(m)

for l in w1:
    for m in range(l+1,len(S)):
        if S[m] == "w":
            w2.append(m)

c = set(c)
w1 = set(w1)
w2 = set(w2)

ans = []
for p in c:
    for q in w1:
        for r in w2:
            if p < q < r:
                if [p,q,r] not in ans:
                    ans.append([p,q,r])

print(len(ans))
0