結果
| 問題 | No.346 チワワ数え上げ問題 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-06-29 10:08:45 |
| 言語 | Python3 (3.14.3 + numpy 2.4.2 + scipy 1.17.0) |
| 結果 |
AC
|
| 実行時間 | 112 ms / 2,000 ms |
| コード長 | 134 bytes |
| 記録 | |
| コンパイル時間 | 382 ms |
| コンパイル使用メモリ | 20,700 KB |
| 実行使用メモリ | 15,484 KB |
| 最終ジャッジ日時 | 2026-03-12 02:41:52 |
| 合計ジャッジ時間 | 4,441 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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)