TinaCristal's Blog


  • Home

  • Tags

  • Categories

  • Archives

  • Search

装箱问题

Posted on 2019-03-28

假设有N项物品,大小分别为s1,s2….si….sn,其中si为满足0<=si<=100的整数。要把这些物品装入到容量为100的一批箱子(序号1-N)中。装箱方法是:对每项物品, 顺序扫描箱子,把该物品放入足以能够容下它的第一个箱子中。请写一个程序模拟这种装箱过程,并输出每个物品所在的箱子序号,以及放置全部物品所需的箱子数目。

Read more »

九度题目1188 约瑟夫环

Posted on 2019-03-28 | In 九度

题目描述:
N个人围成一圈顺序编号,从1号开始按1、2、3……顺序报数,报p者退出圈外,其余的

Read more »

周总结(26)

Posted on 2019-03-28 | In 周总结

学习

这一个星期主要看的算法和高数,高数进度有点慢,要归纳总结

Read more »

A1013 Battle over cities

Posted on 2019-03-27

It is vitally important to have all the cities connected by highways in a war. If a city is occupied by the enemy, all the highways from/toward that city are closed. We must know immediately if we need to repair any other highways to keep the rest of the cities connected. Given the map of cities which have all the remaining highways marked, you are supposed to tell the number of highways need to be repaired, quickly.

Read more »

A1085 Perfect Sequence

Posted on 2019-03-26 | In pat

Given a sequence of positive integers and another positive integer p. The sequence is said to be a perfect sequence if M≤m×p where M and m are the maximum and minimum numbers in the sequence, respectively.

Now given a sequence and a parameter p, you are supposed to find from the sequence as many numbers as possible to form a perfect subsequence.

Read more »

A1099 Build A Binary Search Tree

Posted on 2019-03-26 | In pat

A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties:

Read more »

A1020 Tree Traversals

Posted on 2019-03-25 | In pat

Suppose that all the keys in a binary tree are distinct positive integers. Given the postorder and inorder traversal sequences, you are supposed to output the level order traversal sequence of the corresponding binary tree.

Input Specification:
Each input file contains one test case. For each case, the first line gives a positive integer N (≤30), the total number of nodes in the binary tree. The second line gives the postorder sequence and the third line gives the inorder sequence. All the numbers in a line are separated by a space.

Read more »

A1103 Integer Factorization

Posted on 2019-03-25 | In pat

The K−P factorization of a positive integer N is to write N as the sum of the P-th power of K positive integers. You are supposed to write a program to find the K−P factorization of N for any positive integers N, K and P.

Read more »

A1081 Rational Sum

Posted on 2019-03-25 | In pat

Given N rational numbers in the form numerator/denominator, you are supposed to calculate their sum.

Read more »

字符串转整形 整形转字符串

Posted on 2019-03-23 | In c++

atoi() 与 itoa()函数用法

Read more »

1234…45

TinaCristal

443 posts
57 categories
55 tags
GitHub E-Mail
© 2020 TinaCristal
Powered by Hexo
|
Theme — NexT.Mist v5.1.4