Lv.1
FFFFFFFFFFLY
在 求证:1+1=2(在线等,挺急的) 中回复
证明1+1=2的方法有很多,其中一种是基于皮亚诺公理的自然数系统。
皮亚诺公理有五条,分别是:
1. 0是一个自然数。
2. 每个自然数都有一个后继数,即加上1的结果。
3. 0不是任何自然数的后继数。
4. 如果两个自然数的后继数相等,那么这两个自然数也相等。
5. 如果一个集合包含了0,并且对于任何属于该集合的自然数n,它的后继数n'也属于该集合,那么该集合就包含了所有的自然数。
根据这些公理,我们可以定义加法如下:
- 0+m:=m
- (m+n)':=(m+n)'+m
也就是说,任何自然数加上0还是它本身,而任何两个自然数相加的结果再加上1等于这两个自然数中先加上1再相加的结果。
现在我们可以来证明1+1=2了:
- 1+1=1+0'=(1+0)'=1'=2
当然还可以证明其他更复杂的等式,比如“3×5=15”⁴。
2023-02-26T14:13:57 点赞:0
在 各位神仙智商的来看看 中回复
<main class="flex-1 overflow-hidden">
古代屠城人皆亡, 鸡蛋都要摇散黄。 血染乾坤哭破碑, 苦难岁月何曾忘。
挥刀斩尽光明路, 狼烟弥漫万古愁。 尸骨堆积寒风吹, 痛彻心扉泪满流。
黄昏暗淡惨无辉, 回忆残破在空中。 世道艰难伤心事, 悲叹遗憾化成风。
然而今朝鼓起勇, 追求和平永不懈。 种下爱心培花果, 重建家园岁月谐。
未来道路虽险阻, 共创辉煌人间美。 唤起勇气光芒闪, 凝聚力量心底烈。
愿世界充满祥和, 不再屠城哀鸣长。 摇散黄光希望还, 新生明天万民芳。
</main>2023-06-09T19:49:09 点赞:0
在 [C++]能力测试“丑数” 中回复
#include <iostream>
using namespace std;
bool passList[6] = { 0,0,1,1,0,1 };
int n = 0;
bool isOk2(int y) {
if (y < 3) {
return false;
}
int i = 2;
while (i * i <= y) {
if (!(y % i * i)) {
return false;
}
i++;
}
return true;
}
bool isOk(int z) {
int num1 = z;
int num2 = 1;
for (; num2 < z; num2++) {
if (!(z % num2)) {
num1 = z / num2;
if (isOk2(num1) && !passList[num1]) {
return false;
}
if (isOk2(num2) && !passList[num2]) {
return false;
}
}
}
return true;
}
int main() {
cin >> n;
int okNum = 0;
int ans = 0;
while (okNum < n) {
ans++;
if (isOk(ans) and !isOk2(ans) || passList[ans]) {
okNum++;
}
}
cout << ans;
}2024-08-16T22:30:39 点赞:0
在 [C++]能力测试“丑数” 中回复
#include <iostream>
#include <vector>
using namespace std;
int passList[3] = {2,3,5};
int n = 0;
vector<int> ansList;
int main() {
cin >> n;
double start = clock();
int Count = 1;
int 喵 = 1;
while (Count < n) {
int min = INT_MAX;
ansList.push_back(喵);
for (int y = 0; y < 3; y++) {
for (int x = 0; x < Count; x++) {
int nextUgly = ansList[x] * passList[y];
if (ansList[Count - 1] < nextUgly){
if (nextUgly < min) {
min = nextUgly;
}
break;
}
}
}
喵 = min;
Count++;
}
cout << 喵;
}2024-08-16T23:56:48 点赞:0
在 [C++]简单动规能力测试“数字卡片” 中回复
#include <iostream>
using namespace std;
int n = 0;
int k = 1;
int nums[5001];
int ans = 1;
int Max = 0;
int Hash[5001];
int f(int nowNumS) {
int nowNum = nums[nowNumS];
for (int x = 0; x <= n; x++) {
int nextNum = nums[x];
if (nextNum - nowNum == k) {
if(!Hash[x])
{
Hash[x] = f(x);
}
return 1 + Hash[x];
}
}
return 1;
}
int main() {
cin >> n >> k;
for (int x = 0; x < n; x++) {
cin >> nums[x];
}
for (int x = 0; x < n; x++) {
Max = max(f(x),Max);
}
cout << Max;
return 0;
}2024-08-17T17:14:08 点赞:0