当前位置:网站首页>Blue Bridge Cup 2015 CA provincial competition (filling the pit)
Blue Bridge Cup 2015 CA provincial competition (filling the pit)
2022-06-12 11:36:00 【Happy star】
1、 Integer solution of the equation

#include<bits/stdc++.h>
using namespace std;
int main(){
for(int a=1;a<35;a++){
for(int b=1;b<35;b++){
for(int c=1;c<35;c++){
if(a*a+b*b+c*c==1000){
cout<<a<<" "<<b<<" "<<c<<" "<<endl;
}
}
}
}
return 0;
}
answer :10
2、 The galaxy bomb

use excel Calculated
A1 Write death as 2014-11-9
C1=B1-A1
adjustment B1 until C1=1000
answer : 2017-08-05
3、 Wonderful numbers

Convert the sum of squares and cubes to a string , String concatenation , String sort , Determine whether the string is equal to 0123456789
#include<bits/stdc++.h>
using namespace std;
string num2str( double i)
{
stringstream ss;
string s;
ss<<i;
ss>>s;
return s;
}
int main(){
for(int a=1;a<10000;a++){
int b=a*a;
int c=a*a*a;
string temp=num2str(b)+num2str(c);
sort(temp.begin(),temp.end());
if(temp=="0123456789"){
cout<<a<<endl;
return 0;
}
}
return 0;
}
answer :69
6、 The number of brand types

What I think of is the knowledge of permutation and combination of high school mathematics problems 
The vague memory is like this
DFS How to write it
#include<bits/stdc++.h>
using namespace std;
int pais[13];
vector<int> path;
int ans=0;
int countof(vector<int> path,int pai){
int count=0;
for(int i=0;i<path.size();i++){
if(path[i]==pai){
count++;
}
}
return count;
}
void dfs(int n,vector<int>&path){
if(n==0){
ans++;
return;
}
for(int i=0;i<13;i++){
if(countof(path,pais[i])<4){
path.push_back(pais[i]);
dfs(n-1,path);
path.pop_back();
}
}
}
int main(){
for(int i=1;i<=13;i++) {
pais[i-1]=i;
}
dfs(13,path);
cout<<ans<<endl;
}
7、 Bracelet style

8、 Drink exchange

Simulation is enough
#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
int res=n;
while(n>=3){
int temp=n/3;
n-=(temp*3);
n+=(temp);
res+=(temp);
}
cout<<res;
}
9、 Base dice


10、


边栏推荐
- Socket programming UDP
- ^33 variable promotion and function promotion interview questions
- manuscript手稿格式准备
- Epidemic home office experience | community essay solicitation
- kubernetes集群搭建
- Leetcode 162 Looking for peak value (June 11, 2022)
- SharDingJDBC-5.1.0按月水平分表+读写分离,自动创表、自动刷新节点表
- Shardingjdbc-5.1.0 monthly horizontal table splitting + read-write separation, automatic table creation and node table refresh
- Index in MySQL show index from XXX the meaning of each parameter
- Lambda expression | shallow solution
猜你喜欢

InfoQ 极客传媒 15 周年庆征文|position:fixed 虚拟按键触发后无法生效问题分析及解决方案探究

Deep learning and CV tutorial (14) | image segmentation (FCN, segnet, u-net, pspnet, deeplab, refinenet)

Record the pits encountered when using JPA

UML系列文章(30)体系结构建模---制品图

The reason why scanf return value is ignored and its solution

scanf返回值被忽略的原因及其解决方法

Basic principle of Doppler effect

Doris记录服务接口调用情况

Selenium uses proxy IP

读mysql45讲-自我总结(部分)
随机推荐
Pytorch笔记
自然语言处理nlp 数据集下载地址
6.6 Convolution de séparation
How to view glibc version
postman传入list
架构训练模块 7
2022-06-11: note that in this document, graph is not the meaning of adjacency matrix, but a bipartite graph. In the adjacency matrix with length N, there are n points, matrix[i][j]
Construction and construction of meta Universe System
ReentrantLock源码分析
Windows10安装mysql-8.0.28-winx64
AcWing 1995. Meet and greet (simulation)
Golang Foundation (6)
Go sends SMS based on Tencent cloud
字节序(网络/主机)转换
Selenium uses proxy IP
[cf1392d] D. Omkar and bed Wars
Redis summary
K58. Chapter 1 installing kubernetes V1.23 based on kubeadm -- cluster deployment
redis 總結
Golang Foundation (7)