結果

問題 No.349 干支の置き物
コンテスト
ユーザー pengin_2000
提出日時 2020-02-22 00:09:06
言語 C(gnu17)
(gcc 15.2.0)
コンパイル:
gcc-15 -O2 -std=gnu17 -Wno-error=implicit-function-declaration -Wno-error=implicit-int -Wno-error=incompatible-pointer-types -Wno-error=int-conversion -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
WA  
実行時間 -
コード長 488 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 187 ms
コンパイル使用メモリ 38,468 KB
最終ジャッジ日時 2026-02-22 05:21:53
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 26 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include<stdio.h>
#include<string.h>
int main()
{
	char t[12][20] = { "ne","ushi","tora","u","tatsu","mi","uma","hitsuji","saru","tori","inu","i" };
	int n;
	scanf("%d", &n);
	int i, j;
	char a[20];
	int c[12];
	for (i = 0; i < 12; i++)
		c[i] = 0;
	for (i = 0; i < n; i++)
	{
		scanf("%s", a);
		for (j = 0; j < 12; j++)
			if (strcmp(t[j], a) == 0)
				c[j]++;
	}
	for (i = 0; i < 12; i++)
	{
		if (c[i] * 2 > n)
		{
			printf("NO\n");
			return 0;
		}
	}
	printf("YES\n");
	return 0;
}
0