提交记录 5475
| 提交时间 |
评测时间 |
| 2018-08-25 21:24:12 |
2020-08-01 00:18:39 |
#include<bits/stdc++.h>
using namespace std;
typedef bitset<64> _int128;
inline _int128 operator+(const _int128 obj1,const _int128 obj2) {
return obj2.none()?obj1:(obj1^obj2)+((obj1&obj2)<<1);
}
inline _int128 operator+=(_int128 &obj1,const _int128 obj2) {
return obj1=obj1+obj2;
}
inline _int128 operator-(const _int128 obj) {
return (~obj)+1;
}
inline _int128 operator-(_int128 obj1,_int128 obj2) {
// cout<<~(bitset<128>)obj2;
return obj1+(~obj2)+1;
}
inline _int128 operator-=(_int128 &obj1,const _int128 obj2) {
return obj1=obj1-obj2;
}
inline _int128 operator*(_int128 obj1,_int128 obj2) {
_int128 ans=0;
for(;obj2.any();obj2>>=1,obj1<<=1)
if(obj2[0])
ans+=obj1;
return ans;
}
inline _int128 operator*=(_int128 &obj1,const _int128 obj2) {
return obj1=obj1*obj2;
}
ostream& operator<<(ostream& out,const _int128&obj)
{
vector<unsigned char> s;
s.push_back(0);
for(auto i=obj.size();i--!=0;) {
int front=obj.test(i)?1:0;
for(auto&n:s) {
if((n&0xf0)>=0x50)n+=0x30;
if((n&0x0f)>=5)n+=3;
int back=n>127?1:0;
n<<=1;
n|=front;
front=back;
}
if(front^0)
s.push_back(1);
}
if(*(s.end()-1)&0xf0) out<<(*(s.end()-1)>>4);
out<<(*(s.end()-1)&0xf);
for(int i=s.size()-2;i>=0;i--) {
out<<((s[i]&0xf0)>>4)<<(s[i]&0xf);
}
return out;
}
inline _int128 read(){
_int128 w=0;char ch=getchar();
while(!isdigit(ch)) ch=getchar();
while(isdigit(ch)) {w=(w<<3)+(w<<1)+(ch-48);ch=getchar();}
return w;
}
int main() {
cout<<read()+read();
return 0;
}
| Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
| Testcase #1 | 39.79 us | 36 KB | Wrong Answer | Score: 0 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2026-04-11 21:01:10 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠