結果

問題 No.1425 Yet Another Cyclic Shifts Sorting
コンテスト
ユーザー 👑 tails
提出日時 2021-03-15 11:43:26
言語 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
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 737 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 74 ms
コンパイル使用メモリ 28,056 KB
最終ジャッジ日時 2026-02-22 06:58:45
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。

コンパイルメッセージ
main.c:7:1: error: return type defaults to 'int' [-Wimplicit-int]
    7 | main(){
      | ^~~~
main.c: In function 'main':
main.c:8:17: error: too many arguments to function 'mmap'; expected 0, have 6
    8 |         char*rp=mmap(0l,1l<<28,1,2,0,0ll);
      |                 ^~~~ ~~
main.c:4:6: note: declared here
    4 | char*mmap();
      |      ^~~~
main.c:18:33: error: implicit declaration of function 'write' [-Wimplicit-function-declaration]
   18 |                                 write(1,"2",1);
      |                                 ^~~~~
main.c:19:33: error: implicit declaration of function '_exit' [-Wimplicit-function-declaration]
   19 |                                 _exit(0);
      |                                 ^~~~~
main.c:19:33: warning: incompatible implicit declaration of built-in function '_exit' [-Wbuiltin-declaration-mismatch]
main.c:29:9: warning: incompatible implicit declaration of built-in function '_exit' [-Wbuiltin-declaration-mismatch]
   29 |         _exit(0);
      |         ^~~~~

ソースコード

diff #
raw source code

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

char*mmap();
#define RD(v) int v=0;{int _c;while(_c=*rp++-48,_c>=0)v=v*10+_c;}

main(){
	char*rp=mmap(0l,1l<<28,1,2,0,0ll);
	RD(n);
	--n;
	RD(c);
	int b=c,d;
	while(n){
		--n;
		RD(a);
		if(a<b){
			if(a>c){
				write(1,"2",1);
				_exit(0);
			}else{
				d=b;
				b=a;
				goto l1;
			}
		}
		b=a;
	}
	write(1,"0",1);
	_exit(0);

	l1:;
	while(n){
		--n;
		RD(a);
		if(a<b){
			write(1,"2",1);
			_exit(0);
		}
		if(a>c){
			if(a<d){
				write(1,"2",1);
				_exit(0);
			}else{
				b=a;
				goto l2;
			}
		}
		b=a;
	}while(*rp);
	write(1,"1",1);
	_exit(0);

	l2:;
	while(n){
		--n;
		RD(a);
		if(a<b){
			write(1,"2",1);
			_exit(0);
		}
		b=a;
	}
	write(1,"1",1);
	_exit(0);
}
0