結果
| 問題 | No.346 チワワ数え上げ問題 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-10-08 13:16:22 |
| 言語 | C++11(廃止可能性あり) (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 468 bytes |
| 記録 | |
| コンパイル時間 | 1,466 ms |
| コンパイル使用メモリ | 159,196 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-06 22:22:56 |
| 合計ジャッジ時間 | 2,400 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 2 |
| other | AC * 3 WA * 20 |
ソースコード
#include "bits/stdc++.h"
using namespace std;
typedef long long int ll;
int main(){
//階乗を前計算
string S;
cin >> S;
vector<ll > w;
ll ans = 0;
//後ろから選んだほうが早い..?
ll count = 0;
for(ll i = S.length(); i > 0; i--){
if(S[i] == 'c'){
ans += count * (count - 1) / 2;
count = 0;
}else if(S[i] == 'w'){
count++;
}
}
cout << ans << endl;
}