結果
| 問題 | No.346 チワワ数え上げ問題 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-02-26 23:07:23 |
| 言語 | Python3 (3.15.2 + numpy 2.5.4 + scipy 1.18.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 24 ms / 2,000 ms |
| + 926µs | |
| コード長 | 207 bytes |
| 記録 | |
| コンパイル時間 | 50 ms |
| コンパイル使用メモリ | 14,848 KB |
| 実行使用メモリ | 10,368 KB |
| 最終ジャッジ日時 | 2026-10-29 16:23:51 |
| 合計ジャッジ時間 | 2,074 ms |
|
ジャッジサーバーID (参考情報) |
judge5_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 24 |
ソースコード
def solve(S):
w = 0
count = 0
for s in S[::-1]:
if s == 'w':
w += 1
elif s == 'c':
count += w * (w - 1) // 2
return count
S = input()
print(solve(S))