結果

問題 No.547 未知の言語
ユーザー bal4ubal4u
提出日時 2019-04-18 18:06:06
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 616 bytes
コンパイル時間 579 ms
コンパイル使用メモリ 30,044 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-23 16:14:01
合計ジャッジ時間 2,368 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 AC 1 ms
4,348 KB
testcase_03 AC 1 ms
4,348 KB
testcase_04 AC 1 ms
4,348 KB
testcase_05 AC 1 ms
4,348 KB
testcase_06 AC 1 ms
4,348 KB
testcase_07 AC 1 ms
4,348 KB
testcase_08 AC 1 ms
4,348 KB
testcase_09 AC 1 ms
4,348 KB
testcase_10 AC 1 ms
4,348 KB
testcase_11 AC 1 ms
4,348 KB
testcase_12 AC 1 ms
4,348 KB
testcase_13 AC 1 ms
4,348 KB
testcase_14 AC 1 ms
4,348 KB
testcase_15 AC 1 ms
4,348 KB
testcase_16 AC 1 ms
4,348 KB
testcase_17 AC 1 ms
4,348 KB
testcase_18 AC 1 ms
4,348 KB
testcase_19 AC 1 ms
4,348 KB
testcase_20 AC 1 ms
4,348 KB
testcase_21 AC 1 ms
4,348 KB
testcase_22 AC 1 ms
4,348 KB
testcase_23 AC 1 ms
4,348 KB
testcase_24 AC 1 ms
4,348 KB
testcase_25 AC 1 ms
4,348 KB
testcase_26 AC 1 ms
4,348 KB
testcase_27 AC 1 ms
4,348 KB
testcase_28 AC 1 ms
4,348 KB
testcase_29 AC 1 ms
4,348 KB
testcase_30 AC 1 ms
4,348 KB
testcase_31 AC 1 ms
4,348 KB
testcase_32 AC 1 ms
4,348 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:25:17: warning: data definition has no type or storage class
   25 | char s[12][25]; len[12];
      |                 ^~~
main.c:25:17: warning: type defaults to 'int' in declaration of 'len' [-Wimplicit-int]

ソースコード

diff #

// yukicoder: No.547 未知の言語
// 2019.4.18 bal4u

#include <stdio.h>
#include <ctype.h>
#include <string.h>

#define gc() getchar()
int in()
{
	int n = 0, c = gc();
	do n = 10 * n + (c & 0xf), c = gc(); while (c >= '0');
	return n;
}

int ins(char *s)
{
	char *p = s;
	do *s = gc();
	while (*s++ > ' ');
	*--s = 0;
	return s - p;
}

char s[12][25]; len[12];
char t[25];

int main()
{
	int i, w, N;
	
	N = in(); for (i = 0; i < N; i++) len[i] = ins(s[i]);
	for (i = 0; i < N; i++) {
		w = ins(t);
		if (w != len[i] || memcmp(t, s[i], w)) {
			printf("%d\n%s\n%s\n", i+1, s[i], t);
			break;
		}
	}
	return 0;
}
0