跳到正文

个人记录

U432117 A ? B Problem

Gyf117约 2 分钟
原文
文章信息与版本

文章信息

收录
2025年12月12日
更新
2025年12月12日
篇幅
约 2 分钟
获赞
1

版本

  1. v1当前

U432117 A ? B Problem 题解

小芝士知识

注意到

((int)(‘1‘))⊕48=49 ⊕ 48=1((int)(`1`)) \oplus 48=49\ \oplus\ 48 = 1

a & 9223372036854775807=a(a∈long long范围)a\ \&\ 9223372036854775807=a(a\in \text{long long范围})

∑n=1∞(−1)n−12n−1 a2n−1=arctan⁡a\sum_{n=1}^{\infty} \frac{(-1)^{n-1}}{2n-1} \ a ^{2n-1}=\arctan a

tan⁡(arctan⁡a)=a\tan (\arctan a)=a

∴(b×(((int)(‘1‘))⊕48)+tan⁡(∑n=1∞(−1)n−12n−1 a2n−1))&9223372036854775807=a+b\therefore (b\times(((int)(`1`)) \oplus 48) + \tan(\sum_{n=1}^{\infty} \frac{(-1)^{n-1}}{2n-1} \ a ^{2n-1}))\&9223372036854775807=a+b

听懂掌声

AC代码

C++
// Problem: U432117 A ? B Problem
// Contest: Luogu
// URL: https://www.luogu.com.cn/problem/U432117
// Memory Limit: 512 MB
// Time Limit: 5000 ms
//
// Powered by CP Editor (https://cpeditor.org)

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll a,b;
int main()
{
	cin>>a>>b;
	cout<<a+b;
	return 0;
}

原文