結果

問題 No.2815 Smaller than all
コンテスト
ユーザー 👑 tails
提出日時 2024-07-21 02:00:55
言語 C(gnu17)
(gcc 15.2.0)
コンパイル:
gcc-15 -O2 -std=gnu17 -Wno-error=implicit-function-declaration -Wno-error=implicit-int -Wno-error=incompatible-pointer-types -Wno-error=int-conversion -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
AC  
実行時間 4 ms / 2,000 ms
コード長 551 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 388 ms
コンパイル使用メモリ 38,812 KB
実行使用メモリ 7,848 KB
最終ジャッジ日時 2026-02-23 15:45:29
合計ジャッジ時間 3,230 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 33
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function 'main':
main.c:7:59: warning: implicit declaration of function 'write' [-Wimplicit-function-declaration]
    7 | #define wt1(v) ({char wbuf[64],*wp=wbuf+sizeof wbuf;wt(v);write(1,wp,wbuf+sizeof wbuf-wp);})
      |                                                           ^~~~~
main.c:22:9: note: in expansion of macro 'wt1'
   22 |         wt1(b);
      |         ^~~
main.c:23:9: warning: implicit declaration of function '_exit' [-Wimplicit-function-declaration]
   23 |         _exit(0);
      |         ^~~~~
main.c:23:9: warning: incompatible implicit declaration of built-in function '_exit' [-Wbuiltin-declaration-mismatch]

ソースコード

diff #
raw source code

#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 wt(v) ({unsigned _z=v;do*--wp=_z%10+48;while(_z/=10);})
#define wt1(v) ({char wbuf[64],*wp=wbuf+sizeof wbuf;wt(v);write(1,wp,wbuf+sizeof wbuf-wp);})
#define times(e) for(typeof(e)_=e;_--;)

int main(){
	rd_init();
	int n=rd();
	int a=1<<30;
	int b=0;
	times(n){
		int x=rd();
		if(a<x) break;
		if(a>x) b=0;
		++b;
		a=x;
	}
	wt1(b);
	_exit(0);
}
0