結果

問題 No.346 チワワ数え上げ問題
ユーザー cwwcww
提出日時 2016-07-11 12:27:09
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 488 bytes
コンパイル時間 1,978 ms
コンパイル使用メモリ 162,808 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-04-21 12:27:15
合計ジャッジ時間 4,960 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
8,576 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 3 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 4 ms
5,376 KB
testcase_10 TLE -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define REP(i,n) for(int i=0; i<(n); i++)
#define REP2(i,x,n) for(int i=x; i<(n); i++)
using namespace std;
int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	string S;
	cin >> S;
	int count{};
	REP( i, (int)S.size() )
	{
		if( S[i] == 'c' )
		{
			REP2( j, i + 1, (int)S.size() )
			{
				REP2( k, j, (int)S.size() )
				{
					if( S[j] == 'w' && S[k] == 'w' && j != k )
					{
						count++;
					}
				}
			}
		}
	}
	cout << count << endl;
	return 0;
}
0