PTA新生训练赛----3
大提琴的声音就像一条河,左岸是我无法忘却的回忆,右岸是我值得紧握的璀璨年华,中间流淌的,是我年年岁岁淡淡的感伤。
基础 正整数A+B
题的目标很简单,就是求两个正整数A
和B
的和,其中A
和B
都在区间[1,1000]。稍微有点麻烦的是,输入并不保证是两个正整数。
输入格式:
输入在一行给出A
和B
,其间以空格分开。问题是A
和B
不一定是满足要求的正整数,有时候可能是超出范围的数字、负数、带小数点的实数、甚至是一堆乱码。
注意:我们把输入中出现的第1个空格认为是A
和B
的分隔。题目保证至少存在一个空格,并且B
不是一个空字符串。
输出格式:
如果输入的确是两个正整数,则按格式A + B = 和
输出。如果某个输入不合要求,则在相应位置输出?
,显然此时和也是?
。
输入样例1:
123 456
输出样例1:
123 + 456 = 579
输入样例2:
22. 18
输出样例2:
? + 18 = ?
输入样例3:
-100 blabla bla...33
输出样例3:
? + ? = ?
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <vector>
#include <ctime>
#include <cctype>
#include <bitset>
#include <utility>
#include <sstream>
#include <complex>
#include <iomanip>
#define inf 0x3f3f3f3f
typedef long long ll;
using namespace std;
string S;
int fga,fgb,suma,sumb,sub;
int main()
{getline(cin,S);for (int i =0; i <S.length(); i++){if(S[i]==' '){sub = 1;for(int j=i-1; j>=0; j--){if (S[j]<'0' || S[j]>'9'){fga = 1;break;}else{suma += sub*(S[j] - '0');sub *= 10;}if(i==0){fga=1;break;}}if (suma>1000||suma==0)fga = 1;sub = 1;for(int j=S.length()-1; j>i; j--){if (S[j]<'0' || S[j]>'9'){fgb = 1;break;}else{sumb += sub*(S[j] - '0');sub *= 10;}}if (sumb>1000||sumb==0)fgb = 1;break;}}if (fga){if (fgb)cout << "? + ? = ?";elsecout << "? + " << sumb << " = ?";}else{if (!fgb)cout << suma << " + " << sumb << " = " << suma + sumb;elsecout << suma << " + ? = ?";}return 0;
}
7-2 I Love GPLT
这道超级简单的题目没有任何输入。
你只需要把这句很重要的话 —— I Love GPLT
——竖着输出就可以了。
所谓“竖着输出”,是指每个字符占一行(包括空格),即每行只能有1个字符和回车。
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <vector>
#include <ctime>
#include <cctype>
#include <bitset>
#include <utility>
#include <sstream>
#include <complex>
#include <iomanip>
#define inf 0x3f3f3f3f
typedef long long ll;
using namespace std;
string s="I Love GPLT";
int main(){int cd=s.size();for(int i=0;i<cd;i++)cout<<s[i]<<endl;return 0;
}
7-4 判断素数
本题的目标很简单,就是判断一个给定的正整数是否素数。
输入格式:
输入在第一行给出一个正整数N
(≤ 10),随后N
行,每行给出一个小于231的需要判断的正整数。
输出格式:
对每个需要判断的正整数,如果它是素数,则在一行中输出Yes
,否则输出No
。
输入样例:
2
11
111
输出样例:
Yes
No
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <vector>
#include <ctime>
#include <cctype>
#include <bitset>
#include <utility>
#include <sstream>
#include <complex>
#include <iomanip>
#define inf 0x3f3f3f3f
typedef long long ll;
using namespace std;
int N,x;
bool db(int n)
{int w;bool fg=true;if(n<=1)fg=false;else if(n==2)fg=true;else if(n%2==0)fg=false;else{w=sqrt(n)+1;for(int i=3; i<=w; i+=2){if(n%i==0){fg=false;break;}}}return fg;
}
int main()
{cin>>N;for(int i=0; i<N; i++){cin>>x;if(db(x))cout<<"Yes"<<endl;elsecout<<"No"<<endl;}return 0;
}
7-5 是不是太胖了
据说一个人的标准体重应该是其身高(单位:厘米)减去100、再乘以0.9所得到的公斤数。已知市斤的数值是公斤数值的两倍。现给定某人身高,请你计算其标准体重应该是多少?(顺便也悄悄给自己算一下吧……)
输入格式:
输入第一行给出一个正整数H
(100 < H ≤ 300),为某人身高。
输出格式:
在一行中输出对应的标准体重,单位为市斤,保留小数点后1位。
输入样例:
169
输出样例:
124.2
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <vector>
#include <ctime>
#include <cctype>
#include <bitset>
#include <utility>
#include <sstream>
#include <complex>
#include <iomanip>
#define inf 0x3f3f3f3f
typedef long long ll;
using namespace std;
int H;
double jg;
int main(){scanf("%d",&H);jg=(H-100)*0.9*2;printf("%.1f\n",jg);return 0;
}
7-6 一帮一
“一帮一学习小组”是中小学中常见的学习组织方式,老师把学习成绩靠前的学生跟学习成绩靠后的学生排在一组。本题就请你编写程序帮助老师自动完成这个分配工作,即在得到全班学生的排名后,在当前尚未分组的学生中,将名次最靠前的学生与名次最靠后的异性学生分为一组。
输入格式:
输入第一行给出正偶数N
(≤50),即全班学生的人数。此后N
行,按照名次从高到低的顺序给出每个学生的性别(0代表女生,1代表男生)和姓名(不超过8个英文字母的非空字符串),其间以1个空格分隔。这里保证本班男女比例是1:1,并且没有并列名次。
输出格式:
每行输出一组两个学生的姓名,其间以1个空格分隔。名次高的学生在前,名次低的学生在后。小组的输出顺序按照前面学生的名次从高到低排列。
输入样例:
8
0 Amy
1 Tom
1 Bill
0 Cindy
0 Maya
1 John
1 Jack
0 Linda
输出样例:
Amy Jack
Tom Linda
Bill Maya
Cindy John
#include<cstdio>
#include<iostream>
#include<string>
using namespace std;
struct student
{int xb;string mz;
};
int main()
{int n;scanf("%d",&n);student str[n];int book[n]= {0};for(int i=0; i<n; i++)cin>>str[i].xb>>str[i].mz;for(int i=0; i<n/2; i++){cout<<str[i].mz<<" ";for(int j=n-1; j>=n/2; j--){if(book[j]==0&&str[j].xb!=str[i].xb){cout<<str[j].mz<<endl;book[j]=1;break;}}}return 0;
}
7-7 到底是不是太胖了
据说一个人的标准体重应该是其身高(单位:厘米)减去100、再乘以0.9所得到的公斤数。真实体重与标准体重误差在10%以内都是完美身材(即 | 真实体重 − 标准体重 | < 标准体重×10%)。已知市斤是公斤的两倍。现给定一群人的身高和实际体重,请你告诉他们是否太胖或太瘦了。
输入格式:
输入第一行给出一个正整数N
(≤ 20)。随后N
行,每行给出两个整数,分别是一个人的身高H
(120 < H < 200;单位:厘米)和真实体重W
(50 < W ≤300;单位:市斤),其间以空格分隔。
输出格式:
为每个人输出一行结论:如果是完美身材,输出You are wan mei!
;如果太胖了,输出You are tai pang le!
;否则输出You are tai shou le!
。
输入样例:
3
169 136
150 81
178 155
输出样例:
You are wan mei!
You are tai shou le!
You are tai pang le!
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <vector>
#include <ctime>
#include <cctype>
#include <bitset>
#include <utility>
#include <sstream>
#include <complex>
#include <iomanip>
#define inf 0x3f3f3f3f
typedef long long ll;
using namespace std;
int main()
{int n;float h,w,bz;scanf("%d",&n);while(n--){cin>>h>>w;bz=(h-100)*0.9*2;if(fabs(w-bz)<bz*0.1)cout<<"You are wan mei!"<<endl;else{if(w>bz)cout<<"You are tai pang le!"<<endl;if(bz>w)cout<<"You are tai shou le!"<<endl;}}return 0;
}
7-3 出租
下面是新浪微博上曾经很火的一张图:
一时间网上一片求救声,急问这个怎么破。其实这段代码很简单,index
数组就是arr
数组的下标,index[0]=2
对应 arr[2]=1
,index[1]=0
对应 arr[0]=8
,index[2]=3
对应 arr[3]=0
,以此类推…… 很容易得到电话号码是18013820100
。
本题要求你编写一个程序,为任何一个电话号码生成这段代码 —— 事实上,只要生成最前面两行就可以了,后面内容是不变的。
输入格式:
输入在一行中给出一个由11位数字组成的手机号码。
输出格式:
为输入的号码生成代码的前两行,其中arr
中的数字必须按递减顺序给出。
输入样例:
18013820100
输出样例:
int[] arr = new int[]{8,3,2,1,0};
int[] index = new int[]{3,0,4,3,1,0,2,4,3,4,4};
#include<iostream>
#include<algorithm>
#include<cstdio>
int arr[11];
int index[11];
int temp[11];
using namespace std;
int cmp(int a,int b)
{return a>b?a:b;
}
int main()
{string dh;cin>>dh;int t=0;for(int i=0; i<11; i++){if(temp[dh[i]-48]==0)//防止多次标记电话中出现的数字{temp[dh[i]-48]=-1;arr[t]=dh[i]-48;t++;}}sort(arr,arr+t);sort(arr,arr+t,cmp);for(int i=0; i<11; i++)//寻找电话和arr数组中相等元素{for(int j=0; j<t; j++){if(dh[i]-48==arr[j]){index[i]=j;break;}}}printf("int[] arr = new int[]{%d",arr[0]);for(int i=1; i<t; i++)printf(",%d",arr[i]);printf("};\n");printf("int[] index = new int[]{%d",index[0]);for(int i=1; i<11; i++)printf(",%d",index[i]);printf("};\n");return 0;
}
7-8 Left-pad
根据新浪微博上的消息,有一位开发者不满NPM(Node Package Manager)的做法,收回了自己的开源代码,其中包括一个叫left-pad的模块,就是这个模块把javascript里面的React/Babel干瘫痪了。这是个什么样的模块?就是在字符串前填充一些东西到一定的长度。例如用*
去填充字符串GPLT
,使之长度为10,调用left-pad的结果就应该是******GPLT
。Node社区曾经对left-pad紧急发布了一个替代,被严重吐槽。下面就请你来实现一下这个模块。
输入格式:
输入在第一行给出一个正整数N
(≤104)和一个字符,分别是填充结果字符串的长度和用于填充的字符,中间以1个空格分开。第二行给出原始的非空字符串,以回车结束。
输出格式:
在一行中输出结果字符串。
输入样例1:
15 _
I love GPLT
输出样例1:
____I love GPLT
输入样例2:
4 *
this is a sample for cut
输出样例2:
cut
#include<stdio.h>
#include<string.h>
#include<math.h>
int main()
{int n,i,j;char c,a[100000];scanf("%d %c",&n,&c);getchar();int k=0;gets(a);int cda;cda=strlen(a);if(cda>=n)for(i=cda-n; i<cda; i++)printf("%c",a[i]);else{for(i=1; i<=n-cda; i++)printf("%c",c);for(i=0; i<cda; i++)printf("%c",a[i]);}return 0;
}
7-9 红色警报
战争中保持各个城市间的连通性非常重要。本题要求你编写一个报警程序,当失去一个城市导致国家被分裂为多个无法连通的区域时,就发出红色警报。注意:若该国本来就不完全连通,是分裂的k个区域,而失去一个城市并不改变其他城市之间的连通性,则不要发出警报。
输入格式:
输入在第一行给出两个整数N
(0 < N
≤ 500)和M
(≤ 5000),分别为城市个数(于是默认城市从0到N
-1编号)和连接两城市的通路条数。随后M
行,每行给出一条通路所连接的两个城市的编号,其间以1个空格分隔。在城市信息之后给出被攻占的信息,即一个正整数K
和随后的K
个被攻占的城市的编号。
注意:输入保证给出的被攻占的城市编号都是合法的且无重复,但并不保证给出的通路没有重复。
输出格式:
对每个被攻占的城市,如果它会改变整个国家的连通性,则输出Red Alert: City k is lost!
,其中k
是该城市的编号;否则只输出City k is lost.
即可。如果该国失去了最后一个城市,则增加一行输出Game Over.
。
输入样例:
5 4
0 1
1 3
3 0
0 4
5
1 2 0 4 3
输出样例:
City 1 is lost.
City 2 is lost.
Red Alert: City 0 is lost!
City 4 is lost.
City 3 is lost.
Game Over.
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <vector>
#include <ctime>
#include <cctype>
#include <bitset>
#include <utility>
#include <sstream>
#include <complex>
#include <iomanip>
#define inf 0x3f3f3f3f
typedef long long ll;
using namespace std;
int n,m,k,vis[550];
bool mp[550][550];
void dfs(int x)
{vis[x] = 1;for (int i = 0; i < n; i++)if (!vis[i]&&mp[x][i])dfs(i);
}
int shul()
{memset(vis, 0, sizeof(vis));int sum = 0;for (int i = 0; i < n; i++){if (!vis[i]){dfs(i);sum++;}}return sum;
}
int main()
{scanf("%d %d",&n,&m);while (m--){int a, b;scanf("%d %d", &a, &b);mp[a][b] = mp[b][a] = 1;}int g = shul();scanf("%d",&k);for (int i = 0; i < k; i++){int c;scanf("%d", &c);for (int i = 0; i < n; i++)if (mp[c][i])mp[c][i] = mp[i][c] = 0;int t = shul();if (t - 1 > g)printf("Red Alert: City %d is lost!\n",c);elseprintf("City %d is lost.\n",c);g = t;}if (k == n)printf("Game Over.\n");return 0;
}
7-10 列车调度
火车站的列车调度铁轨的结构如下图所示。
两端分别是一条入口(Entrance)轨道和一条出口(Exit)轨道,它们之间有N
条平行的轨道。每趟列车从入口可以选择任意一条轨道进入,最后从出口离开。在图中有9趟列车,在入口处按照{8,4,2,5,3,9,1,6,7}的顺序排队等待进入。如果要求它们必须按序号递减的顺序从出口离开,则至少需要多少条平行铁轨用于调度?
输入格式:
输入第一行给出一个整数N
(2 ≤ N
≤105),下一行给出从1到N
的整数序号的一个重排列。数字间以空格分隔。
输出格式:
在一行中输出可以将输入的列车按序号递减的顺序调离所需要的最少的铁轨条数。
输入样例:
9
8 4 2 5 3 9 1 6 7
输出样例:
4
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <vector>
#include <ctime>
#include <cctype>
#include <bitset>
#include <utility>
#include <sstream>
#include <complex>
#include <iomanip>
#define inf 0x3f3f3f3f
typedef long long ll;
using namespace std;
int n,s[100010],cd,x;
int main()
{cin>>n;for(int i=0; i<n; i++){cin>>x;if(cd==0||s[cd-1]<x)s[cd++]=x;else{int l=0,r=cd-1;while(l<r){int mid=(l+r)/2;if(s[mid]>x)r=mid;elsel=mid+1;}s[l]=x;}}cout<<cd<<endl;return 0;
}
7-11 互评成绩
学生互评作业的简单规则是这样定的:每个人的作业会被k
个同学评审,得到k
个成绩。系统需要去掉一个最高分和一个最低分,将剩下的分数取平均,就得到这个学生的最后成绩。本题就要求你编写这个互评系统的算分模块。
输入格式:
输入第一行给出3个正整数N
(3 < N
≤104,学生总数)、k
(3 ≤ k
≤ 10,每份作业的评审数)、M
(≤ 20,需要输出的学生数)。随后N
行,每行给出一份作业得到的k
个评审成绩(在区间[0, 100]内),其间以空格分隔。
输出格式:
按非递减顺序输出最后得分最高的M
个成绩,保留小数点后3位。分数间有1个空格,行首尾不得有多余空格。
输入样例:
6 5 3
88 90 85 99 60
67 60 80 76 70
90 93 96 99 99
78 65 77 70 72
88 88 88 88 88
55 55 55 55 55
输出样例:
87.667 88.000 96.000
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <vector>
#include <ctime>
#include <cctype>
#include <bitset>
#include <utility>
#include <sstream>
#include <complex>
#include <iomanip>
#define inf 0x3f3f3f3f
typedef long long ll;
using namespace std;
int N,k,M,x;
double jg[10010];
bool cmp(double a,double b)
{return a>b;
}
int main()
{cin>>N>>k>>M;for(int j=0; j<N; j++){int mi=100,mx=0,sum=0;for(int i=0; i<k; i++){cin>>x;mi=min(mi,x);mx=max(mx,x);sum+=x;}
// cout<<mi<<' '<<mx<<endl;jg[j]=(sum-mi-mx)*1.0/(k-2);}sort(jg,jg+N,cmp);for(int i=M-1; i>=0; i--){if(i==0)printf("%.3f\n",jg[i]);elseprintf("%.3f ",jg[i]);}return 0;
}
7-12 愿天下有情人都是失散多年的兄妹
呵呵。大家都知道五服以内不得通婚,即两个人最近的共同祖先如果在五代以内(即本人、父母、祖父母、曾祖父母、高祖父母)则不可通婚。本题就请你帮助一对有情人判断一下,他们究竟是否可以成婚?
输入格式:
输入第一行给出一个正整数N
(2 ≤ N
≤104),随后N
行,每行按以下格式给出一个人的信息:
本人ID 性别 父亲ID 母亲ID
其中ID
是5位数字,每人不同;性别M
代表男性、F
代表女性。如果某人的父亲或母亲已经不可考,则相应的ID
位置上标记为-1
。
接下来给出一个正整数K
,随后K
行,每行给出一对有情人的ID
,其间以空格分隔。
注意:题目保证两个人是同辈,每人只有一个性别,并且血缘关系网中没有乱伦或隔辈成婚的情况。
输出格式:
对每一对有情人,判断他们的关系是否可以通婚:如果两人是同性,输出Never Mind
;如果是异性并且关系出了五服,输出Yes
;如果异性关系未出五服,输出No
。
输入样例:
24
00001 M 01111 -1
00002 F 02222 03333
00003 M 02222 03333
00004 F 04444 03333
00005 M 04444 05555
00006 F 04444 05555
00007 F 06666 07777
00008 M 06666 07777
00009 M 00001 00002
00010 M 00003 00006
00011 F 00005 00007
00012 F 00008 08888
00013 F 00009 00011
00014 M 00010 09999
00015 M 00010 09999
00016 M 10000 00012
00017 F -1 00012
00018 F 11000 00013
00019 F 11100 00018
00020 F 00015 11110
00021 M 11100 00020
00022 M 00016 -1
00023 M 10012 00017
00024 M 00022 10013
9
00021 00024
00019 00024
00011 00012
00022 00018
00001 00004
00013 00016
00017 00015
00019 00021
00010 00011
输出样例:
Never Mind
Yes
Never Mind
No
Yes
No
Yes
No
No
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <vector>
#include <ctime>
#include <cctype>
#include <bitset>
#include <utility>
#include <sstream>
#include <complex>
#include <iomanip>
#define inf 0x3f3f3f3f
typedef long long ll;
using namespace std;
char xb[100010];
int vis[100010],fg,n,m;
vector<int> V[100010];
void dfs(int n,int num)
{if(num>=4)return;vis[n]=1;for(int i=0; i<V[n].size(); i++){if(!vis[V[n][i]]){vis[V[n][i]]=1;dfs(V[n][i],num+1);}elsefg=1;}
}
int main()
{cin>>n;for(int i=0; i<n; i++){int a,c,d;char b;cin>>a>>b>>c>>d;xb[a]=b;if(c!=-1){V[a].push_back(c);xb[c]='M';}if(d!=-1){V[a].push_back(d);xb[d]='F';}}cin>>m;for(int i=0; i<m; i++){int x,y;cin>>x>>y;if(xb[x]==xb[y])cout<<"Never Mind"<<endl;else{fg=0;memset(vis,0,sizeof(vis));dfs(x,0);dfs(y,0);if(fg==1)cout<<"No"<<endl;elsecout<<"Yes"<<endl;}}return 0;
}
7-13 是否完全二叉搜索树
将一系列给定数字顺序插入一个初始为空的二叉搜索树(定义为左子树键值大,右子树键值小),你需要判断最后的树是否一棵完全二叉树,并且给出其层序遍历的结果。
输入格式:
输入第一行给出一个不超过20的正整数N
;第二行给出N
个互不相同的正整数,其间以空格分隔。
输出格式:
将输入的N
个正整数顺序插入一个初始为空的二叉搜索树。在第一行中输出结果树的层序遍历结果,数字间以1个空格分隔,行的首尾不得有多余空格。第二行输出YES
,如果该树是完全二叉树;否则输出NO
。
输入样例1:
9
38 45 42 24 58 30 67 12 51
输出样例1:
38 45 24 58 42 30 12 67 51
YES
输入样例2:
8
38 24 12 45 58 67 42 51
输出样例2:
38 45 24 58 42 12 67 51
NO
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <vector>
#include <ctime>
#include <cctype>
#include <bitset>
#include <utility>
#include <sstream>
#include <complex>
#include <iomanip>
#define inf 0x3f3f3f3f
typedef long long ll;
using namespace std;
int a[110],n;
void build(int i,int w)
{if(a[i]==-1){a[i]=w;return;}if(w>a[i])build(i*2,w);elsebuild(i*2+1,w);
}
int main()
{scanf("%d",&n);memset(a,-1,sizeof(a));for(int i=0; i<n; i++){int x;cin>>x;build(1,x);}int t=0,i=0;while(t<n){while(a[i]==-1)i++;if(t)cout<<' '<<a[i];elsecout<<a[i];t++;i++;}cout<<endl;if(i==n+1)cout<<"YES"<<endl;elsecout<<"NO"<<endl;return 0;
}
PTA新生训练赛----3相关推荐
- PTA新生训练赛----4
大提琴的声音就像一条河,左岸是我无法忘却的回忆,右岸是我值得紧握的璀璨年华,中间流淌的,是我年年岁岁淡淡的感伤. 7-1 出生年 以上是新浪微博中一奇葩贴:"我出生于1988年,直到25岁才 ...
- PTA新生训练赛----5
大提琴的声音就像一条河,左岸是我无法忘却的回忆,右岸是我值得紧握的璀璨年华,中间流淌的,是我年年岁岁淡淡的感伤. L1-1 寻找250 对方不想和你说话,并向你扔了一串数-- 而你必须从这一串数字中找 ...
- bistuacm 2019年第⑦场新生训练赛题解
比赛链接:bistuacm 新生训练赛 第七场 难度:cf 900~1400 A 知识点:枚举 题意:寻找距离数组某个数最接近的a[i]<=k且b[i]=1的数. 解法:按题意模拟即可. #in ...
- PTA天梯训练赛一二
训练赛一 7-5 连续因子 (20 分) 思路: 暴力枚举起点,每次从起点往后延伸,并且更新长度和起点,最后输出即可. 代码: int main(){ll n;scanf("%lld&quo ...
- 中国石油大学 2018-2019赛季多校联合新生训练赛第一场 题解与补题
这场比赛是在18年12月,因为当时完全不敢用C++,感觉很遥远的样子-代码都是拿C实现的,许多地方其实也可以优化的. 问题 A: 录取分数线 时间限制: 1 Sec 内存限制: 128 MB 题目描述 ...
- 2018-2019赛季多校联合新生训练赛第六场补题与题解(中石油)
**总结:**这场比赛是我成绩最好的一次,也是打比赛这么多以来第一次拿到银牌(40名)可能因为昨天是我弟弟的生日把哈哈哈哈有他在家里保佑我进银牌区,这场比赛怎么说呢,考点和难度感觉都比上次要高了很多, ...
- 2018-2019赛季多校联合新生训练赛第一场题解和补题(中石油)
做这个题用了没多长时间就a了四道题,然后觉得我可以做出更多的时候突然发现别的都不太会了..到最后才拿到一个铜牌后来听说这些 都是2011年慈溪的小学奥赛题,瞬间心态崩了...这都大学了做小学题都这么费 ...
- 2017光棍节新生训练赛
Description There are some students in a class, Can you help teacher find the highest student . Inpu ...
- QLU—新生训练赛002补题
I.十进制中的二进制 解题方法:直接把给定范围内的有0和1组成的数暴力输出,然后开个数组把这些数放进去,进而在数组中找要求的范围内符合条件的数就行了(一开始做的时候还以为有什么规律...一直在找规律, ...
最新文章
- RocketMQ:Consumer概述及启动流程与消息拉取源码分析
- PHP占用内存越来越多,解决phpQuery占用内存过多的问题
- 使用Mockito对类成员变量进行Mock
- Apache Flink 在斗鱼的应用与实践
- html修改每页显示数量,JS实现动态设置每页显示固定行数
- 火星坐标系、WGS84坐标系、百度坐标系和Web墨卡托坐标系相互转换(基于Python实现)
- 如何用python计算年龄_python根据出生日期计算年龄的代码
- AI能力在智慧养殖应用现状
- windows无法完成格式化怎么办?
- ROS:bag数据包内容提取——雷达点云数据和imu数据
- 乔巴机器人 番外篇_乔巴机器人五只合体图+10个小乔巴+【附合体动图】
- centos7 内网设置共享网络文件夹
- linux运行同花顺,wine打不开同花顺软件
- Python 数据处理与分析(六) 设计一个高回报的投资组合(投资回报和风险分析)任务 5:使用Python实现均值-方差组合模型
- 欧拉定理学习20161004
- 31.4k,这是我见过最强横的后台管理系统 !!
- wdr7300千兆版和百兆版区别_tl-wdr7300是百兆还是千兆
- 毕业设计 基于大数据的旅游数据分析与可视化系统
- C++基础习题(计算平行四边形面积)
- 动手学bert课程笔记