結果

問題 No.346 チワワ数え上げ問題
ユーザー rocoder
提出日時 2017-06-25 06:05:54
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
実行時間 -
コード長 642 bytes
コンパイル時間 95 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 24,128 KB
最終ジャッジ日時 2024-10-04 08:17:08
合計ジャッジ時間 6,633 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample -- * 3
other TLE * 1 -- * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

S=list(input())
i=0
while i<len(S)-3:
  #  print (S)
    if S[i]=="c":
   #     print (i)
        Co=[]
        while i<len(S):
    #        print (i)
            cc=0
            while i<len(S) and S[i]!="w":
                if S[i]=="c":
                    cc+=1
                i+=1
            Co.append(cc)
            cw=0
            while i<len(S) and S[i]!="c":
                if S[i]=="w":
                    cw+=1
                i+=1
            Co.append(cw)
        i+=1
#rint (Co)
Sc=0
if len(Co)>1:
    St=len(Co)
    if len(Co)%2==1:
        St-=1
Nw=0
while St>1:
    Nw+=Co[St-1]
    Sc+=Nw*Co[St-2]
    St-=2
print (Sc)
0