
数据结构与算法
文章平均质量分 59
leletongxue
这个人好神秘呀~
展开
-
栈- 愚人节的礼物
A - 愚人节的礼物 题目 四月一日快到了,Vayko想了个愚人的好办法——送礼物。嘿嘿,不要想的太好,这礼物可没那么简单,Vayko为了愚人,准备了一堆盒子,其中有一个盒子里面装了礼物。盒子里面可以再放零个或者多个盒子。假设放礼物的盒子里不再放其他盒子。 用()表示一个盒子,B表示礼物,Vayko想让你帮她算出愚人指数,即最少需要拆多少个盒子才能拿到礼物。 输入 本题目包含多组测试,请处理到文件...原创 2019-07-08 16:46:25 · 183 阅读 · 0 评论 -
vector-letters shop
b-letters shop The letters shop showcase is a string s, consisting of n lowercase Latin letters. As the name tells, letters are sold in the shop. Letters are sold one by one from the leftmost to the r...原创 2019-07-08 20:44:16 · 201 阅读 · 0 评论 -
C - Fence Repair
C - Fence Repair Farmer John wants to repair a small length of the fence around the pasture. He measures the fence and finds that he needs N (1 ≤ N ≤ 20,000) planks of wood, each having some integer l...原创 2019-07-09 10:55:41 · 153 阅读 · 0 评论 -
pair- 绝对值排序
A - 绝对值排序 输入n(n<=100)个整数,按照绝对值从大到小排序后输出。题目保证对于每一个测试实例,所有的数的绝对值都不相等。 Input 输入数据有多组,每组占一行,每行的第一个数字为n,接着是n个整数,n=0表示输入数据的结束,不做处理。 Output 对于每个测试实例,输出排序后的结果,两个数之间用一个空格隔开。每个测试实例占一行。 Sample Input 3 3 -4 2 ...原创 2019-07-09 11:46:19 · 183 阅读 · 0 评论 -
D - 排序
D - 排序 输入一行数字,如果我们把这行数字中的‘5’都看成空格,那么就得到一行用空格分割的若干非负整数(可能有些整数以‘0’开头,这些头部的‘0’应该被忽略掉,除非这个整数就是由若干个‘0’组成的,这时这个整数就是0)。 你的任务是:对这些分割得到的整数,依从小到大的顺序排序输出。 Input 输入包含多组测试用例,每组输入数据只有一行数字(数字之间没有空格),这行数字的长度不大于1000。 ...原创 2019-07-09 16:46:16 · 295 阅读 · 0 评论 -
B - Equations
B - Equations Consider equations having the following form: ax12+b*x22+cx32+d*x42=0 a, b, c, d are integers from the interval [-50,50] and any of them cannot be 0. It is consider a solution a system (...原创 2019-07-13 11:20:22 · 281 阅读 · 1 评论 -
map- Let the Balloon Rise
map- Let the Balloon Rise Contest time again! How excited it is to see balloons floating around. But to tell you a secret, the judges’ favorite time is guessing the most popular problem. When the cont...原创 2019-07-15 20:00:27 · 101 阅读 · 0 评论 -
双重map- 水果
双重map- 水果 夏天来了~~**好开心啊,呵呵,好多好多水果** Joe经营着一个不大的水果店.他认为生存之道就是经营最受顾客欢迎的水果.现在他想要一份水果销售情况的明细表,这样Joe就可以很容易掌握所有水果的销售情况了. Input 第一行正整数N(0<N<=10)表示有N组测试数据. 每组测试数据的第一行是一个整数M(0<M<=100),表示工有M次成功的交易.其后...原创 2019-07-16 17:19:57 · 206 阅读 · 0 评论 -
矩阵快速幂 ——Tr A
Tr A A为一个方阵,则Tr A表示A的迹(就是主对角线上各项的和),现要求Tr(A^k)%9973。 Input 数据的第一行是一个T,表示有T组数据。 每组数据的第一行有n(2 <= n <= 10)和k(2 <= k < 10^9)两个数据。接下来有n行,每行有n个数据,每个数据的范围是[0,9],表示方阵A的内容。 Output 对应每组数据,输出Tr(A^k)%...原创 2019-08-05 21:06:51 · 316 阅读 · 0 评论