摘要: 分析: PPPATTTTPAT 第一个A的左边有3个P,右边有5个T,此时PAT共有15个。 第二个A的左边有4个P,右边有1个T,此时PAT共有4个。 这个字符串包含的PAT总共有19个。 总结,只要知道每个A的左边共有m个P,右边共有n个T,此时PAT的个数位即为m*n; #include<io 阅读全文
posted @ 2020-02-19 12:26 tangq123 阅读(235) 评论(0) 推荐(0) 编辑
摘要: 较水。 #include<iostream> using namespace std; int hashtable1[300] = {0},hashtable2[300]= {0}; int main() { string str1,str2; cin>>str1>>str2; for(int i 阅读全文
posted @ 2020-02-19 12:13 tangq123 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 水题。 #include<iostream> using namespace std; int hashtable[111]= {0}; //成绩与人数的映射 int main() { int n,score,k; cin>>n; for(int i = 0; i < n; ++i) { scanf 阅读全文
posted @ 2020-02-19 12:11 tangq123 阅读(87) 评论(0) 推荐(0) 编辑
摘要: 水题。 #include<iostream> #include<algorithm> using namespace std; typedef long long LL; int main() { LL G1,S1,K1,G2,S2,K2; scanf("%lld.%lld.%lld %lld.%l 阅读全文
posted @ 2020-02-19 12:10 tangq123 阅读(76) 评论(0) 推荐(0) 编辑
摘要: 水题。 #include<iostream> #include<cmath> using namespace std; int main() { int n,m; char c; cin>>n>>c; m = round(n/2.0)-2;//行数 for(int i =0; i< n; ++i)/ 阅读全文
posted @ 2020-02-19 12:09 tangq123 阅读(115) 评论(0) 推荐(0) 编辑
摘要: 第一种方法。 直接模拟插入排序和非递归的归并排序。。。 #include<iostream> #include<algorithm> using namespace std; int n; int a[111] = {0},b[111]= {0},temp[111] = {0}; bool flag 阅读全文
posted @ 2020-02-18 16:43 tangq123 阅读(321) 评论(0) 推荐(0) 编辑
摘要: 这是一种套路题,需要记住大体流程,然后反复练习。 注意点: 因为题目给出的整数可能超过int范围,所以整数都必须用long long型存放,不然最后两个测试点过不去。 #include<iostream> #include<algorithm> using namespace std; typede 阅读全文
posted @ 2020-02-18 16:36 tangq123 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 注意点: 一,下划线 _(代表空格),接收输入是真的空格,所以要用getline接收一行输入。 二,判断大写字母能否输出,必须同时上档键+和小写字母的键都未坏。 #include<iostream> #include<cctype> using namespace std; string str1, 阅读全文
posted @ 2020-02-18 16:33 tangq123 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 水题。 #include<iostream> using namespace std; int a[100010]= {0}; int main() { int n,num,score,max = -1,pos = -1; cin>>n; for(int i = 0; i < n; ++i) { c 阅读全文
posted @ 2020-02-18 16:29 tangq123 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 注意点: 一,加权求和表示,每一位乘以该位的权值最后求和,只对前17位加权求和。 新学一招,整型到字符的hash。 string hashtable = "10X98765432"; #include<iostream> #include<cctype> using namespace std; s 阅读全文
posted @ 2020-02-18 16:28 tangq123 阅读(186) 评论(0) 推荐(0) 编辑