
pat
奈何辰星无可奈
github: hackerchenzhuo
展开
-
pat 1002 写出这个数 (20 分)
pat 1002 写出这个数 (20 分)https://pintia.cn/problem-sets/994805260223102976/problems/994805324509200384//oj#include<iostream>#include<string>#include<sstream>using namespace ...原创 2019-03-31 19:57:14 · 163 阅读 · 0 评论 -
PAT 1150 Travelling Salesman Problem (25 分)
When shipping goods with containers, we have to be careful not to pack some incompatible goods into the same container, or we might get ourselves in serious trouble. For example, oxidizing agent (氧化剂)...原创 2019-09-22 17:12:03 · 177 阅读 · 0 评论 -
PAT 1147 Heaps (30 分)堆的应用
In computer science, aheapis a specialized tree-based data structure that satisfies the heap property: if P is a parent node of C, then the key (the value) of P is either greater than or equal to (i...原创 2019-09-22 16:46:26 · 207 阅读 · 0 评论 -
PAT 1146 Topological Order (25 分) 拓扑验证
Sample Input:6 81 21 35 25 42 32 63 46 451 5 2 3 6 45 1 2 6 3 45 1 2 3 6 45 2 1 6 3 41 2 3 4 5 6Sample Output:3 4#include<iostream>#include<string>#include<s...原创 2019-09-22 15:33:03 · 196 阅读 · 0 评论 -
晴神PAT 1140 Look-and-say Sequence (20 分)
Look-and-say sequence is a sequence of integers as the following:D, D1, D111, D113, D11231, D112213111, ...Sample Input:1 8Sample Output:1123123111我的代码:#include<iostream>#inc...原创 2019-09-21 16:07:32 · 300 阅读 · 0 评论 -
PAT 1155 Heap Paths (30 分) 堆的判别,利用队列建立二叉树
In computer science, aheapis a specialized tree-based data structure that satisfies the heap property: if P is a parent node of C, then the key (the value) of P is either greater than or equal to (i...原创 2019-09-21 01:34:24 · 162 阅读 · 0 评论 -
PAT 1154 Vertex Coloring 上色问题,简单图论
Aproper vertex coloringis a labeling of the graph's vertices with colors such that no two vertices sharing the same edge have the same color. A coloring using at mostkcolors is called a (proper)k...原创 2019-09-21 00:19:41 · 251 阅读 · 0 评论 -
1152 Google Recruitment (20 分)
The natural constanteis a well known transcendental number(超越数). The first several digits are:e= 2.7182818284590452353602874713526624977572470936999595749669676277240766303535475945713821785251664...原创 2019-09-20 23:18:00 · 180 阅读 · 0 评论 -
【PAT】总结
【1】格式格式问题精确到xx位> #include< iomanip >> cout << fixed << setprecision(1) << 6.000;: 按前置0的形式读取和输出数字:比如读取 0005, 和将5输出为0005> #include<iomanip>>...原创 2019-09-20 22:43:40 · 333 阅读 · 0 评论 -
PAT 1027 Colors in Mars (20 分)
People in Mars represent the colors in their computers in a similar way as the Earth people. That is, a color is represented by a 6-digit number, where the first 2 digits are forRed, the middle 2 dig...原创 2019-09-20 22:10:09 · 152 阅读 · 0 评论 -
PAT 1023 Have Fun with Numbers
Notice that the number 123456789 is a 9-digit number consisting exactly the numbers from 1 to 9, with no duplication. Double it we will obtain 246913578, which happens to be another 9-digit number con...原创 2019-09-20 21:57:13 · 165 阅读 · 0 评论 -
PAT 1019 General Palindromic Number (20 分)
A number that will be the same when it is written forwards or backwards is known as aPalindromic Number. For example, 1234321 is a palindromic number. All single digit numbers are palindromic numbers...原创 2019-09-20 21:37:59 · 148 阅读 · 0 评论 -
PAT 1011 World Cup Betting (20 分)
With the 2010 FIFA World Cup running, football fans the world over were becoming increasingly excited as the best players from the best teams doing battles for the World Cup trophy in South Africa. Si...原创 2019-09-20 19:02:45 · 170 阅读 · 0 评论 -
PAT 1008 Elevator (20 分)
The highest building in our city has only one elevator. A request list is made up withNpositive numbers. The numbers denote at which floors the elevator will stop, in specified order. It costs 6 sec...原创 2019-09-20 18:46:58 · 128 阅读 · 0 评论 -
pat 1004 成绩排名 (20 分)
pat 1004 成绩排名 (20 分)struct kk{ string a; string b;};map<int,kk> stu;//oj#include<iostream>#include<string>#include<sstream>#include<map>usin...原创 2019-03-31 20:29:05 · 207 阅读 · 0 评论 -
PAT 1132 Cut Integer (20 分)
Cutting an integer means to cut a K digits lone integer Z into two integers of (K/2) digits long integers A and B. For example, after cutting Z = 167334, we have A = 167 and B = 334. It is interesting...原创 2019-09-22 17:33:21 · 156 阅读 · 0 评论