結果

問題 No.558 575検出するやつ
ユーザー bal4ubal4u
提出日時 2019-04-20 13:27:24
言語 C
(gcc 13.3.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 566 bytes
コンパイル時間 216 ms
コンパイル使用メモリ 28,672 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-01 06:38:50
合計ジャッジ時間 913 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 5
other AC * 15
権限があれば一括ダウンロードができます
コンパイルメッセージ
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