![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构
njupt_wrj
这个作者很懒,什么都没留下…
展开
-
Codeforces 922 C - Robot Vacuum Cleaner (贪心、数据结构、sort中的cmp)
题目链接:点击打开链接Pushok the dog has been chasing Imp for a few hours already.Fortunately, Imp knows that Pushok is afraid of a robot vacuum cleaner.While moving, the robot generates a string t consisting of...原创 2018-03-19 17:48:35 · 419 阅读 · 0 评论 -
PTA 7-10 树的遍历(二叉树基础、层序遍历、STL初体验之queue)
7-10 树的遍历(25 分)给定一棵二叉树的后序遍历和中序遍历,请你输出其层序遍历的序列。这里假设键值都是互不相等的正整数。输入格式:输入第一行给出一个正整数N(≤30),是二叉树中结点的个数。第二行给出其后序遍历序列。第三行给出其中序遍历序列。数字间以空格分隔。输出格式:在一行中输出该树的层序遍历的序列。数字间以1个空格分隔,行首尾不得有多余空格。输入样例:7 2 3 1 5 7 6 4 1 ...原创 2018-03-28 12:50:39 · 541 阅读 · 0 评论 -
HDU 1005 Number Sequence(矩阵快速幂,快速幂模板)
Problem DescriptionA number sequence is defined as follows:f(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7.Given A, B, and n, you are to calculate the value of f(n). InputThe input cons...原创 2018-04-16 20:35:54 · 240 阅读 · 0 评论 -
Codeforces 977B Two-gram(stl之string掉进坑)
Two-gram is an ordered pair (i.e. string of length two) of capital Latin letters. For example, "AZ", "AA", "ZA" — three distinct two-grams.You are given a string ss consisting of nn capital Latin lett...原创 2018-05-12 16:08:01 · 252 阅读 · 0 评论 -
Codeforces 977D Divide by three, multiply by two(拓扑排序)
Polycarp likes to play with numbers. He takes some integer number xx, writes it down on the board, and then performs with it n−1n−1operations of the two kinds:divide the number xx by 33 (xx must be di...原创 2018-05-12 17:14:12 · 256 阅读 · 0 评论