結果

問題 No.558 575検出するやつ
ユーザー bal4ubal4u
提出日時 2019-04-20 13:27:24
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 566 bytes
コンパイル時間 121 ms
コンパイル使用メモリ 29,184 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2024-04-08 13:25:16
合計ジャッジ時間 1,030 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 2 ms
6,676 KB
testcase_10 AC 1 ms
6,676 KB
testcase_11 AC 1 ms
6,676 KB
testcase_12 AC 1 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 1 ms
6,676 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function 'ins':
main.c:8:14: warning: implicit declaration of function 'getchar_unlocked' [-Wimplicit-function-declaration]
    8 | #define gc() getchar_unlocked()
      |              ^~~~~~~~~~~~~~~~
main.c:15:17: note: in expansion of macro 'gc'
   15 |         do *s = gc();
      |                 ^~

ソースコード

diff #

// yukicoder: No.558 575検出するやつ
// 2019.4.20 bal4u

#include <stdio.h>

//// 高速入力
#if 1
#define gc() getchar_unlocked()
#else
#define gc() getchar()
#endif
int ins(char *s)  // 文字列の入力 スペース以下の文字で入力終了
{
	char *p = s;
	do *s = gc();
	while (*s++ > ' ');
	*--s = 0;
	return s - p;
}

char *a[] = { "NO", "YES" };
char S[105];

int main()
{
	int i, w, ans = 0;
	w = ins(S);
	for (i = 2; i < w; i++) {
		if (S[i-2] == '5' && S[i-1] == '7' && S[i] == '5') {
			ans = 1; break;
		}
	}
	puts(a[ans]);
	return 0;
}
0