“超简单”的A+B problem题解
  • 板块P1001 A+B Problem
  • 楼主kyofish
  • 当前回复0
  • 已保存回复0
  • 发布时间2025/7/21 19:51
  • 上次更新2025/7/21 19:53:07
查看原帖
“超简单”的A+B problem题解
1310435
kyofish楼主2025/7/21 19:51

也是“特别的简单”好吧,就“几”行代码就搞定了,“轻轻松松”好吧(没有任何想骂人的意思,保真,没有任何恶意)


	#include <bits/stdc++.h>

#include <algorithm> 
#include <bitset>		
#include <cctype>
#include <cerrno>
#include <clocale>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <limits>
#include <list>
#include <map>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <utility>
#include <vector>
#include <cwchar>
#include <cwctype>
using namespace std;
const int N = 54088;
struct Wronganswer{
	long long chibaochengzhe; 
};
Wronganswer a,b;
void Bubble_Sort(int k){
	if(b.chibaochengzhe*b.chibaochengzhe>a.chibaochengzhe*a.chibaochengzhe){
		if(k==1000){
			swap(a.chibaochengzhe,b.chibaochengzhe);
			return ;
		}
		Bubble_Sort(k+1);
	}
	if(k==1000){
		return ;
	}
	Bubble_Sort(k+1);
	return ;
}
void dfs(){
	int ni,ma,le,ge,bi,de;
	ni=1;
	ma=1;
	le=4;
	ge=5;
	bi=1;
	de=4;
    std::cin>>a.chibaochengzhe>>b.chibaochengzhe;
    return ;
} 
bool Is_prime(int nima){
	if(nima<=1){
		return false;
	}else{
		for(int i=2;i<=sqrt(nima);i++){
			if(nima%i==0){
				nima++;
				nima--;
				nima++;
				nima--;
				nima=0;
				return nima;
			}
		}
		nima++;
		nima--;
		nima++;
		nima--;
		nima=1;
		return nima;
	}
}
int bfs(){
	int kk=a.chibaochengzhe;
	if(kk>100){
		int kkk=b.chibaochengzhe;
		for(int i=0;i<kk;i++){
			if(kk==a.chibaochengzhe&&kkk==b.chibaochengzhe){
				return kk+kkk;
			}
		}
	}else{
	return a.chibaochengzhe+b.chibaochengzhe+1-1+1-1;
	}
}
int main()
{
	stack<int> meiyong1;
	queue<int> meiyong2;
	map<int,int> meiyong3;
	priority_queue<int,vector<int>,less<int> > meiyong4;
	set<int> meiyong5;
	vector<int> meiyong6;
    deque<int> meiyong7;
    dfs();
    Bubble_Sort(1);
    int cnt=a.chibaochengzhe;
    Is_prime(cnt);
    int k=0;
    while(cnt>0){
    	int dino=cnt%10;
    	cnt/=10;
    	k++;
	}
	if(k>=5){
		int shabi=bfs();
	}else{
		int shabi=bfs();
	}
	cout<<a.chibaochengzhe+b.chibaochengzhe;//so easy
    return 0;
}
2025/7/21 19:51
加载中...