結果
| 問題 | No.346 チワワ数え上げ問題 |
| コンテスト | |
| ユーザー |
Konton7
|
| 提出日時 | 2019-05-02 23:54:13 |
| 言語 | Python3 (3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 52 ms / 2,000 ms |
| + 415µs | |
| コード長 | 341 bytes |
| 記録 | |
| コンパイル時間 | 55 ms |
| コンパイル使用メモリ | 15,104 KB |
| 実行使用メモリ | 15,488 KB |
| 最終ジャッジ日時 | 2026-10-09 23:18:33 |
| 合計ジャッジ時間 | 2,998 ms |
|
ジャッジサーバーID (参考情報) |
judge5_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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