早上打比赛,喜提40分
主要是大部分时间都在整T3的高精度,题面样例以及自己造的大样例都过了,但不知道为什么已提交就爆零,后面下午和晚上都在整这个(最后变成造轮子,还是特别破烂的那种)
加上太久没接触OI了突然有点生疏
所以就只有第三题拿了点部分分,已老实
下午和晚上听讲评、改题目
(为什么我赛时就没想到过T5用dfs和dp,疑似智力退化)
T3代码(WA, 0pts)
#include= 0;i--){
num[i] += o.num[i];
if(num[i] >= 10) num[i-1]++,num[i]-=10;
}
return *this;
}
uBigInt operator-(const uBigInt& o){
for(int i = SIZE-1;i >= 0;i--){
num[i] -= o.num[i];
if(num[i] =SIZE-100;i--){
for(int j = SIZE-1;j >=SIZE-100;j--){
res.num[SIZE - (SIZE - i) - (SIZE - j) + 1] += num[i] * o.num[j];
if(res.num[SIZE - (SIZE - i) - (SIZE - j) + 1] >= 10){
res.num[SIZE - (SIZE - i) - (SIZE - j)] += res.num[SIZE - (SIZE - i) - (SIZE - j) + 1] / 10;
res.num[SIZE - (SIZE - i) - (SIZE - j) + 1] %= 10;
}
}
}
return res;
}
uBigInt operator/(const unsigned int n) const {
int rem = 0;
uBigInt res;
for(int i=SIZE-1;i>=0;i--){
rem = rem*10 + num[i];
res.num[i] = rem / n;
rem %= n;
}
return res;
}
void read(){
string s;
memset(num,0,SIZE * sizeof(unsigned short));
cin >> s;
for(int i = s.size()-1;i >= 0;i--){
num[SIZE - s.size() + i] = s[i] - '0';
}
}
void write() const{
bool flag = 0;
for(int i = 0;i < SIZE-2;i++){
if(!flag && num[i] != 0) flag = 1;
if(flag) cout << num[i];
}
}
CMP cmp(const uBigInt& o) const{
bool fs=0,fo=0;
for(int i = 0;i o.num[i]) return Gt;
if(fs && num[i] < o.num[i]) return Lt;
}
return Eq;
}
};
int main(){
freopen("rectangle.in","r",stdin);
freopen("rectangle.out","w",stdout);
uBigInt n1,m1,n2,m2,ans,twenty;
twenty.num[SIZE - 1] = 5,twenty.num[SIZE - 2] = 2;
n1.read(),m1.read(),n2.read(),m2.read();
ans = (n1 * n1 + n1) * (m1 * m1 + m1) +
(n2 * n2 + n2) * (m2 * m2 + m2) ;
if(n1.cmp(n2) == Gt) swap(n1,n2);
if(m1.cmp(m2) == Gt) swap(m1,m2);
((ans - ((n1 * n1 + n1) * (m1 * m1 + m1))) * twenty).write();
}
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.