結果
| 問題 |
No.346 チワワ数え上げ問題
|
| コンテスト | |
| ユーザー |
rocoder
|
| 提出日時 | 2017-07-07 02:52:43 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 736 bytes |
| コンパイル時間 | 222 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 12,264 KB |
| 最終ジャッジ日時 | 2024-10-06 04:04:49 |
| 合計ジャッジ時間 | 2,407 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 22 RE * 1 |
ソースコード
S=list(input())
i=0
while i<len(S)-1:
# 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
i+=1
#print (Co)
Sc=0
if len(Co)>1:
St=len(Co)
if len(Co)%2==1:
St-=1
Nw=0
if St>2 and Co[St-1]==1 :
Nw+=1
St-=2
while St>1:
Nw+=Co[St-1]
Nw1=Nw-1
Nw1*=Nw
Nw1//=2
Sc+=Nw1*Co[St-2]
St-=2
print (Sc)
rocoder