結果
問題 | No.346 チワワ数え上げ問題 |
ユーザー | irumo8202 |
提出日時 | 2022-01-23 18:16:35 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 56 ms / 2,000 ms |
コード長 | 171 bytes |
コンパイル時間 | 153 ms |
コンパイル使用メモリ | 82,376 KB |
実行使用メモリ | 73,216 KB |
最終ジャッジ日時 | 2024-11-29 21:45:45 |
合計ジャッジ時間 | 2,062 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 23 |
ソースコード
S = [x for x in input() if x == "c" or x == "w"] ans = 0 w = 0 for s in S[::-1]: if s == "w": w += 1 else: ans += (w * (w - 1)) // 2 print(ans)