結果

問題 No.706 多眼生物の調査
ユーザー N/AN/A
提出日時 2018-07-04 21:23:18
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 437 bytes
コンパイル時間 1,083 ms
コンパイル使用メモリ 28,076 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-13 17:35:48
合計ジャッジ時間 989 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 0 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 3 ms
4,376 KB
testcase_07 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: 関数 ‘main’ 内:
main.c:13:29: 警告: 互換性のないポインタ型から 1 番目の ‘strlen’ の引数に渡しています [-Wincompatible-pointer-types]
   13 |                 eyes[strlen(creature) - 2]++;
      |                             ^~~~~~~~
      |                             |
      |                             int *
次のファイルから読み込み:  main.c:3:
/usr/include/string.h:385:35: 備考: expected ‘const char *’ but argument is of type ‘int *’
  385 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~

ソースコード

diff #

#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>

int main(void) {
	int freq, creature[1000], eyes[1001] = { 0 };
	int i, j, blind = 0, mode;

	scanf("%d", &freq);

	for (i = 0; i < freq; i++) {
		scanf("%s", &creature);
		eyes[strlen(creature) - 2]++;
	}

	for (j = 0; j < 1001; j++) {
		if (blind <= eyes[j]) {
			blind = eyes[j];
			mode = j;
		}
	}

	printf("%d\n", mode);

	return 0;
}
0