题解列表

筛选

编写题解 2881: 图像相似度

摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;const int N=1e3;int a[N][N],b[N][N];int m……

猴子吃桃的问题

摘要:解题思路:倒退回去算,思路为:    现在桃子数量 = (现在桃子数量 + 1) * 2;注意事项:按题目的来,第10天没吃。所以有3070个桃子是错的。参考代码:#include <iostream……

台球碰撞的三种解法(尽量使用c++)

摘要:原题:在平面直角坐标系下,台球桌是一个左下角在(0,0),右上角在(L,W)的矩形。有一个球心在(x,y),半径为R的圆形母球放在台球桌上(整个球都在台球桌内)。受撞击后,球沿极角为a的射线(即:x正……

编写题解 2853: 字符替换

摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;typedef long long ll;int main(){   string……

编写题解 2749: Hello, World!

摘要:解题思路:注意事项:参考代码:#include <iostream>using namespace std;int main(){    cout << "Hello world!" << endl;……

编写题解 1267: A+B Problem

摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int main(){    int a,b;    while(cin>>a>>b)cout……

编写题解 2776: A*B问题

摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int main(){    int a,b;    while(cin>>a>>b)cout……

素数筛选法(埃拉托斯特尼方法)的代码实现

摘要:首先,我们应当先复习一下原始的筛选法原理,先圈出2,并且划掉列表中2的倍数(即其他偶数),然后回到开始,圈出第一个没有被画掉的数,画掉剩下数表中他的所有倍数。重复这一过程足够多次数,剩下的没有被画掉的……