結果

問題 No.2359 A in S ?
ユーザー tailstails
提出日時 2023-06-24 03:22:30
言語 C90
(gcc 11.4.0)
結果
AC  
実行時間 128 ms / 2,000 ms
コード長 995 bytes
コンパイル時間 1,164 ms
コンパイル使用メモリ 29,096 KB
実行使用メモリ 103,088 KB
最終ジャッジ日時 2023-09-13 22:38:55
合計ジャッジ時間 6,283 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 108 ms
99,504 KB
testcase_01 AC 104 ms
99,564 KB
testcase_02 AC 106 ms
99,552 KB
testcase_03 AC 106 ms
99,452 KB
testcase_04 AC 108 ms
101,876 KB
testcase_05 AC 44 ms
102,496 KB
testcase_06 AC 112 ms
101,808 KB
testcase_07 AC 111 ms
103,088 KB
testcase_08 AC 58 ms
102,084 KB
testcase_09 AC 111 ms
102,076 KB
testcase_10 AC 41 ms
101,980 KB
testcase_11 AC 43 ms
102,352 KB
testcase_12 AC 111 ms
102,036 KB
testcase_13 AC 113 ms
101,948 KB
testcase_14 AC 123 ms
101,904 KB
testcase_15 AC 128 ms
101,816 KB
testcase_16 AC 113 ms
101,872 KB
testcase_17 AC 109 ms
101,828 KB
testcase_18 AC 112 ms
101,728 KB
testcase_19 AC 111 ms
101,896 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:48:2: warning: implicit declaration of function ‘write’ [-Wimplicit-function-declaration]
  write(1,wbuf,wp-wbuf);
  ^~~~~
main.c:49:2: warning: implicit declaration of function ‘_exit’ [-Wimplicit-function-declaration]
  _exit(0);
  ^~~~~
main.c:49:2: warning: incompatible implicit declaration of built-in function ‘_exit’

ソースコード

diff #

#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