随笔分类 -  日常题解

1 2 3 下一页

摘要:题意: 分别找到 a 类和 b 类中的最小值,判断当前 a 和 b 变到最小值的最大值,最后累加即可。 #include<iostream> using namespace std; const int maxn=1e6+20; int a[100],b[100]; #define inf 0x3f 阅读全文

posted @ 2020-08-09 19:33 YovM_21 阅读(133) 评论(0) 推荐(0)

摘要:题意: 暴力枚举 #include <iostream> #include<algorithm> #include<cstring> using namespace std; int a[55], ans, mc[105]; bool vis[55]; int main() { int t; cin 阅读全文

posted @ 2020-08-09 19:05 YovM_21 阅读(135) 评论(0) 推荐(0)

摘要:题意 给定一个01串s,完全分割成若干子序列,其中的子序列不包含两个相邻的0或1(eg:"0101","1010")。对s按这样的分割方式,最少能分出多少串子序列?同时,还要求输出s串中每一字符所在的分割出的子序列编号 #include <iostream> #include <vector> #i 阅读全文

posted @ 2020-08-09 18:15 YovM_21 阅读(145) 评论(0) 推荐(0)

摘要:题意:排序后,若有两数差大于一的,则输出“NO”,反则输出“YES”。 #include<iostream> #include<algorithm> using namespace std; int a[105]; int n,t; int main() { cin>>t; while(t--){ 阅读全文

posted @ 2020-08-09 18:05 YovM_21 阅读(151) 评论(0) 推荐(0)

摘要:C. Uncle Bogdan and Country Happiness time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Un 阅读全文

posted @ 2020-08-06 16:34 YovM_21 阅读(159) 评论(0) 推荐(0)

摘要:Captain Flint and his crew keep heading to a savage shore of Byteland for several months already, drinking rum and telling stories. In such moments un 阅读全文

posted @ 2020-08-06 14:52 YovM_21 阅读(196) 评论(0) 推荐(0)

摘要:A - Captain Flint and Crew Recruitment Despite his bad reputation, Captain Flint is a friendly person (at least, friendly to animals). Now Captain Fli 阅读全文

posted @ 2020-08-06 13:42 YovM_21 阅读(174) 评论(0) 推荐(0)

摘要:question: InputThe first line of input gives the number of cases, T. T test cases follow, each on a separate line. Each test case contains one positiv 阅读全文

posted @ 2020-07-27 23:35 YovM_21 阅读(118) 评论(0) 推荐(0)

摘要:question: 传说在遥远的地方有一个非常富裕的村落,有一天,村长决定进行制度改革:重新分配房子。这可是一件大事,关系到人民的住房问题啊。村里共有n间房间,刚好有n家老百姓,考虑到每家都要有房住(如果有老百姓没房子住的话,容易引起不安定因素),每家必须分配到一间房子且只能得到一间房子。另一方面, 阅读全文

posted @ 2020-07-26 23:10 YovM_21 阅读(209) 评论(0) 推荐(0)

摘要:question: A tree is a well-known data structure that is either empty (null, void, nothing) or is a set of one or more nodes connected by directed edge 阅读全文

posted @ 2020-07-26 20:17 YovM_21 阅读(154) 评论(0) 推荐(0)

摘要:question: 听说lcy帮大家预定了新马泰7日游,Wiskey真是高兴的夜不能寐啊,他想着得快点把这消息告诉大家,虽然他手上有所有人的联系方式,但是一个一个联系过去实在太耗时间和电话费了。他知道其他人也有一些别人的联系方式,这样他可以通知其他人,再让其他人帮忙通知一下别人。你能帮Wiskey计 阅读全文

posted @ 2020-07-26 12:57 YovM_21 阅读(116) 评论(0) 推荐(0)

摘要:solution: #include<cstdio> using namespace std; long long f[40][40],flag[40][40]; int main() { int n,m,i,j,a,b; f[0][0]=1; scanf("%d%d%d%d",&n,&m,&a,& 阅读全文

posted @ 2020-07-21 21:31 YovM_21 阅读(170) 评论(0) 推荐(0)

摘要:question: The TV shows such as You Are the One has been very popular. In order to meet the need of boys who are still single, TJUT hold the show itsel 阅读全文

posted @ 2020-07-17 20:40 YovM_21 阅读(161) 评论(0) 推荐(0)

摘要:question: 都说天上不会掉馅饼,但有一天gameboy正走在回家的小径上,忽然天上掉下大把大把的馅饼。说来gameboy的人品实在是太好了,这馅饼别处都不掉,就掉落在他身旁的10米范围内。馅饼如果掉在了地上当然就不能吃了,所以gameboy马上卸下身上的背包去接。但由于小径两侧都不能站人,所 阅读全文

posted @ 2020-07-17 17:55 YovM_21 阅读(128) 评论(0) 推荐(0)

摘要:question: Pass a year learning in Hangzhou, yifenfei arrival hometown Ningbo at finally. Leave Ningbo one year, yifenfei have many people to meet. Esp 阅读全文

posted @ 2020-07-17 16:57 YovM_21 阅读(148) 评论(0) 推荐(0)

摘要:String Distance is a non-negative integer that measures the distance between two strings. Here we give the definition. A transform list is a list of s 阅读全文

posted @ 2020-07-14 17:36 YovM_21 阅读(206) 评论(0) 推荐(0)

摘要:#include<iostream> using namespace std; int F(int n) { int result[2] = {0,1}; if(n < 2) { return result[n]; } int f1 = 1; int f2 = 0; int f = 0; for(i 阅读全文

posted @ 2020-07-07 22:17 YovM_21 阅读(121) 评论(0) 推荐(0)

摘要:假设一个班有n(n<=50)个学生,每人考m(m<=5)门课,求每个学生的平均成绩和每门课的平均成绩,并输出各科成绩均大于等于平均成绩的学生数量。 Input输入数据有多个测试实例,每个测试实例的第一行包括两个整数n和m,分别表示学生数和课程数。然后是n行数据,每行包括m个整数(即:考试分数)。Ou 阅读全文

posted @ 2020-07-01 21:41 YovM_21 阅读(231) 评论(0) 推荐(0)

摘要:potato老师虽然很喜欢教书,但是迫于生活压力,不得不想办法在业余时间挣点外快以养家糊口。“做什么比较挣钱呢?筛沙子没力气,看大门又不够帅...”potato老师很是无奈。“张艺谋比你还难看,现在多有钱呀,听说还要导演奥运开幕式呢!你为什么不去娱乐圈发展呢?”lwg在一旁出主意。嗯,也是,为了生存 阅读全文

posted @ 2020-06-29 21:25 YovM_21 阅读(206) 评论(0) 推荐(0)

摘要:题目描述:将一些数字“排队”,每次从前面拿两个,第一个扔掉,第二个放到尾部,按照扔掉的顺序,求把这些扔掉的数连在一起的数字序列。 输入: 631758924 输出:615947283 #include<iostream> using namespace std; struct queue{ int 阅读全文

posted @ 2020-05-06 17:36 YovM_21 阅读(187) 评论(0) 推荐(0)

1 2 3 下一页

导航