PAT
文章平均质量分 70
jackiewoo_
这个作者很懒,什么都没留下…
展开
-
PAT A1016. Phone Bills (25)
Phone Bills (25)时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue A long-distance telephone company charges its customers by the following rules:Making a long-distanc...原创 2018-02-26 10:31:52 · 143 阅读 · 0 评论 -
1017. Queueing at Bank (25)
Queueing at Bank (25)时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Suppose a bank has K windows open for service. There is a yellow line in front of the windows whi...原创 2018-02-26 14:51:42 · 80 阅读 · 0 评论 -
PAT A1019. General Palindromic Number (20)
General Palindromic Number (20)时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue A number that will be the same when it is written forwards or backwards is known as a P...原创 2018-02-26 16:06:29 · 89 阅读 · 0 评论 -
PAT A1020. Tree Traversals (25)
Tree Traversals (25)时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Suppose that all the keys in a binary tree are distinct positive integers. Given the postorder and...原创 2018-02-26 19:19:53 · 85 阅读 · 0 评论 -
PAT A1023. Have Fun with Numbers (20)
Have Fun with Numbers (20)时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Notice that the number 123456789 is a 9-digit number consisting exactly the numbers from 1 t...原创 2018-02-26 20:28:09 · 168 阅读 · 0 评论 -
PAT A1024. Palindromic Number (25)
Palindromic Number (25)时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue A number that will be the same when it is written forwards or backwards is known as a Palindrom...原创 2018-02-26 21:46:33 · 81 阅读 · 0 评论 -
PAT A1025. PAT Ranking (25)
PAT Ranking (25)时间限制 200 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Programming Ability Test (PAT) is organized by the College of Computer Science and Technology of Zheji...原创 2018-02-26 22:24:26 · 120 阅读 · 0 评论 -
PAT A1021. Deepest Root (25)
Deepest Root (25)时间限制 1500 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue A graph which is connected and acyclic can be considered a tree. The height of the tree depends on t...原创 2018-02-26 22:30:35 · 110 阅读 · 0 评论 -
PAT A1022. Digital Library (30)
Digital Library (30)时间限制 1000 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue A Digital Library contains millions of books, stored according to their titles, authors, key word...原创 2018-02-26 23:41:50 · 110 阅读 · 0 评论 -
PAT A1027. Colors in Mars (20)
Colors in Mars (20)时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue People in Mars represent the colors in their computers in a similar way as the Earth people. That i...原创 2018-02-27 09:13:24 · 73 阅读 · 0 评论 -
PAT A1028. List Sorting (25)
List Sorting (25)时间限制 200 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Excel can sort records according to any column. Now you are supposed to imitate this function.Input...原创 2018-02-27 09:30:35 · 82 阅读 · 0 评论 -
PAT A1029. Median (25)
Median (25)时间限制 1000 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Given an increasing sequence S of N integers, the median is the number at the middle position. For example...原创 2018-02-27 09:45:22 · 134 阅读 · 0 评论 -
PAT A1030. Travel Plan (30)
Travel Plan (30)时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue A traveler’s map gives the distances between cities along the highways, together with the cost of each...原创 2018-02-27 10:24:42 · 91 阅读 · 0 评论 -
PAT A1031. Hello World for U (20)
Hello World for U (20)时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Given any string of N (>=5) characters, you are asked to form the characters into the shape o...原创 2018-02-27 13:12:40 · 108 阅读 · 0 评论 -
PAT A1032. Sharing (25)
Sharing (25)时间限制 100 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue To store English words, one method is to use linked lists and store a word letter by letter. To save some ...原创 2018-02-27 13:41:06 · 209 阅读 · 0 评论 -
PAT A1036. Boys vs Girls (25)
Boys vs Girls (25)时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue This time you are asked to tell the difference between the lowest grade of all the male students and...原创 2018-02-27 14:52:39 · 112 阅读 · 0 评论 -
PAT A1035. Password (20)
Password (20)时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue To prepare for PAT, the judge sometimes has to generate random passwords for the users. The problem is th...原创 2018-02-27 14:54:17 · 98 阅读 · 0 评论 -
PAT A1037. Magic Coupon (25)
Magic Coupon (25)时间限制 100 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue The magic shop in Mars is offering some magic coupons. Each coupon has an integer N printed on it, me...原创 2018-02-27 15:06:53 · 104 阅读 · 0 评论 -
万妖穴
拓扑排序#include<cstdio>#include<vector>#include<queue>#include<algorithm>using namespace std;const int maxn=1002;vector<int>G[maxn];int Din[maxn]={0};int n,m;in...原创 2018-03-06 23:10:21 · 309 阅读 · 0 评论 -
PAT 1139 First Contact
First Contact (30)时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Unlike in nowadays, the way that boys and girls expressing their feelings of love was quite subtle i...原创 2018-02-14 08:55:56 · 477 阅读 · 0 评论 -
PAT 1013 Battle Over Cities
Battle Over Cities (25)时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue It is vitally important to have all the cities connected by highways in a war. If a city is occ...原创 2018-02-14 08:58:36 · 84 阅读 · 0 评论 -
PAT 1021.Deepest Root
Deepest Root (25)时间限制 1500 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue A graph which is connected and acyclic can be considered a tree. The height of the tree depends on...原创 2018-02-14 10:40:08 · 94 阅读 · 0 评论 -
PAT A1038. Recover the Smallest Number (30)
Recover the Smallest Number (30)时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Given a collection of number segments, you are supposed to recover the smallest number...原创 2018-02-27 16:08:37 · 87 阅读 · 0 评论 -
1034. Head of a Gang (30)
Head of a Gang (30)时间限制 100 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue One way that the police finds the head of a gang is to check people’s phone calls. If there is a ph...原创 2018-02-27 17:29:42 · 109 阅读 · 0 评论 -
PAT 1034. Head of a Gang(30)
Head of a Gang (30)时间限制 100 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue One way that the police finds the head of a gang is to check people’s phone calls. If there is a ph...原创 2018-02-14 12:49:58 · 113 阅读 · 0 评论 -
PAT 1076. Forwards on Weibo (30)
Forwards on Weibo (30)时间限制 3000 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Weibo is known as the Chinese version of Twitter. One user on Weibo may have many followers, an...原创 2018-02-14 14:23:41 · 88 阅读 · 0 评论 -
PAT 1003. Emergency
Emergency (25)时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue As an emergency rescue team leader of a city, you are given a special map of your country. The map shows...原创 2018-02-14 15:28:05 · 74 阅读 · 0 评论 -
PAT A1018 Public Bike Management
Public Bike Management (30)时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue There is a public bike service in Hangzhou City which provides great convenience to the tou...原创 2018-02-14 20:07:03 · 112 阅读 · 0 评论 -
PAT A1132. Cut Integer
Cut Integer (20)时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Cutting an integer means to cut a K digits long integer Z into two integers of (K/2) digits long integ...原创 2018-02-14 21:10:31 · 163 阅读 · 0 评论 -
PAT A1033. Splitting A Linked List (25)
Splitting A Linked List (25)时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Given a singly linked list, you are supposed to rearrange its elements so that all the neg...原创 2018-02-14 21:48:25 · 148 阅读 · 1 评论 -
PAT A1041. Be Unique (20)
Be Unique (20)时间限制 100 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Being unique is so important to people on Mars that even their lottery is designed in a unique way. The ...原创 2018-02-27 18:44:39 · 77 阅读 · 0 评论 -
PAT A1039. Course List for Student (25)
Course List for Student (25)时间限制 200 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Zhejiang University has 40000 students and provides 2500 courses. Now given the student na...原创 2018-02-27 19:26:04 · 106 阅读 · 0 评论 -
PAT A1040. Longest Symmetric String (25)
Longest Symmetric String (25)时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Given a string, you are supposed to output the length of the longest symmetric sub-string...原创 2018-02-27 19:47:31 · 72 阅读 · 0 评论 -
PAT A1042. Shuffling Machine (20)
Shuffling Machine (20)时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Shuffling is a procedure used to randomize a deck of playing cards. Because standard shuffling t...原创 2018-02-27 20:19:24 · 89 阅读 · 0 评论 -
PAT A1034. Vertex Cover (25)
Vertex Cover (25)时间限制 600 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue A vertex cover of a graph is a set of vertices such that each edge of the graph is incident to at lea...原创 2018-02-15 13:29:07 · 168 阅读 · 0 评论 -
PAT A1102. Invert a Binary Tree (25)
Invert a Binary Tree (25)时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue The following is from Max Howell @twitter:Google: 90% of our engineers use the software you...原创 2018-02-15 13:30:55 · 120 阅读 · 0 评论 -
PAT A1100 Mars numbers (20)
Mars Numbers (20)时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue People on Mars count their numbers with base 13:Zero on Earth is called “tret” on Mars. The number...原创 2018-02-15 13:33:08 · 172 阅读 · 0 评论 -
PAT A1104. Sum of Number Segments (20)
#include<cstdio>int main(){ double v,ans=0; int n; scanf("%d",&n); for(int i=1;i<=n;i++){ scanf("%lf",&v); ans+=(v*(n+1-i)*i);//此处v必须在左边。写成(n+1-i)*i...原创 2018-02-15 15:19:44 · 188 阅读 · 0 评论 -
PAT A1105. Spiral Matrix (25)
Spiral Matrix (25)时间限制 150 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue This time your job is to fill a sequence of N positive integers into a spiral matrix in non-increasi...原创 2018-02-15 21:07:23 · 84 阅读 · 0 评论 -
PAT A1106. Lowest Price in Supply Chain (25)
Lowest Price in Supply Chain (25)时间限制 200 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)–...原创 2018-02-15 21:09:51 · 93 阅读 · 0 评论