結果
| 問題 |
No.346 チワワ数え上げ問題
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-06-29 10:08:45 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 56 ms / 2,000 ms |
| コード長 | 134 bytes |
| コンパイル時間 | 94 ms |
| コンパイル使用メモリ | 12,800 KB |
| 実行使用メモリ | 11,008 KB |
| 最終ジャッジ日時 | 2024-06-25 17:27:04 |
| 合計ジャッジ時間 | 2,209 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 23 |
ソースコード
S = input()[::-1]
ans = Nw = 0
for s in S:
if s == 'w':
Nw += 1
if s == 'c':
ans += Nw*(Nw-1)//2
print(ans)