pat甲级
Hydr-a
这个作者很懒,什么都没留下…
展开
-
1001 A+B Format
#include<iostream>#include<algorithm>using namespace std;int main(){ int a, b; scanf("%d%d", &a, &b); int sum = a + b; if(sum < 0) { printf("-"); sum = -sum; } string s = to_string(sum), s1; int len = s.length(); int c原创 2021-03-17 19:41:48 · 70 阅读 · 0 评论 -
1061 Dating
#include<iostream>#include<algorithm>using namespace std;string a[7] = {"MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"};int main(){ string s1, s2, s3, s4; cin >> s1 >> s2 >> s3 >> s4; int flag = 0; for(int i = 0原创 2021-03-16 20:47:40 · 41 阅读 · 0 评论 -
1058 A+B in Hogwarts
#include<iostream>#include<algorithm>using namespace std;int main(){ long long a1, b1, c1, a2, b2, c2; scanf("%lld.%lld.%lld %lld.%lld.%lld", &a1, &b1, &c1, &a2, &b2, &c2); long long sum = (a1 + a2) * 29 * 17 + (b1原创 2021-03-16 16:23:53 · 35 阅读 · 0 评论 -
1027 Colors in Mars
#include<iostream>#include<algorithm>using namespace std;char a[13] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C'};int main(){ int r, g, b; scanf("%d%d%d", &r, &g, &b); printf("#"); printf("%c%c", a[r /原创 2021-03-16 16:05:51 · 36 阅读 · 0 评论 -
1019 General Palindromic Number
#include<iostream>#include<algorithm>#include<vector>using namespace std;int main(){ int n, b, flag = 0; vector<int> v; cin >> n >> b; if(n == 0) { printf("Yes\n0"); return 0; } while(n){ int temp = n % b原创 2021-03-16 15:19:41 · 49 阅读 · 0 评论 -
1031 Hello World for U
#include<iostream>#include<cstdio>#include<cstring>using namespace std;int main(){ string s; cin >> s; int len = s.length(); int nL = 1, nR = 1, cnt = 0, n1, i; for(nL = 1; nL <= n1; nL++, n1 = len + 2 - 2 * nL); nL--;原创 2021-03-15 20:19:20 · 54 阅读 · 0 评论 -
1036 Boys vs Girls
#include<iostream>#include<algorithm>#include<cmath>#include<map>using namespace std;struct node{ string name, gen, sub; int sc;}stu;int main(){ int n, max1 = -1, min1 = 101; string str1, str2, str11, str22; scanf("%d",原创 2021-03-15 20:18:42 · 50 阅读 · 0 评论 -
1006 Sign In and Sign Out
#include<iostream>#include<algorithm>#include<cmath>#include<map>using namespace std;int main(){ int n; scanf("%d", &n); string str, str1, str2; int hh1, mm1, ss1, hh2, mm2, ss2, min = 999999, max = -1; for(int i = 0;原创 2021-03-15 20:17:59 · 44 阅读 · 0 评论 -
1011 World Cup Betting
#include<iostream>#include<algorithm>#include<cmath>#include<map>using namespace std;char s[3] = {'W', 'T', 'L'};int main(){ double ans = 1.0, tmp, a; int idx; for(int i = 0; i < 3; i++){ tmp = 0.0; for(int j = 0; j原创 2021-03-15 20:17:20 · 42 阅读 · 0 评论 -
1009 Product of Polynomials
#include<iostream>#include<algorithm>#include<cmath>#include<map>using namespace std;struct node{ int exp; double coe;}a[30], b[30];map<int, double> c;int main(){ int n1, n2, cnt = 0; scanf("%d", &n1); for(原创 2021-03-15 20:16:17 · 47 阅读 · 0 评论 -
1002 A+B for Polynomials
#include<iostream>using namespace std;struct node{ int exp; double coe;}a[30], b[30], c[30];int main(){ int n1, n2; scanf("%d", &n1); for(int i = 0; i < n1; i++){ scanf("%d%lf", &a[i].exp, &a[i].coe); } scanf("%d", &am原创 2021-03-14 19:32:28 · 39 阅读 · 0 评论 -
1065 A+B and C (64bit)
#include<iostream>#include<algorithm>#include<cmath>using namespace std;typedef long long ll;int main(){ ll a, b, c, n; scanf("%lld", &n); for(ll i = 0; i < n; i++){ scanf("%lld%lld%lld", &a, &b, &原创 2021-03-13 21:35:33 · 53 阅读 · 0 评论 -
1042 Shuffling Machine
#include<iostream>using namespace std;int a[55];string s[55] = {"", "S1", "S2", "S3", "S4", "S5", "S6", "S7", "S8", "S9", "S10", "S11", "S12", "S13", "H1", "H2", "H3", "H4", "H5", "H6", "H7", "H8", "H9", "H10", "H11", "H12", "H13", "C1", "原创 2021-03-13 20:31:40 · 49 阅读 · 0 评论 -
1046 Shortest Distance
#include<iostream>#include<algorithm>using namespace std;int main(){ int n, n1; scanf("%d", &n); int dis[n + 1], sum[n + 1]; sum[0] = 0; for(int i = 1; i <= n; i++){ scanf("%d", &dis[i]); sum[i] = dis[i] + sum[i -原创 2021-03-13 20:29:59 · 63 阅读 · 0 评论