自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(11)
  • 收藏
  • 关注

原创 自认为的经典题,难题,好题,方便日后复习

题目1: 题目大意:求5*5二维矩阵的从左上角到右下角的最短路径 思路:结构体记录路径 //结构体记录路径 #include<iostream> #include<algorithm> #include<set> #include<queue> #include<stack> #include<string> #include<iostream> #include<algorithm> #includ.

2021-08-24 11:30:53 107

原创 大数相加:A+B problem

#include<iostream> #include<algorithm> #include<math.h> #include<string.h> using namespace std; int x[1002]={0},y[1002]={0},sum[1002]={0}; int main(){ int T; cin>>T; for(int k=1;k<=T;k++){ char a[1002],b[10002]; for.

2021-07-15 15:45:37 123

原创 2021-05-06

**Problem Description 有一头母牛,它每年年初生一头小母牛。每头小母牛从第四个年头开始,每年年初也生一头小母牛。请编程实现在第n年的时候,共有多少头母牛? Input 输入数据由多个测试实例组成,每个测试实例占一行,包括一个整数n(0<n<55),n的含义如题目中描述。 n=0表示输入数据的结束,不做处理。 Output 对于每个测试实例,输出在第n年的时候母牛的数量。 每个输出占一行。 Sample Input 2 4 5 0 Sample Output 2 4 6 *实质

2021-05-06 22:15:34 75

原创 求奇数的乘积

题目链接http://acm.hdu.edu.cn/showproblem.php?pid=2006 Problem Description 给你n个整数,求他们中所有奇数的乘积。 Input 输入数据包含多个测试实例,每个测试实例占一行,每行的第一个数为n,表示本组数据一共有n个,接着是n个整数,你可以假设每组数据必定至少存在一个奇数。 Output 输出每组数中的所有奇数的乘积,对于测试实例,输出一行。 Sample Input 3 1 2 3 4 2 3 4 5 Sample Output 3 15

2021-05-04 22:14:44 167

原创 只包含因子2 3 5的数

**K的因子中只包含2 3 5。满足条件的前10个数是:2,3,4,5,6,8,9,10,12,15。 所有这样的K组成了一个序列S,现在给出一个数n,求S中 >= 给定数的最小的数。 例如:n = 13,S中 >= 13的最小的数是15,所以输出15。 Input 第1行:一个数T,表示后面用作输入测试的数的数量。(1 <= T <= 10000) 第2 - T+1行:每行1个数N(1 <= N <= 10^18) Output 共T行,每行1个数,输出>= n的

2021-05-04 19:51:13 666

原创 数字1的数量

**给定一个十进制正整数N,写下从1开始,到N的所有正数,计算出其中出现所有1的个数。 例如:n = 12,包含了5个1。1,10,12共包含3个1,11包含2个1,总共5个1。** 输入: 输入N(1 <= N <= 10^9) *输出: * 输出包含1的个数 #include<iostream> using namespace std; int main(){ ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); lo

2021-05-01 15:28:56 91

原创 升序容器

/*升序容器:a lower_bound()(a.begin(),a.end(),x)容器a内第一个大于等于x的值的位置的地址, 想得到下标:lower_bound (a.begin(),a.end(),x)-a.begin(); upper_bound()器a内第一个大于x的值的位置的地址 */ #include<bits/stdc++.h> using namespace std; const int N=1e5+100; int a[N]; int main(){ int n; ci.

2021-04-29 21:54:59 63

原创 二分

#include<bits/stdc++.h> using namespace std; const int N=1e5+100; int a[N]; int main(){ int n; cin>>n; for(int i=1;i<=n;i++)cin>>a[i]; int l=1; int r=n; while(l<=r){ int mid=(l+r)/2; if(a[mid]==4){ cout<<mid<&.

2021-04-29 21:42:28 60

原创 2021-04-26

结构体排序 #include<bits/stdc++.h> using namespace std; struct Student{ char name[20]; int score ; }; bool cmp(Student a,Student b){ return a.score<b.score; //if(a.score<b.score)return 1; //return 0; } const int N=1e5+100; Student s[N]; int mai

2021-04-26 21:29:27 52

原创 multiset

在c++中,multiset是库中的一个类型,它可以看成一个序列,可插入,删除元素,且能时刻保证序列有序,且序列中可以存在重复的数。 一些用法 #include<algorithm> #include<string> #include<stack> #include<vector> #include<iostream> #include<queue> #include<set> using namespace std;

2021-04-24 16:36:39 70

原创 queue(队列)

先进先出 #include<algorithm> #include<string> #include<stack> #include<vector> #include<iostream> #include<queue> using namespace std; int main(){ queue<int>q;//引入队列 stack<int>sta; int n; cin>&

2021-04-24 16:20:41 72

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除