首页 > 试题广场 >

困难数学题

[编程题]困难数学题
  • 热度指数:221 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 512M,其他语言1024M
  • 算法知识视频讲解
\,\,\,\,\,\,\,\,\,小歪正在计算数学题:y=x \operatorname{xor} x \operatorname{xor} x\operatorname{xor} x 。多难啊,帮帮小歪吧。

\,\,\,\,\,\,\,\,\,在这里,\rm xor 表示位运算中的按位异或运算

输入描述:
\,\,\,\,\,\,\,\,\,第一行上输入一个整数 x \left(0\le x \le 500 \right)


输出描述:
\,\,\,\,\,\,\,\,\,第一行上输出一个整数 y 代表方程答案。
示例1

输入

0

输出

0

说明

\,\,\,\,\,\,\,\,\,我们都知道,异或运算( \operatorname{xor} )的口诀就是”不同出一,相同出零“。所以  0 \operatorname{xor} 0 \operatorname{xor} 0\operatorname{xor} 0=0
头像 已经死了
发表于 2024-09-15 21:02:41
F题详细题解+拓展题单 在数组上移动,要从1走到n 在第i个下标,有p1[i]的概率走到i+1,有p2[i]的概率走到i,有p3[i]的概率走到i-1 下标1另外算,p的概率走到2,则1走到2的期望步数是1/p 求从 展开全文
头像 菲得
发表于 2024-09-15 21:02:12
前言 如果有问题欢迎大家评论或私信指出 题解 A.困难数学题 输出 即可,因为相同的数字异或值为。 #include<bits/stdc++.h> using i64 = long long; using u64 = unsigned long long; void solve( 展开全文
头像 可爱抱抱呀😥
发表于 2024-09-16 20:19:46
DEF Java题解~~代码已去除冗余 D 我们N个真是太厉害了 求第一个空白区间的问题,需要从小数开始累加,假如已经遍历过的数字最大值为max,那么假如一个新数字a,则能表示的心得区间的最小数为a,其中区间(max,a)之间的数字是无法表示的,倘若区间不空,其中的最小数即为不能表示的最小数值,时间 展开全文
头像 周康禧
发表于 2025-12-04 17:02:15
#include <bits/stdc++.h> using namespace std; using ll = long long int; using ld = long double; using PII=pair<ll,ll>; using PIII=pair< 展开全文
头像 自由的风0450
发表于 2025-11-14 14:06:28
#include <iostream> using namespace std; int main() { int x,y; cin>>x; y=x^x^x^x; cout<<y; return 0; } // 64 位输 展开全文
头像 牛客用户098471297
发表于 2025-11-28 15:28:47
#include<bits/stdc++.h> using namespace std; #define int long long #define endl '\n' #define quick ios::sync_with_stdio(false);cin.tie(0);cout.t 展开全文