- 博客(13)
- 资源 (2)
- 收藏
- 关注
原创 PAT(甲级)1110 Complete Binary Tree (25 分) 经验分享与心路历程
无计时训练,得21分 // 1110 Complete Binary Tree (25 分).cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 // #include <bits/stdc++.h> using namespace std; struct node { int val; node* left; node* right; int level; node() { left = right = NU
2021-03-08 11:33:58 138
原创 PAT(甲级)1108 Finding Average (20 分) 经验分享与心路历程
用了39分钟,满分 // 1108 Finding Average (20 分).cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 // #include <bits/stdc++.h> using namespace std; vector<double> legal; int main() { #ifndef ONLINE_JUDGE FILE* s; freopen_s(&s, "in.txt", "r", stdin)
2021-03-08 10:03:07 152
原创 PAT(甲级)1106 Lowest Price in Supply Chain (25 分) 经验分享与心路历程
做了24分钟,满分 // 1106 Lowest Price in Supply Chain (25 分).cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 // #include <bits/stdc++.h> using namespace std; #define max 10000000000 vector<vector<int>> supply_chain; unordered_map<int, bool> have_p
2021-03-07 11:11:12 279
原创 PAT(甲级)1104 Sum of Number Segments (20 分) 经验分享与心路历程
未计时,得15分,测试点3,4超时 // 1104.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 // #include <bits/stdc++.h> using namespace std; vector<double> sequence; int main() { #ifndef ONLINE_JUDGE FILE* s; freopen_s(&s, "in.txt", "r", stdin); #endif //.
2021-03-06 15:02:05 124
原创 PAT(甲级)2019年冬季考试 7-4 Cartesian Tree (30 分) 经验分享与心路历程
做了20分钟,过样例 // Cartesian Tree.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 // #include <bits/stdc++.h> using namespace std; struct node { int val; node* left; node* right; node() { left = right = NULL; } }; vector<int> i
2021-03-05 22:00:24 179
原创 PAT(甲级)2020年春季考试 7-3 Safari Park (25 分)经验分享与心路历程
做了23分钟,过样例 // 7-3.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 // #include <bits/stdc++.h> using namespace std; vector<unordered_map<int, bool>> neighbor; int main() { #ifndef ONLINE_JUDGE FILE* s; freopen_s(&s, "in.txt", "r", st
2021-03-05 14:25:40 161
原创 PAT(甲级)2020年春季考试 7-2 The Judger (25 分) 经验分享与心路历程
做了1个小时,过样例 #include <bits/stdc++.h> using namespace std; unordered_map<int, bool> exist; unordered_map<int, bool> difference; vector<vector<int>> input; //玩家的下标是直接从1到n开始的 unordered_map<int, bool> out_game; int main
2021-03-05 12:20:07 227
原创 PAT(甲级)2020年春季考试 7-1 Prime Day (20 分) 经验分享与心路历程
做了15分钟,过样例 // 7-1.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 // #include <bits/stdc++.h> using namespace std; bool is_prime(int n) { if (n <= 1)return false; for (int i = 2, sqr = sqrt(n); i <= sqr; i++) { if (n % i == 0)return fa
2021-03-05 10:15:16 210 1
原创 PAT(甲级)2020年秋季考试 7-3 Left-View of Binary Tree (25 分) 经验分享与心路历程
30分钟,过样例,最近都在整理过去的错题,来有意识的去记忆一些常考的模板,等考好我会把最后整理好的笔记发出来的 #include <bits/stdc++.h> using namespace std; struct node { int val; node* left; node* right; int level; node() { left = right = NULL; } }; vector<node>
2021-03-03 20:26:20 193 1
原创 PAT(甲级)2020年秋季考试 7-4 Professional Ability Test 经验分享与心路历程
#include <bits/stdc++.h> using namespace std; struct test { int score; int voucher; }; vector<unordered_map<int, test>> relation; //map里面的int表示的是课程的一个代号,表示参加这门考试的先前条件 //test是边上面保存的信息,通过需要的最小分数和可以获得的代金券 unordered_map<int, boo.
2021-03-03 17:08:51 797 1
原创 PAT2019年秋季 7-1 Forever (20 分)经验分享与心路历程
#include <bits/stdc++.h> using namespace std; //写中文注释来环节编码的压力 struct info { int n; int a; }; vector<info> ans; int digitsum(int x) { int sum = 0; string t = to_string(x); for (int i = 0; i < t.size(); i++) { s.
2021-03-03 15:16:13 220 2
原创 PAT2019年秋季 7-2 Merging Linked Lists (25 分) 经验分享与心路历程
7-2 Merging Linked Lists (25 分) Given two singly linked listsL1=a1→a2→⋯→an−1→anandL2=b1→b2→⋯→bm−1→bm. Ifn≥2m, you are supposed to reverse and merge the shorter one into the longer one to obtain a list likea1→a2→bm...
2021-03-03 00:01:20 282
原创 PAT2019年秋季 7-3 Postfix Expression (25 分) 经验分享与心路历程
7-3 Postfix Expression (25 分) Given a syntax tree (binary), you are supposed to output the corresponding postfix expression, with parentheses reflecting the precedences of the operators. Input Specification: Each input file contains one test case. For e
2021-03-02 21:08:08 222
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人