結果

問題 No.2092 Conjugation
コンテスト
ユーザー 👑 tails
提出日時 2022-10-07 22:59:01
言語 C90
(gcc 15.2.0)
コンパイル:
gcc-15 -O2 -std=c90 -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 599 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 248 ms
コンパイル使用メモリ 26,420 KB
最終ジャッジ日時 2026-02-24 01:10:17
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。

コンパイルメッセージ
main.c: In function 'main':
main.c:6:18: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
    6 | #define rep(v,e) for(long v=0;v<e;++v)
      |                  ^~~
main.c:18:9: note: in expansion of macro 'rep'
   18 |         rep(i,n){
      |         ^~~
main.c:6:18: note: use option '-std=c99', '-std=gnu99', '-std=c11' or '-std=gnu11' to compile your code
    6 | #define rep(v,e) for(long v=0;v<e;++v)
      |                  ^~~
main.c:18:9: note: in expansion of macro 'rep'
   18 |         rep(i,n){
      |         ^~~
main.c:6:18: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
    6 | #define rep(v,e) for(long v=0;v<e;++v)
      |                  ^~~
main.c:22:9: note: in expansion of macro 'rep'
   22 |         rep(j,a[0]){
      |         ^~~
main.c:28:14: error: redefinition of 'j'
   28 |         rrep(j,a[0]){
      |              ^
main.c:7:28: note: in definition of macro 'rrep'
    7 | #define rrep(v,e) for(long v=e;v--;)
      |                            ^
main.c:22:13: note: previous definition of 'j' with type 'long int'
   22 |         rep(j,a[0]){
      |             ^
main.c:6:27: note: in definition of macro 'rep'
    6 | #define rep(v,e) for(long v=0;v<e;++v)
      |                           ^
main.c:7:19: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
    7 | #define rrep(v,e) for(long v=e;v--;)
      |                   ^~~
main.c:28:9: note: in expansion of macro 'rrep'
   28 |         rrep(j,a[0]){
      |         ^~~~

ソースコード

diff #
raw source code

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

#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 rep(v,e) for(long v=0;v<e;++v)
#define rrep(v,e) for(long v=e;v--;)

char wbuf[1<<25];

int a[100000];
int b[100000];

int main(){
	char*mmap();
	char*rp=mmap(0l,1l<<25,1,2,0,0ll);
	long n=rd();
	rep(i,n){
		a[i]=rd();
	}
	char*wp=wbuf+sizeof wbuf;
	rep(j,a[0]){
		while(n&&a[n-1]<j+1){
			--n;
		}
		b[j]=n;
	}
	rrep(j,a[0]){
		*--wp=' ';
		wt(b[j]);
	}
	write(1,wp,wbuf+sizeof wbuf-wp);
	_exit(0);
}
0