原创 PAT (Advanced Level) Practise 1030. Travel Plan (30)

A traveler's map gives the distances between cities along the highways, together with the cost of each highway. Now yo

原创 PAT (Advanced Level) Practise 1026. Table Tennis (30)

A table tennis club has N tables available to the public. The tables are numbered from 1 to N. For any pair of players

原创 PAT (Advanced Level) Practise 1028. List Sorting (25)

Excel can sort records according to any column. Now you are supposed to imitate this function. Input Each input file

原创 PAT (Advanced Level) Practise 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 repre

原创 萬能頭文件#include

include < bits / stdc++ .h> 這個頭文件包含以下等等C++中包含的所有頭文件: #include <iostream> #include <cstdio> #include <cstring> #in

原创 PAT (Advanced Level) Practise 1029. Median (25)

Given an increasing sequence S of N integers, the median is the number at the middle position. For example, the median

原创 PAT (Advanced Level) Practise 1021. Deepest Root (25)

A graph which is connected and acyclic can be considered a tree. The height of the tree depends on the selected root.

原创 PAT (Advanced Level) Practise 1024. Palindromic Number (25)

A number that will be the same when it is written forwards or backwards is known as a Palindromic Number. For example,

原创 HDU1086 You can Solve a Geometry Problem too

Problem DescriptionMany geometry(幾何)problems were designed in the ACM/ICPC. And now, I also prepare a geometry problem

原创 PAT (Advanced Level) Practise 1022. Digital Library (30)

A Digital Library contains millions of books, stored according to their titles, authors, key words of their abstracts

原创 PAT (Advanced Level) Practise 1031. Hello World for U (20)

Given any string of N (>=5) characters, you are asked to form the characters into the shape of U. For example, "hellow

原创 PAT (Advanced Level) Practise 1025. PAT Ranking (25)

Programming Ability Test (PAT) is organized by the College of Computer Science and Technology of Zhejiang University.

原创 PAT (Advanced Level) Practise 1016. Phone Bills (25)

1016. Phone Bills (25) A long-distance telephone company charges its customers by the following rules: Making a l

原创 生成隨機數(生成整數序列和浮點數序列)

#include <cstdio> #include <cstdlib> /* 該函數生成指定界限a與b之間的一個隨機整數(a<b) */ int rand_int(int a, int b) { return rand(

原创 分解質因數

#include <bits/stdc++.h> using namespace std; int main() { int n; scanf("%d", &n); int flag = 1; for (