結果
問題 | No.706 多眼生物の調査 |
ユーザー |
|
提出日時 | 2018-07-04 21:23:18 |
言語 | C (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 437 bytes |
コンパイル時間 | 292 ms |
コンパイル使用メモリ | 29,312 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-01 02:16:57 |
合計ジャッジ時間 | 880 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 5 |
コンパイルメッセージ
main.c: In function 'main': main.c:13:29: warning: passing argument 1 of 'strlen' from incompatible pointer type [-Wincompatible-pointer-types] 13 | eyes[strlen(creature) - 2]++; | ^~~~~~~~ | | | int * In file included from main.c:3: /usr/include/string.h:407:35: note: expected 'const char *' but argument is of type 'int *' 407 | extern size_t strlen (const char *__s) | ~~~~~~~~~~~~^~~
ソースコード
#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;}