結果

問題 No.145 yukiover
ユーザー OnjuOnju
提出日時 2015-02-05 23:57:02
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,032 bytes
コンパイル時間 1,017 ms
コンパイル使用メモリ 58,572 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-05 13:16:22
合計ジャッジ時間 3,714 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <climits>
#include <cstring>
#include <string>
#define N_MAX 10000
using namespace std;

int kai(int n)
{
	if (n > 0)
		return n *kai(n - 1);
	else
		return 1;
}

int main()
{
	int N, ans = 0;
	char S[N_MAX];
	cin >> N >> S;

	//ごり押してみる
	for (int i = 0; i < N; ++i)
	{
		if (S[i] > 'y')
		{
			++ans;
			S[i] = 0;
		}
		else if (S[i] == 'y')
			for (int j = 0; j < N; ++j)
			{
				if (j == i)
					continue;
				else if (S[j] > 'u')
				{
					++ans;
					S[j] = S[i] = 0;
				}
				else if (S[j] == 'u')
					for (int k = 0; k < N; ++k)
					{
						if (k == i || k == j)
							continue;
						else if (S[k] > 'k')
						{
							++ans;
							S[k] = S[j] = S[i] = 0;
						}
						else if (S[k] == 'k')
							for (int l = 0; l < N; ++l)
							{
								if (l == i || l == j || l == k)
									continue;
								else if (S[l] > 'i')
								{
									++ans;
									S[l] = S[k] = S[j] = S[i] = 0;
								}
							}
					}

			}
	}

	cout << ans;

	return 0;
}
0