結果

問題 No.2714 Amaou
ユーザー pengin_2000pengin_2000
提出日時 2024-04-05 21:34:31
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 1,073 bytes
コンパイル時間 1,294 ms
コンパイル使用メモリ 30,464 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2024-04-05 21:34:34
合計ジャッジ時間 1,415 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,676 KB
testcase_01 AC 1 ms
6,676 KB
testcase_02 AC 1 ms
6,676 KB
testcase_03 AC 1 ms
6,676 KB
testcase_04 AC 1 ms
6,676 KB
testcase_05 AC 1 ms
6,676 KB
testcase_06 AC 1 ms
6,676 KB
testcase_07 AC 1 ms
6,676 KB
testcase_08 AC 1 ms
6,676 KB
testcase_09 AC 1 ms
6,676 KB
testcase_10 AC 1 ms
6,676 KB
testcase_11 AC 1 ms
6,676 KB
testcase_12 AC 0 ms
6,676 KB
testcase_13 AC 1 ms
6,676 KB
testcase_14 AC 1 ms
6,676 KB
testcase_15 AC 1 ms
6,676 KB
testcase_16 AC 1 ms
6,676 KB
testcase_17 AC 1 ms
6,676 KB
testcase_18 AC 1 ms
6,676 KB
testcase_19 AC 0 ms
6,676 KB
testcase_20 AC 1 ms
6,676 KB
testcase_21 AC 1 ms
6,676 KB
testcase_22 AC 1 ms
6,676 KB
testcase_23 AC 1 ms
6,676 KB
testcase_24 AC 1 ms
6,676 KB
testcase_25 AC 1 ms
6,676 KB
testcase_26 AC 1 ms
6,676 KB
testcase_27 AC 1 ms
6,676 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:18:6: warning: conflicting types for built-in function 'strcpy'; expected 'char *(char *, const char *)' [-Wbuiltin-declaration-mismatch]
   18 | void strcpy(char s[], char t[])
      |      ^~~~~~
main.c:2:1: note: 'strcpy' is declared in header '<string.h>'
    1 | #include<stdio.h>
  +++ |+#include <string.h>
    2 | int strcmp(char s[], char t[])

ソースコード

diff #

#include<stdio.h>
int strcmp(char s[], char t[])
{
	for (int i = 0;; i++)
	{
		if (s[i] == '\0' && t[i] == '\0')
			return 0;
		if (s[i] == '\0')
			return -1;
		if (t[i] == '\0')
			return 1;
		if (s[i] < t[i])
			return -1;
		if (s[i] > t[i])
			return 1;
	}
}
void strcpy(char s[], char t[])
{
	int i;
	for (i = 0; s[i] != '\0'; i++)
		t[i] = s[i];
	t[i] = s[i];
	return;
}
char s[102][4][8];
int main()
{
	int n;
	scanf("%d", &n);
	int i, j, k;
	for (i = 0; i < n; i++)
	{
		for (j = 0; j < 4; j++)
			scanf("%s", s[i][j]);
		for (j = 0; j < 3; j++)
		{
			if (strcmp(s[i][j], s[i][j + 1]) > 0)
			{
				strcpy(s[i][j], s[n][0]);
				strcpy(s[i][j + 1], s[i][j]);
				strcpy(s[n][0], s[i][j + 1]);
				if (j > 0)
					j -= 2;
			}
		}
	}
	char A[8] = "akai", M[8] = "marui", O[8] = "okii", U[8] = "umai";
	int ans = 0;
	for (i = 0; i < n; i++)
	{
		if (strcmp(s[i][0], A) != 0)
			continue;
		if (strcmp(s[i][1], M) != 0)
			continue;
		if (strcmp(s[i][2], O) != 0)
			continue;
		if (strcmp(s[i][3], U) != 0)
			continue;
		ans++;
	}
	printf("%d\n", ans);
	return 0;
}
0