結果

問題 No.2402 Dirty Stairs and Shoes
ユーザー tails
提出日時 2023-08-04 23:22:58
言語 C90
(gcc 12.3.0)
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 894 bytes
コンパイル時間 92 ms
コンパイル使用メモリ 26,752 KB
最終ジャッジ日時 2025-03-23 03:13:49
合計ジャッジ時間 1,025 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。

コンパイルメッセージ
main.c: In function 'main':
main.c:22:21: error: expected ';' before 'i'
   22 |                 rep(i,m){
      |                     ^
main.c:6:32: note: in definition of macro 'rep'
    6 | #define rep(v,e) for(typeof(e) v=0;v<e;++v)
      |                                ^
main.c:22:21: error: 'i' undeclared (first use in this function)
   22 |                 rep(i,m){
      |                     ^
main.c:6:36: note: in definition of macro 'rep'
    6 | #define rep(v,e) for(typeof(e) v=0;v<e;++v)
      |                                    ^
main.c:22:21: note: each undeclared identifier is reported only once for each function it appears in
   22 |                 rep(i,m){
      |                     ^
main.c:6:36: note: in definition of macro 'rep'
    6 | #define rep(v,e) for(typeof(e) v=0;v<e;++v)
      |                                    ^
main.c:29:21: error: expected ';' before 'i'
   29 |                 rep(i,m){
      |                     ^
main.c:6:32: note: in definition of macro 'rep'
    6 | #define rep(v,e) for(typeof(e) v=0;v<e;++v)
      |                                ^
main.c:36:15: error: expected ';' before 'i'
   36 |         rrep3(i,n-k+1,n){
      |               ^
main.c:8:36: note: in definition of macro 'rrep3'
    8 | #define rrep3(v,s,e) for(typeof(e) v=e;--v>=s;)
      |                                    ^
main.c:47:14: error: expected ';' before 'i'
   47 |         rrep(i,n-k+1){
      |              ^
main.c:7:33: note: in definition of macro 'rrep'
    7 | #define rrep(v,e) for(typeof(e) v=e;v--;)
      |                                 ^

ソースコード

diff #

#pragma GCC optimize("Ofast")
#pragma GCC target("avx2")

#define rd_init() char*rp=({char*mmap();mmap(0l,1l<<25,1,2,0,0ll);})
#define rd() ({int _v=0,_c;while(_c=*rp++-48,_c>=0)_v=_v*10+_c;_v;})
#define rep(v,e) for(typeof(e) v=0;v<e;++v)
#define rrep(v,e) for(typeof(e) v=e;v--;)
#define rrep3(v,s,e) for(typeof(e) v=e;--v>=s;)

char a[400000];

int main(){
	rd_init();
	int n=rd();
	int k=rd();
	{
		int m=rd();
		if(m==0){
			write(1,"Yes",3);
			_exit(0);
		}
		rep(i,m){
			int x=rd();
			a[x]=-1;
		}
	}
	{
		int m=rd();
		rep(i,m){
			int x=rd();
			a[x]=1;
		}
	}
	a[0]=1;
	a[n]=1;
	rrep3(i,n-k+1,n){
		if(a[i]>=0&a[i+1]){
			if(a[i]){
				write(1,"Yes",3);
				_exit(0);
			}
			a[i]=1;
		}else{
			a[i]=0;
		}
	}
	rrep(i,n-k+1){
		if(a[i]>=0&(a[i+1]|a[i+k])){
			if(a[i]){
				write(1,"Yes",3);
				_exit(0);
			}
			a[i]=1;
		}else{
			a[i]=0;
		}
	}
	write(1,"No",2);
	_exit(0);
}
0