結果
| 問題 | No.346 チワワ数え上げ問題 |
| コンテスト | |
| ユーザー |
nohakai3
|
| 提出日時 | 2022-10-31 15:12:55 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 29 ms / 2,000 ms |
| コード長 | 148 bytes |
| 記録 | |
| コンパイル時間 | 504 ms |
| コンパイル使用メモリ | 85,596 KB |
| 実行使用メモリ | 59,648 KB |
| 最終ジャッジ日時 | 2026-03-29 21:07:49 |
| 合計ジャッジ時間 | 2,370 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 23 |
ソースコード
s=input()
n=len(s)
cnt=0
ans=0
for i in range(n-1,-1,-1):
if s[i]=="w":
cnt+=1
if s[i]=="c":
ans+=cnt*(cnt-1)//2
print(ans)
nohakai3