結果
| 問題 |
No.346 チワワ数え上げ問題
|
| コンテスト | |
| ユーザー |
Konton7
|
| 提出日時 | 2019-05-02 23:54:13 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 91 ms / 2,000 ms |
| コード長 | 341 bytes |
| コンパイル時間 | 416 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 15,232 KB |
| 最終ジャッジ日時 | 2024-12-31 13:55:22 |
| 合計ジャッジ時間 | 2,873 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 23 |
ソースコード
s = input()
ls = len(s)
c_list = []
w_counter = 0
for i in range(ls):
if s[ls-i-1] == "c":
c_list.append(w_counter)
elif s[ls-i-1] == "w":
w_counter += 1
sum_list = [0]
for i in range(w_counter+1):
sum_list.append(sum_list[-1]+i)
c_list = [ sum_list[c_list[i]] for i in range(len(c_list))]
print(sum(c_list))
Konton7