結果

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

コンパイルメッセージ
main.c: In function 'main':
main.c:21:13: error: expected ';' before 'j'
   21 |         rep(j,n){
      |             ^
main.c:8:32: note: in definition of macro 'rep'
    8 | #define rep(v,e) for(typeof(e) v=0;v<e;++v)
      |                                ^
main.c:21:13: error: 'j' undeclared (first use in this function)
   21 |         rep(j,n){
      |             ^
main.c:8:36: note: in definition of macro 'rep'
    8 | #define rep(v,e) for(typeof(e) v=0;v<e;++v)
      |                                    ^
main.c:21:13: note: each undeclared identifier is reported only once for each function it appears in
   21 |         rep(j,n){
      |             ^
main.c:8:36: note: in definition of macro 'rep'
    8 | #define rep(v,e) for(typeof(e) v=0;v<e;++v)
      |                                    ^
main.c:32:30: error: expected ';' before 'i'
   32 |                         rep4(i,l,r,x){
      |                              ^
main.c:10:37: note: in definition of macro 'rep4'
   10 | #define rep4(v,s,e,t) for(typeof(e) v=s;v<e;v+=t)
      |                                     ^
main.c:32:30: error: 'i' undeclared (first use in this function)
   32 |                         rep4(i,l,r,x){
      |                              ^
main.c:10:41: note: in definition of macro 'rep4'
   10 | #define rep4(v,s,e,t) for(typeof(e) v=s;v<e;v+=t)
      |                                         ^
main.c:37:14: error: expected ';' before 'x'
   37 |         rep3(x,1,250){
      |              ^
main.c:9:35: note: in definition of macro 'rep3'
    9 | #define rep3(v,s,e) for(typeof(e) v=s;v<e;++v)
      |                                   ^
main.c:37:14: error: 'x' undeclared (first use in this function)
   37 |         rep3(x,1,250){
      |              ^
main.c:9:39: note: in definition of macro 'rep3'
    9 | #define rep3(v,s,e) for(typeof(e) v=s;v<e;++v)
      |                                       ^
main.c:38:21: error: expected ';' before 'i'
   38 |                 rep(i

ソースコード

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_skip() while(*rp++>=48)
#define rd() ({int _v=0,_c;while(_c=*rp++-48,_c>=0)_v=_v*10+_c;_v;})
#define wt(v) ({unsigned _z=v,_n=0;ulong _d=0;while(++_n,_d=_d<<8|0x30|_z%10,_z/=10);*(ulong*)wp=_d;wp+=_n;})
#define rep(v,e) for(typeof(e) v=0;v<e;++v)
#define rep3(v,s,e) for(typeof(e) v=s;v<e;++v)
#define rep4(v,s,e,t) for(typeof(e) v=s;v<e;v+=t)

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

int d[250][100400];

int main(){
	rd_init();
	int n=rd();
	rd_skip();
	rep(j,n){
		int l=rd()-1;
		int r=rd();
		int x=rd();
		int y=rd();
		l+=x-(l-y+x)%x;
		r+=x-(r-y+x)%x;
		if(x<250){
			d[x][l]+=1;
			d[x][r]-=1;
		}else{
			rep4(i,l,r,x){
				d[0][i]+=1;
			}
		}
	}
	rep3(x,1,250){
		rep(i,100001){
			d[0][i]+=d[x][i]+=i-x<0?0:d[x][i-x];
		}
	}
	char*wp=wbuf;
	while(*rp){
		int a=rd();
		wt(d[0][a]);
		*wp++='\n';
	}
	write(1,wbuf,wp-wbuf);
	_exit(0);
}
0