結果
| 問題 | No.346 チワワ数え上げ問題 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-03-13 04:57:49 |
| 言語 | PyPy3 (7.3.23 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 34 ms / 2,000 ms |
| + 943µs | |
| コード長 | 191 bytes |
| 記録 | |
| コンパイル時間 | 119 ms |
| コンパイル使用メモリ | 81,152 KB |
| 実行使用メモリ | 67,712 KB |
| 最終ジャッジ日時 | 2026-09-17 03:29:59 |
| 合計ジャッジ時間 | 2,774 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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)