团体程序设计天梯赛
团体程序设计天梯赛
SYaoJun
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
团体程序设计天梯赛题解
L1-001 Hello World (5 分)L1-002 打印沙漏 (20 分)L1-003 个位数统计 (15 分)L1-004 计算摄氏温度 (5 分)L1-005 考试座位号 (15 分)L1-006 连续因子 (20 分)L1-007 念数字 (10 分)L1-008 求整数段和 (10 分)L1-009 N个数求和 (20 分)L1-010 比较大小 (10 分)...原创 2019-09-26 10:31:35 · 3377 阅读 · 4 评论
-
L1-078 吉老师的回归 (15 分)
题目链接思路字符串处理合理使用find()函数,当查询不到对应字符串时,返回string::npos。注意输入需要按行读入getline(cin, str)代码#include <iostream>#include <string>using namespace std;int main(){ int m, n; cin>>m>>n; getchar(); int useful = 0; string str, res;原创 2021-07-11 15:18:18 · 909 阅读 · 0 评论 -
L1-022 奇偶分家 (10 分)
#include<cstdio>using namespace std;int main(){ int n,num; scanf("%d", &n); int odd=0,even=0; for(int i=0;i<n;i++){ scanf("%d",&num); if(num&1) odd++; else even++; }...原创 2019-10-04 20:05:28 · 315 阅读 · 0 评论 -
L3-002 特殊堆栈 (30 分)
题目链接知识点:lower_bound(begin, end, value)大于等于value的迭代器位置版本1有序向量#include <iostream>#include <string>#include <algorithm>#include <stack>#include <vector>using names...原创 2019-11-17 11:48:08 · 655 阅读 · 0 评论 -
L2-030 冰岛人 (25 分)★
#include<iostream>#include<map>#include<string>using namespace std;struct Peoson { char sex; string father;};map<string, Peoson> people;int judge(string a, string b) {...原创 2019-10-05 15:13:43 · 601 阅读 · 0 评论 -
L2-021 点赞狂魔 (25 分)
#include<bits/stdc++.h>#include<string>#include<set> #include<map>using namespace std;struct node{ string name; int total,diff;}E[101];bool cmp(node a, node b){ if(a....原创 2019-10-05 15:09:26 · 339 阅读 · 0 评论 -
L2-019 悄悄关注 (25 分)
#include<bits/stdc++.h>#include<string>#include<set> #include<map>using namespace std;int main(){ int m,n; cin>>m; set<string> st; map<string,int> mp...原创 2019-10-05 15:08:07 · 300 阅读 · 0 评论 -
L2-017 人以群分 (25 分)
#include<bits/stdc++.h>using namespace std;const int maxn=1e5+5;int arr[maxn];int main(){ int n; int sum=0,tmp=0; cin>>n; for(int i=0;i<n;i++){ cin>>arr[i]; sum += arr...原创 2019-10-05 15:06:59 · 552 阅读 · 0 评论 -
L2-009 抢红包 (25 分)
#include<cstdio>#include<algorithm>#include<iostream>using namespace std;const int maxn=1e4+5;struct node{ int no,cnt,money;}N[maxn];bool cmp(node a,node b){ if (a.money != ...原创 2019-10-05 14:51:33 · 307 阅读 · 0 评论 -
L2-008 最长对称子串 (25 分)
#include<bits/stdc++.h>using namespace std;int main(){ string str,res="$#"; getline(cin,str); //改造字符串 for(int i=0;i<str.size();i++){ res +=str[i]; res +="#"; } //manacher算法 vect...原创 2019-10-05 14:49:34 · 363 阅读 · 0 评论 -
L2-006 树的遍历 (25 分)
#include<iostream>#include<cstdio>#include<queue>using namespace std;int post[33], in[33];vector<int> level;struct node{ int data; node* left, *right;};node* build_t...原创 2019-10-05 14:47:49 · 315 阅读 · 0 评论 -
L2-005 集合相似度 (25 分)
#include<cstdio>#include<set>#include<vector>#include<iostream>using namespace std;const int maxn=55;int main(){ int n,k,t,tmp; cin>>n; set<int> st[maxn];...原创 2019-10-05 14:47:03 · 343 阅读 · 0 评论 -
L2-004 这是二叉搜索树吗? (25 分)
#include<cstdio>#include<vector>#include<iostream>using namespace std;vector<int> A,post,pre,mir,postm;struct node{ int data; node* left, *right;};void insert(node* &...原创 2019-10-05 14:46:06 · 821 阅读 · 0 评论 -
L2-003 月饼 (25 分)
#include<cstdio>#include<string>#include<algorithm>#include<iostream>using namespace std;struct Cake{ double mount,total,ave;}C[1005];bool cmp(Cake c1, Cake c2){ retur...原创 2019-10-05 14:45:13 · 396 阅读 · 0 评论 -
L1-016 查验身份证 (15 分)
#include<cstdio>#include<cctype>#include<iostream>#include<vector>using namespace std;int weight[18]={7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2};char test[11]={'1','0','X','9',...原创 2019-10-05 14:43:01 · 821 阅读 · 0 评论 -
L1-063 吃鱼还是吃肉 (10 分)
#include<cstdio>#include<iostream>using namespace std;int main(){ int n; cin>>n; int gender,height,weight; for(int i=0;i<n;i++){ cin>>gender>>height>>we...原创 2019-10-04 22:51:50 · 619 阅读 · 0 评论 -
L1-062 幸运彩票 (15 分)
#include<cstdio>int main(){ int n,t; scanf("%d",&t); while(t--){ scanf("%d",&n); int arr[8]={0}; int k=0; do{ arr[k++]=n%10; n /= 10; }while(n!=0); if((arr[0]+arr[1]+arr[2]...原创 2019-10-04 22:51:24 · 1159 阅读 · 3 评论 -
L1-061 新胖子公式 (10 分)
#include<cstdio>#include<iostream>using namespace std;int main(){ double weight,height; cin>>weight>>height; double ans = weight/(height*height); printf("%.1f\n",ans);...原创 2019-10-04 22:50:41 · 935 阅读 · 0 评论 -
L1-060 心理阴影面积 (5 分)
#include<cstdio>using namespace std;int main(){ int m,n; scanf("%d%d",&m,&n); printf("%d",50*(m-n)); return 0;}原创 2019-10-04 22:50:12 · 986 阅读 · 0 评论 -
L1-059 敲笨钟 (20 分)
#include<cstdio>#include<vector>#include<iostream>#include<string>using namespace std;int main(){ int n; scanf("%d",&n); for(int k=0;k<n;k++){ vector<strin...原创 2019-10-04 22:49:42 · 483 阅读 · 0 评论 -
L1-057 PTA使我精神焕发 (5 分)
#include<cstdio>#include<iostream>using namespace std;int main(){ cout<<"PTA shi3 wo3 jing1 shen2 huan4 fa1 !"<<endl; return 0;}原创 2019-10-04 22:48:25 · 384 阅读 · 0 评论 -
L1-056 猜数字 (20 分)
#include<cstdio>#include<iostream>#include<vector>using namespace std;pair<string,int> stu[10005];double abs(double x){ return x>0?x:-x;}int main(){ int n; scanf("...原创 2019-10-04 22:47:53 · 299 阅读 · 0 评论 -
L1-055 谁是赢家 (10 分)
#include<iostream>#include<cstdio>using namespace std;int main(){ int a,b,x,y,z; cin>>a>>b; cin>>x>>y>>z; if(a>b&&x==1&&y==1&&am...原创 2019-10-04 22:47:20 · 410 阅读 · 0 评论 -
L1-054 福到了 (15 分)
#include<cstdio>#include<iostream>#include<vector>#include<string> using namespace std;int main(){ char c; int n; cin>>c>>n; string str; vector<string&...原创 2019-10-04 22:46:42 · 349 阅读 · 0 评论 -
L1-053 电子汪 (10 分)
#include<bits/stdc++.h>int arr[1005]={0};int main(){ int n,m,num; scanf("%d%d",&m,&n); for(int i=0;i<m+n;++i){ printf("Wang!"); } return 0;}原创 2019-10-04 22:46:12 · 494 阅读 · 0 评论 -
L1-052 2018我们要赢 (5 分)
#include<bits/stdc++.h>using namespace std;int main(){ cout<<"2018"<<endl<<"wo3 men2 yao4 ying2 !"<<endl; return 0;}原创 2019-10-04 22:45:42 · 214 阅读 · 0 评论 -
L1-051 打折 (5 分)
#include<cstdio>using namespace std;int main(){ int m,n; scanf("%d%d",&m,&n); printf("%.2f",m*0.1*n); return 0;}原创 2019-10-04 22:45:12 · 414 阅读 · 0 评论 -
L1-050 倒数第N个字符串 (15 分)
#include<cstdio>#include<cmath>#include<iostream>using namespace std;int main(){ int n,m; cin>>n>>m; int arr[10]={0}; int k=0; int temp=pow(26,n)-m; do{ arr[k...原创 2019-10-04 22:44:43 · 219 阅读 · 0 评论 -
L1-049 天梯赛座位分配 (20 分)
#include<cstdio>#include<iostream>#include<vector>using namespace std;int arr[105];int main(){ int n,sum=0; cin>>n; for(int i=0;i<n;i++){ cin>>arr[i]; sum...原创 2019-10-04 22:43:47 · 286 阅读 · 0 评论 -
L1-048 矩阵A乘以B (15 分)
#include<iostream>#include<cstring>#include<cstdio>using namespace std;int A[105][105];int B[105][105];int C[105][105];int main(){ int a,b,x,y; memset(A,0,sizeof(A)); memse...原创 2019-10-04 22:43:16 · 281 阅读 · 0 评论 -
L1-047 装睡 (10 分)
#include<iostream>#include<cstdio>#include<string>using namespace std;int main(){ int n; cin>>n; string name; int respiration, pulse; for(int i=0;i<n;i++){ cin>...原创 2019-10-04 22:42:45 · 618 阅读 · 0 评论 -
L1-045 宇宙无敌大招呼 (5 分)
#include<cstdio>int main(){ char str[100]; scanf("%s",str); printf("Hello %s",str); return 0;}原创 2019-10-04 22:41:47 · 1092 阅读 · 0 评论 -
L1-044 稳赢 (15 分)
#include<iostream>#include<cstdio>#include<string>using namespace std;int main(){ int k; cin>>k; string str; k++; int i=0; while(cin>>str){ if(str=="End") bre...原创 2019-10-04 22:41:00 · 266 阅读 · 0 评论 -
L1-043 阅览室 (20 分)
#include<cstdio>#include<cstring>#include<iostream>using namespace std;int Hash[1005];int last[1005];int main(){ int n; scanf("%d",&n); for(int k=0;k<n;k++){ int no...原创 2019-10-04 22:40:28 · 1150 阅读 · 0 评论 -
L1-042 日期格式化 (5 分)
#include<cstdio>int main(){ int y,m,d; scanf("%d-%d-%d",&m,&d,&y); printf("%04d-%02d-%02d",y,m,d ); return 0;}原创 2019-10-04 22:39:48 · 561 阅读 · 0 评论 -
L1-041 寻找250 (10 分)
#include<bits/stdc++.h>int main(){ int num,cnt=0; while(scanf("%d",&num)!=EOF){ cnt++; if(num==250){ printf("%d",cnt); break; } } return 0;}原创 2019-10-04 22:38:47 · 579 阅读 · 0 评论 -
L1-040 最佳情侣身高差 (10 分)
#include <iostream>using namespace std;int main(){ int N; scanf("%d",&N);// cin>>N; for(int i = 0; i < N; i++){ char X; float height;// scanf("%c %f", &X,&heigh...原创 2019-10-04 22:38:19 · 800 阅读 · 0 评论 -
L1-038 新世界 (5 分)
#include<cstdio>int main(){ printf("Hello World\nHello New World"); return 0;}原创 2019-10-04 22:37:23 · 439 阅读 · 0 评论 -
L1-037 A除以B (10 分)
#include<iostream>#include<cstdio>using namespace std;int main(){ int a,b; cin>>a>>b; if(b<0) printf("%d/(%d)=%.2f",a,b,a*1.0/b); else if(b==0) printf("%d/%d=Error",a...原创 2019-10-04 22:36:23 · 473 阅读 · 0 评论 -
L1-036 A乘以B (5 分)
#include<cstdio>#include<iostream>using namespace std;int main(){ int a,b; cin>>a>>b; cout<<a*b<<endl; return 0;}原创 2019-10-04 22:35:53 · 275 阅读 · 0 评论
分享