結果
| 問題 |
No.2359 A in S ?
|
| コンテスト | |
| ユーザー |
tails
|
| 提出日時 | 2023-06-24 03:25:30 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
AC
|
| 実行時間 | 149 ms / 2,000 ms |
| コード長 | 995 bytes |
| コンパイル時間 | 826 ms |
| コンパイル使用メモリ | 27,648 KB |
| 実行使用メモリ | 130,048 KB |
| 最終ジャッジ日時 | 2024-07-01 06:55:50 |
| 合計ジャッジ時間 | 5,064 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 18 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:48:9: warning: implicit declaration of function ‘write’ [-Wimplicit-function-declaration]
48 | write(1,wbuf,wp-wbuf);
| ^~~~~
main.c:49:9: warning: implicit declaration of function ‘_exit’ [-Wimplicit-function-declaration]
49 | _exit(0);
| ^~~~~
main.c:49:9: warning: incompatible implicit declaration of built-in function ‘_exit’ [-Wbuiltin-declaration-mismatch]
ソースコード
#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[320][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<320){
d[x][l]+=1;
d[x][r]-=1;
}else{
rep4(i,l,r,x){
d[0][i]+=1;
}
}
}
rep3(x,1,320){
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);
}
tails