自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(149)
  • 资源 (1)
  • 收藏
  • 关注

原创 消息传递接口CCF

试题编号: 201903-4 试题名称: 消息传递接口 时间限制: 1.0s 内存限制: 512.0MB 问题描述: #include<bits/stdc++.h>using namespace std;struct node{ int flag,t; node(string& s,int &a...

2019-08-26 22:52:51 480

原创 ccf 201903-1

#include<iostream>#include<cstdio> #include<vector>#include<algorithm>using namespace std;int main(){ int n; int max,min; double med; vector<int> v; cin >&g...

2019-07-09 23:26:17 193

原创 1103 Integer Factorization (30 分)

1103 Integer Factorization (30 分)The K−PK-PK−P factorization of a positive integer NNN is to write NNN as the sum of the PPP-th power of KKK positive integers. You are supposed to write a program to...

2019-03-02 10:20:15 299

原创 1102 Invert a Binary Tree (25 分)

1102 Invert a Binary Tree (25 分)The following is from Max Howell @twitter:Google: 90% of our engineers use the software you wrote (Homebrew), but you can't invert a binary tree on a whiteboard so...

2019-03-02 09:39:31 207

原创 1101 Quick Sort (25 分)

1101 Quick Sort (25 分)There is a classical process named partition in the famous quick sort algorithm. In this process we typically choose one element as the pivot. Then the elements less than the p...

2019-03-02 00:02:28 192

原创 1100 Mars Numbers (20 分)

1100 Mars Numbers (20 分)People on Mars count their numbers with base 13:Zero on Earth is called "tret" on Mars. The numbers 1 to 12 on Earth is called "jan, feb, mar, apr, may, jun, jly, aug, sep...

2019-03-01 16:55:39 319

原创 1107 Social Clusters (30 分)

1107 Social Clusters (30 分)When register on a social network, you are always asked to specify your hobbies in order to find some potential friends with the same hobbies. A social cluster is a set of...

2019-03-01 16:00:48 418

原创 1106 Lowest Price in Supply Chain (25 分)

1106 Lowest Price in Supply Chain (25 分)A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer.Start...

2019-03-01 13:01:58 243

原创 1104 Sum of Number Segments (20 分)

1104 Sum of Number Segments (20 分)Given a sequence of positive numbers, a segment is defined to be a consecutive subsequence. For example, given the sequence { 0.1, 0.2, 0.3, 0.4 }, we have 10 segme...

2019-02-28 23:28:55 242

原创 1110 Complete Binary Tree (25 分)

1110 Complete Binary Tree (25 分)Given a tree, you are supposed to tell if it is a complete binary tree.Input Specification:Each input file contains one test case. For each case, the first line g...

2019-02-28 17:10:15 516

原创 1109 Group Photo (25 分)

1109 Group Photo (25 分)Formation is very important when taking a group photo. Given the rules of forming K rows with N people as the following: The number of people in each row must be N/K (round...

2019-02-28 15:55:08 151

原创 1108 Finding Average (20 分)

1108 Finding Average (20 分)The basic task is simple: given N real numbers, you are supposed to calculate their average. But what makes it complicated is that some of the input numbers might not be l...

2019-02-27 22:51:11 496

原创 1115 Counting Nodes in a BST (30 分)

1115 Counting Nodes in a BST (30 分)A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties:The left subtree of a node contains only nodes with keys le...

2019-02-27 20:07:02 290

原创 1114 Family Property (25 分)

1114 Family Property (25 分)This time, you are supposed to help us collect the data for family-owned property. Given each person's family members, and the estate(房产)info under his/her own name, we ne...

2019-02-27 19:40:27 226

原创 1113 Integer Set Partition (25 分)

1113 Integer Set Partition (25 分)Given a set of NNN (&gt;1&gt; 1&gt;1) positive integers, you are supposed to partition them into two disjoint sets A1A_1A​1​​ and A2A_2A​2​​ of n1n_1n​1​​ and n2n_2n...

2019-02-25 18:41:48 165

原创 1112 Stucked Keyboard (20 分)

1112 Stucked Keyboard (20 分)On a broken keyboard, some of the keys are always stucked. So when you type some sentences, the characters corresponding to those keys will appear repeatedly on screen fo...

2019-02-25 17:28:29 431

原创 1118 Birds in Forest (25 分)

1118 Birds in Forest (25 分)Some scientists took pictures of thousands of birds in a forest. Assume that all the birds appear in the same picture belong to the same tree. You are supposed to help the...

2019-02-25 12:35:38 115

原创 1117 Eddington Number (25 分)

1117 Eddington Number (25 分)British astronomer Eddington liked to ride a bike. It is said that in order to show off his skill, he has even defined an "Eddington number", E -- that is, the maximum in...

2019-02-25 09:24:32 179

原创 1116 Come on! Let's C (20 分)

1116 Come on! Let's C (20 分)"Let's C" is a popular and fun programming contest hosted by the College of Computer Science and Technology, Zhejiang University. Since the idea of the contest is for fun...

2019-02-23 23:39:06 226

原创 1123 Is It a Complete AVL Tree (30 分)

1123 Is It a Complete AVL Tree (30 分)An AVL tree is a self-balancing binary search tree. In an AVL tree, the heights of the two child subtrees of any node differ by at most one; if at any time they ...

2019-02-23 17:02:14 307

原创 1122 Hamiltonian Cycle (25 分)

1122 Hamiltonian Cycle (25 分)The "Hamilton cycle problem" is to find a simple cycle that contains every vertex in a graph. Such a cycle is called a "Hamiltonian cycle".In this problem, you are sup...

2019-02-22 12:11:18 290

原创 1121 Damn Single (25 分)

"Damn Single (单身狗)" is the Chinese nickname for someone who is being single. You are supposed to find those who are alone in a big party, so they can be taken care of.Input Specification:Each inpu...

2019-02-21 16:58:11 262

原创 1120 Friend Numbers (20 分)

1120 Friend Numbers (20 分)Two integers are called "friend numbers" if they share the same sum of their digits, and the sum is their "friend ID". For example, 123 and 51 are friend numbers since 1+2+...

2019-02-16 19:56:27 200

原创 1126 Eulerian Path (25 分)

1126 Eulerian Path (25 分)In graph theory, an Eulerian path is a path in a graph which visits every edge exactly once. Similarly, an Eulerian circuit is an Eulerian path which starts and ends on the ...

2019-02-16 16:43:07 213

原创 1125 Chain the Ropes (25 分)

Given some segments of rope, you are supposed to chain them into one rope. Each time you may only fold two segments into loops and chain them into one piece, as shown by the figure. The resulting chai...

2019-02-15 16:26:52 140

原创 1124 Raffle for Weibo Followers (20 分)

1124 Raffle for Weibo Followers (20 分)John got a full mark on PAT. He was so happy that he decided to hold a raffle(抽奖) for his followers on Weibo -- that is, he would select winners from every N fo...

2019-02-14 17:28:44 173

原创 1131 Subway Map (30 分)

In the big cities, the subway systems always look so complex to the visitors. To give you some sense, the following figure shows the map of Beijing subway. Now you are supposed to help people with you...

2019-02-14 16:21:18 330

原创 1130 Infix Expression (25 分)

Given a syntax tree (binary), you are supposed to output the corresponding infix expression, with parentheses reflecting the precedences of the operators.Input Specification:Each input file contai...

2019-02-13 19:38:57 202

原创 1129 Recommendation System (25 分)

1129 Recommendation System (25 分)Recommendation system predicts the preference that a user would give to an item. Now you are asked to program a very simple recommendation system that rates the user...

2019-02-10 13:46:48 914

原创 1128 N Queens Puzzle (20 分)

1128 N Queens Puzzle (20 分)The "eight queens puzzle" is the problem of placing eight chess queens on an 8×88\times 88×8 chessboard so that no two queens threaten each other. Thus, a solution require...

2019-02-09 08:32:00 197

原创 1135 Is It A Red-Black Tree (30 分)

1135 Is It A Red-Black Tree (30 分)There is a kind of balanced binary search tree named red-black tree in the data structure. It has the following 5 properties:(1) Every node is either red or black...

2019-02-07 19:21:25 264

原创 1134 Vertex Cover (25 分)

A vertex cover of a graph is a set of vertices such that each edge of the graph is incident to at least one vertex of the set. Now given a graph with several vertex sets, you are supposed to tell if e...

2019-02-05 13:44:02 131

原创 1133 Splitting A Linked List (25 分)

Given a singly linked list, you are supposed to rearrange its elements so that all the negative values appear before all of the non-negatives, and all the values in [0, K] appear before all those grea...

2019-02-03 13:39:37 243

原创 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-02-02 23:46:05 91

原创 1139 First Contact (30 分)

1139 First Contact (30 分)Unlike in nowadays, the way that boys and girls expressing their feelings of love was quite subtle in the early years. When a boy A had a crush on a girl B, he would usually...

2019-02-02 22:41:11 185

原创 1138 Postorder Traversal (25 分)

1138 Postorder Traversal (25 分)Suppose that all the keys in a binary tree are distinct positive integers. Given the preorder and inorder traversal sequences, you are supposed to output the first num...

2019-01-31 21:34:15 151

原创 1137 Final Grading (25 分)

1137 Final Grading (25 分)For a student taking the online course "Data Structures" on China University MOOC (http://www.icourse163.org/), to be qualified for a certificate, he/she must first obtain n...

2019-01-31 16:21:55 222

原创 1136 A Delayed Palindrome (20 分)

Consider a positive integer N written in standard notation with k+1 digits a​i​​ as a​k​​⋯a​1​​a​0​​ with 0≤a​i​​&lt;10 for all i and a​k​​&gt;0. Then N is palindromic if and only if a​i​​=a​k−i​​ for...

2019-01-26 22:20:02 530

原创 1143 Lowest Common Ancestor (30 分)

The lowest common ancestor (LCA) of two nodes U and V in a tree is the deepest node that has both U and V as descendants.A binary search tree (BST) is recursively defined as a binary tree which has ...

2019-01-25 23:56:50 561

原创 1142 Maximal Clique (25 分)

A clique is a subset of vertices of an undirected graph such that every two distinct vertices in the clique are adjacent. A maximal clique is a clique that cannot be extended by including one more adj...

2019-01-24 22:42:55 500

黑白棋简单代码

黑白棋简单代码

2016-07-12

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除