提交记录 8623
用户 | 题目 | 状态 | 得分 | 用时 | 内存 | 语言 | 代码长度 |
---|---|---|---|---|---|---|---|
daniel14311531 | noi17a. 【NOI2017】整数 | Accepted | 100 | 483.421 ms | 117856 KB | C++ | 907 B |
提交时间 | 评测时间 |
---|---|
2019-02-27 14:29:14 | 2020-08-01 01:22:28 |
#include<bits/stdc++.h>
using namespace std;
const int N=32000010,M=1<<25;
int n,pp[50],lp;
bool w[2][N],t[M+M];
void add(int a,int b) {
int x=(a<0? -a:a),l,r; if(!a) return ; lp=0;
for(int i=30;~i;i--) if(x&(1<<i)) pp[++lp]=i;
l=pp[lp]+b,r=pp[1]+b;
for(int i=1,p;i<=lp;i++) {
for(p=pp[i]+b;w[a>0][p];w[a>0][p]=0,++p);
w[a>0][p]=1; if(p>r) r=p;
}
l+=M,r+=M;
for(int i=l;i<=r;i++) t[i]=w[0][i-M]^w[1][i-M];
for(l>>=1,r>>=1;l;l>>=1,r>>=1)
for(int i=l;i<=r;i++) t[i]=t[i<<1]|t[i<<1|1];
}
int main() {
scanf("%d%*d%*d%*d",&n);
for(int opt,a,b;n;--n) {
scanf("%d%d",&opt,&a);
if(opt==1) scanf("%d",&b),add(a,b);
else {
int pos=-1;
for(int k=a+M;k;k>>=1) {
if(!(k&1)||!t[k^1]) continue;
for(k^=1;k<M;k=k<<1|t[k<<1|1]);
pos=k-M; break;
}
if(pos==-1||w[1][pos]>w[0][pos])
printf("%d\n",w[1][a]^w[0][a]);
else printf("%d\n",w[1][a]==w[0][a]);
}
}
return 0;
}
Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
Testcase #1 | 44.02 us | 100 KB | Accepted | Score: 4 | 显示更多 |
Testcase #2 | 83.24 us | 104 KB | Accepted | Score: 4 | 显示更多 |
Testcase #3 | 762.77 us | 104 KB | Accepted | Score: 4 | 显示更多 |
Testcase #4 | 934.4 us | 108 KB | Accepted | Score: 4 | 显示更多 |
Testcase #5 | 2.117 ms | 120 KB | Accepted | Score: 4 | 显示更多 |
Testcase #6 | 1.576 ms | 136 KB | Accepted | Score: 4 | 显示更多 |
Testcase #7 | 3.299 ms | 1 MB + 132 KB | Accepted | Score: 4 | 显示更多 |
Testcase #8 | 3.54 ms | 140 KB | Accepted | Score: 4 | 显示更多 |
Testcase #9 | 11.059 ms | 3 MB + 560 KB | Accepted | Score: 4 | 显示更多 |
Testcase #10 | 17.712 ms | 1 MB + 264 KB | Accepted | Score: 4 | 显示更多 |
Testcase #11 | 20.751 ms | 364 KB | Accepted | Score: 4 | 显示更多 |
Testcase #12 | 15.12 ms | 7 MB + 580 KB | Accepted | Score: 4 | 显示更多 |
Testcase #13 | 26.614 ms | 8 MB + 144 KB | Accepted | Score: 4 | 显示更多 |
Testcase #14 | 85.88 ms | 23 MB + 100 KB | Accepted | Score: 4 | 显示更多 |
Testcase #15 | 81.098 ms | 34 MB + 600 KB | Accepted | Score: 4 | 显示更多 |
Testcase #16 | 177.139 ms | 46 MB + 100 KB | Accepted | Score: 4 | 显示更多 |
Testcase #17 | 176.758 ms | 2 MB + 296 KB | Accepted | Score: 4 | 显示更多 |
Testcase #18 | 275.482 ms | 69 MB + 84 KB | Accepted | Score: 4 | 显示更多 |
Testcase #19 | 323.978 ms | 80 MB + 608 KB | Accepted | Score: 4 | 显示更多 |
Testcase #20 | 397.093 ms | 69 MB + 528 KB | Accepted | Score: 4 | 显示更多 |
Testcase #21 | 279.787 ms | 103 MB + 628 KB | Accepted | Score: 4 | 显示更多 |
Testcase #22 | 330.136 ms | 4 MB + 184 KB | Accepted | Score: 4 | 显示更多 |
Testcase #23 | 371.39 ms | 21 MB + 244 KB | Accepted | Score: 4 | 显示更多 |
Testcase #24 | 352.281 ms | 4 MB + 460 KB | Accepted | Score: 4 | 显示更多 |
Testcase #25 | 483.421 ms | 115 MB + 96 KB | Accepted | Score: 4 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2024-11-22 12:16:07 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠