提交记录 4631
用户 | 题目 | 状态 | 得分 | 用时 | 内存 | 语言 | 代码长度 |
---|---|---|---|---|---|---|---|
saffah | noi17a. 【NOI2017】整数 | Accepted | 100 | 460.27 ms | 16320 KB | C++ | 1.21 KB |
提交时间 | 评测时间 |
---|---|
2018-07-26 19:32:46 | 2020-07-31 23:09:16 |
// #3273
#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.61 us | 44 KB | Accepted | Score: 4 | 显示更多 |
Testcase #2 | 74.46 us | 44 KB | Accepted | Score: 4 | 显示更多 |
Testcase #3 | 411.94 us | 64 KB | Accepted | Score: 4 | 显示更多 |
Testcase #4 | 1.117 ms | 80 KB | Accepted | Score: 4 | 显示更多 |
Testcase #5 | 836.39 us | 132 KB | Accepted | Score: 4 | 显示更多 |
Testcase #6 | 1.257 ms | 124 KB | Accepted | Score: 4 | 显示更多 |
Testcase #7 | 1.678 ms | 300 KB | Accepted | Score: 4 | 显示更多 |
Testcase #8 | 1.854 ms | 192 KB | Accepted | Score: 4 | 显示更多 |
Testcase #9 | 5.939 ms | 912 KB | Accepted | Score: 4 | 显示更多 |
Testcase #10 | 7.838 ms | 772 KB | Accepted | Score: 4 | 显示更多 |
Testcase #11 | 11.874 ms | 644 KB | Accepted | Score: 4 | 显示更多 |
Testcase #12 | 11.005 ms | 1 MB + 236 KB | Accepted | Score: 4 | 显示更多 |
Testcase #13 | 14.801 ms | 1 MB + 440 KB | Accepted | Score: 4 | 显示更多 |
Testcase #14 | 46.649 ms | 3 MB + 108 KB | Accepted | Score: 4 | 显示更多 |
Testcase #15 | 59.132 ms | 3 MB + 772 KB | Accepted | Score: 4 | 显示更多 |
Testcase #16 | 100.2 ms | 5 MB + 672 KB | Accepted | Score: 4 | 显示更多 |
Testcase #17 | 116.463 ms | 1 MB + 280 KB | Accepted | Score: 4 | 显示更多 |
Testcase #18 | 156.982 ms | 8 MB + 240 KB | Accepted | Score: 4 | 显示更多 |
Testcase #19 | 188.44 ms | 9 MB + 508 KB | Accepted | Score: 4 | 显示更多 |
Testcase #20 | 460.27 ms | 15 MB + 960 KB | Accepted | Score: 4 | 显示更多 |
Testcase #21 | 207.443 ms | 10 MB + 196 KB | Accepted | Score: 4 | 显示更多 |
Testcase #22 | 234.36 ms | 1 MB + 928 KB | Accepted | Score: 4 | 显示更多 |
Testcase #23 | 182.493 ms | 4 MB + 468 KB | Accepted | Score: 4 | 显示更多 |
Testcase #24 | 250.431 ms | 1 MB + 1020 KB | Accepted | Score: 4 | 显示更多 |
Testcase #25 | 293.32 ms | 13 MB + 324 KB | Accepted | Score: 4 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2024-11-22 13:33:32 | Loaded in 3 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠