提交记录 3273
用户 | 题目 | 状态 | 得分 | 用时 | 内存 | 语言 | 代码长度 |
---|---|---|---|---|---|---|---|
Mogician | noi17a. 【NOI2017】整数 | Accepted | 100 | 460.467 ms | 16320 KB | C++ | 1.21 KB |
提交时间 | 评测时间 |
---|---|
2018-07-11 09:16:45 | 2020-07-31 21:14:56 |
#include<stdio.h>
#include<iostream>
#include<set>
using namespace std;
namespace INPUT{
const int L=1<<19;
char _buf[L],*S,*T,c;int op;
char _gc(){
if(S==T){
T=(S=_buf)+fread(_buf,1,L,stdin);
if(S==T) return EOF;
}return *S++;
}
void Readi(int &x){
for(c=_gc();(c<'0'||c>'9')&&c!='-';c=_gc());
op=1;if(c=='-')op=-1,c=_gc();
for(x=0;c>='0'&&c<='9';c=_gc())x=x*10+(c&15);x*=op;
}
}
using INPUT::Readi;
set<int>pos,neg;
typedef long long LL;
const LL C=1ll<<60;
const int N=1000010;
LL val[N];int n;
void update(int x,const LL v){
if(val[x]<0)neg.erase(x);
if(val[x]>0)pos.erase(x);
val[x]+=v;
if(val[x]>=C)val[x]-=C,update(x+1,1);
if(val[x]<=-C)val[x]+=C,update(x+1,-1);
if(val[x]<0)neg.insert(x);
if(val[x]>0)pos.insert(x);
}
int main(){
neg.insert(-1);pos.insert(-1);
Readi(n);int op,x,y;
Readi(op);Readi(op);Readi(op);
for(int i=1;i<=n;i++){
Readi(op);Readi(x);
if(op==1){
Readi(y);
LL tmp=x;int s=1;
if(tmp<0)tmp=-tmp,s=-s;
update(y/60,s*((tmp&(1LL<<60-y%60)-1)<<y%60));
update(y/60+1,s*(tmp>>60-y%60));
}
else{
int t=x/60;LL Res=val[t];
if(*(--pos.lower_bound(t))<*(--neg.lower_bound(t)))Res--;
if(Res<0)Res+=C;
printf("%d\n",(Res>>x%60)&1);
}
}
return 0;
}
Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
Testcase #1 | 39.2 us | 44 KB | Accepted | Score: 4 | 显示更多 |
Testcase #2 | 64.8 us | 44 KB | Accepted | Score: 4 | 显示更多 |
Testcase #3 | 411.29 us | 64 KB | Accepted | Score: 4 | 显示更多 |
Testcase #4 | 1.115 ms | 80 KB | Accepted | Score: 4 | 显示更多 |
Testcase #5 | 837.68 us | 132 KB | Accepted | Score: 4 | 显示更多 |
Testcase #6 | 1.266 ms | 124 KB | Accepted | Score: 4 | 显示更多 |
Testcase #7 | 1.679 ms | 300 KB | Accepted | Score: 4 | 显示更多 |
Testcase #8 | 1.834 ms | 192 KB | Accepted | Score: 4 | 显示更多 |
Testcase #9 | 5.932 ms | 912 KB | Accepted | Score: 4 | 显示更多 |
Testcase #10 | 7.839 ms | 772 KB | Accepted | Score: 4 | 显示更多 |
Testcase #11 | 11.976 ms | 644 KB | Accepted | Score: 4 | 显示更多 |
Testcase #12 | 11.005 ms | 1 MB + 236 KB | Accepted | Score: 4 | 显示更多 |
Testcase #13 | 14.767 ms | 1 MB + 440 KB | Accepted | Score: 4 | 显示更多 |
Testcase #14 | 46.564 ms | 3 MB + 108 KB | Accepted | Score: 4 | 显示更多 |
Testcase #15 | 59.138 ms | 3 MB + 772 KB | Accepted | Score: 4 | 显示更多 |
Testcase #16 | 100.088 ms | 5 MB + 672 KB | Accepted | Score: 4 | 显示更多 |
Testcase #17 | 116.176 ms | 1 MB + 280 KB | Accepted | Score: 4 | 显示更多 |
Testcase #18 | 156.414 ms | 8 MB + 240 KB | Accepted | Score: 4 | 显示更多 |
Testcase #19 | 189.27 ms | 9 MB + 508 KB | Accepted | Score: 4 | 显示更多 |
Testcase #20 | 460.467 ms | 15 MB + 960 KB | Accepted | Score: 4 | 显示更多 |
Testcase #21 | 206.814 ms | 10 MB + 196 KB | Accepted | Score: 4 | 显示更多 |
Testcase #22 | 234.88 ms | 1 MB + 928 KB | Accepted | Score: 4 | 显示更多 |
Testcase #23 | 182.049 ms | 4 MB + 468 KB | Accepted | Score: 4 | 显示更多 |
Testcase #24 | 250.422 ms | 1 MB + 1020 KB | Accepted | Score: 4 | 显示更多 |
Testcase #25 | 292.827 ms | 13 MB + 324 KB | Accepted | Score: 4 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2024-11-22 12:48:16 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠