結果
| 問題 |
No.346 チワワ数え上げ問題
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-03-13 04:57:49 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 44 ms / 2,000 ms |
| コード長 | 191 bytes |
| コンパイル時間 | 1,542 ms |
| コンパイル使用メモリ | 81,392 KB |
| 実行使用メモリ | 66,204 KB |
| 最終ジャッジ日時 | 2024-10-14 17:21:51 |
| 合計ジャッジ時間 | 3,027 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 23 |
ソースコード
S = input()
#print(S)
c = 0
w = 0
ans = 0
for s in S[::-1]:
if s == "c":
c += 1
ans += w*(w-1)//2
#print(ans)
if s == "w":
w += 1
print(ans)