提交记录 5476


用户 题目 状态 得分 用时 内存 语言 代码长度
condor2048 1000i. 【传统题】 A+B Problem Wrong Answer 0 45.63 us 36 KB C++ 1.60 KB
提交时间 评测时间
2018-08-25 21:28:07 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(int i=obj.size();i--!=0;) {
        int front=obj.test(i)?1:0;
        for(int i=0;i<s.size();i++) {
			#define n s[i]
            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;
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #145.63 us36 KBWrong AnswerScore: 0


Judge Duck Online | 评测鸭在线
Server Time: 2026-04-11 21:00:21 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠