結果

問題 No.346 チワワ数え上げ問題
ユーザー cocolleague
提出日時 2017-01-29 01:55:49
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 293 bytes
コンパイル時間 1,594 ms
コンパイル使用メモリ 159,784 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-12-23 22:34:25
合計ジャッジ時間 3,038 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 2
other AC * 3 WA * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main(void){
	string S;
	cin >> S;
	long long  ans = 0;
	long long   w = 0;
	for(unsigned int i = 0;i<S.length();i++){
		if(S[i] == 'w') w++;
        if(S[i] == 'c') ans = w * (w-1) / 2;
    	}
    	cout << ans << endl;
    	return 0;	
    }

0