随笔分类 -  PAT (Advanced Level) Practice

上一页 1 2

1035 Password
摘要:水题~ 用string特别方便 #include <iostream> #include <cstring> #include <string> #include <sstream> #include <string> #include <cstdio> #include <cmath> #incl 阅读全文

posted @ 2018-12-10 23:31 FTA_Macro 阅读(136) 评论(0) 推荐(0)

1015 Reversible Primes
摘要:20分的题居然要预处理素数,记得数组开100005。 这题有个小坑就是输入进去的数是按十进制数判断素数,反转的时候是先把它变成d进制数,再反转,再求其十进制数。 #include<iostream> #include<algorithm> #include<cstdio> #include<cmat 阅读全文

posted @ 2018-12-09 21:23 FTA_Macro 阅读(166) 评论(0) 推荐(0)

1010 Radix
摘要:超级大坑题,无进制范围。 可能超级大,要用ull。 既然这么大,二分来帮忙。 左边要最大,右边是数值。 tag小麻烦,处理看代码。 #include<iostream> #include<algorithm> #include<cstdio> #include<cmath> #include<str 阅读全文

posted @ 2018-12-09 20:51 FTA_Macro 阅读(177) 评论(0) 推荐(0)

1011 World Cup Betting
摘要:水题~ 题目大意每行选一个最大的,套公式就好了 #include <iostream> #include <cstring> #include <string> #include <sstream> #include <string> #include <cstdio> #include <cmat 阅读全文

posted @ 2018-12-07 00:05 FTA_Macro 阅读(118) 评论(0) 推荐(0)

1027 Colors in Mars
摘要:题目大意就是10进制转13进制 数据居然只有0到168 超级大水题~ #include <iostream> #include <cstring> #include <string> #include <sstream> #include <string> #include <cstdio> #in 阅读全文

posted @ 2018-12-06 20:22 FTA_Macro 阅读(134) 评论(0) 推荐(0)

1084 Broken Keyboard
摘要:水题~ 老是忘记数字和字母的ASCII码。 把两个字符串逐一比较,没有的输出(用数组标记是否输出过) #include<iostream> #include<algorithm> #include<cstdio> #include<string.h> #define maxn 105 using n 阅读全文

posted @ 2018-12-04 21:55 FTA_Macro 阅读(207) 评论(0) 推荐(0)

1028 List Sorting
摘要:这题用string和cin会超时,所以要用char。 2个小知识点。 1.id用int类型,输出时用%06d输出 2.strcmp比较char类型字符串,若str1==str2,则返回零;若str1<str2,则返回负数;若str1>str2,则返回正数。 #include<iostream> #i 阅读全文

posted @ 2018-12-04 21:11 FTA_Macro 阅读(274) 评论(0) 推荐(0)

1031 Hello World for U
摘要:水题~ N为字符串长度,n1=n3为竖着的个数,n2是横着的个数 n1=n3=(N+2-(N+2)%3)/3,也就是向下接近能整出3的数 #include<iostream> #include<algorithm> #include<string.h> #define maxn 100 using 阅读全文

posted @ 2018-12-04 20:19 FTA_Macro 阅读(183) 评论(0) 推荐(0)

1009 Product of Polynomials
摘要:和之前多项式求和类似,注意筛0和输出即可。水题~ #include <iostream> #include <cstring> #include <string> #include <sstream> #include <string> #include <cstdio> #include <cma 阅读全文

posted @ 2018-12-03 12:57 FTA_Macro 阅读(152) 评论(0) 推荐(0)

1007 Maximum Subsequence Sum
摘要:一开始以为用前缀和做,看了下数据10000,果断放弃。 思考了一下,最大和序列的第一个数必为正数(废话),关键是从头开始的子序列和也必为正数。如果加到某个地方和为负数,我还要你前面这些数何用,不如从后面开始重新选。基于上述思路就可以写出代码了。 #include <iostream> #includ 阅读全文

posted @ 2018-11-30 22:45 FTA_Macro 阅读(123) 评论(0) 推荐(0)

1006 Sign In and Sign Out
摘要:水题~ #include<iostream> #include<algorithm> #include<string.h> #define maxn 25 using namespace std; typedef long long ll; char s[maxn],ttime[10]; int m 阅读全文

posted @ 2018-11-27 21:22 FTA_Macro 阅读(102) 评论(0) 推荐(0)

1005 Spell It Right
摘要:开个string数组存数字英文。 因为数为10100,所以和最多为900,int求和就够了。水题~ #include<iostream> #include<algorithm> #include<string.h> #define maxn 25 using namespace std; typed 阅读全文

posted @ 2018-11-27 20:58 FTA_Macro 阅读(95) 评论(0) 推荐(0)

1023 Have Fun with Numbers
摘要:因为最多有20个字符,int和long long都不行,所以只能用字符串操作。水题~ #include<iostream> #include<algorithm> #include<string.h> #define maxn 25 using namespace std; typedef long 阅读全文

posted @ 2018-11-27 20:10 FTA_Macro 阅读(71) 评论(0) 推荐(0)

1008 Elevator
摘要:水题~ #include <iostream> #include <cstring> #include <string> #include <sstream> #include <string> #include <cstdio> #include <algorithm> #include <vec 阅读全文

posted @ 2018-11-26 23:06 FTA_Macro 阅读(118) 评论(0) 推荐(0)

1002 A+B for Polynomials
摘要:水题~ 最好是把得到所有的幂放在一个数组里,然后排序去重,不过这题的幂最大只有1000,所以这么写了。 一开始没看到保留一位小数,wa了一发,难受。 #include <iostream> #include <cstring> #include <string> #include <sstream> 阅读全文

posted @ 2018-11-26 20:47 FTA_Macro 阅读(145) 评论(0) 推荐(0)

1001 A+B Format
摘要:这道水题有个巨坑:1000的输出是1,000而不是100,0。因为这个改了一早上代码。 还有一个要注意的是和为0的时候,这个简单。 #include <iostream> #include <cstring> #include <string> #include <sstream> #include 阅读全文

posted @ 2018-11-26 12:19 FTA_Macro 阅读(199) 评论(0) 推荐(0)

上一页 1 2

导航