結果

問題 No.2015 Stair Counter
ユーザー tailstails
提出日時 2022-07-22 22:55:47
言語 C90
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 541 bytes
コンパイル時間 774 ms
コンパイル使用メモリ 23,560 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-17 11:31:22
合計ジャッジ時間 1,409 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 1 ms
4,376 KB
testcase_12 AC 1 ms
4,376 KB
testcase_13 AC 1 ms
4,376 KB
testcase_14 AC 1 ms
4,376 KB
testcase_15 AC 1 ms
4,380 KB
testcase_16 AC 2 ms
4,380 KB
testcase_17 AC 1 ms
4,376 KB
testcase_18 AC 1 ms
4,376 KB
testcase_19 AC 2 ms
4,380 KB
testcase_20 AC 1 ms
4,380 KB
testcase_21 AC 1 ms
4,376 KB
testcase_22 AC 1 ms
4,380 KB
testcase_23 AC 1 ms
4,380 KB
testcase_24 AC 1 ms
4,376 KB
testcase_25 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:14:11: warning: multi-character character constant [-Wmultichar]
   ulong z='\nseY';
           ^~~~~~~
main.c:22:7: warning: multi-character character constant [-Wmultichar]
     z='\n oN';
       ^~~~~~~
main.c:30:2: warning: implicit declaration of function ‘write’ [-Wimplicit-function-declaration]
  write(1,wbuf,wp-wbuf);
  ^~~~~
main.c:31:2: warning: implicit declaration of function ‘_exit’ [-Wimplicit-function-declaration]
  _exit(0);
  ^~~~~
main.c:31:2: warning: incompatible implicit declaration of built-in function ‘_exit’

ソースコード

diff #

#define rd_skip_line() while(*rp++!=10)
#define rd() ({long _v=0,_c;while(_c=*rp++-48,_c>=0)_v=_v*10+_c;_v;})
#define rrep(v,e) for(long v=e;v--;)

typedef unsigned long ulong;
char wbuf[1<<25];

int main(){
	char*mmap();
	char*rp=mmap(0l,1l<<25,1,2,0,0ll);
	char*wp=wbuf;
	rd_skip_line();
	while(*rp){
		ulong z='\nseY';
		long n=rd();
		long m=rd();
		long b=rd();
		rrep(i,n-1){
			long a=rd();
			if(a+b<m){
				rd_skip_line();
				z='\n oN';
				break;
			}
			b=a;
		}
		*(ulong*)wp=z;
		wp+=4;
	}
	write(1,wbuf,wp-wbuf);
	_exit(0);
}
0