stl
brav0
练习算法两年半的ACM选手
展开
-
ZZULIOJ 2371: 小新同学的JSON串
题目描述 小新同学最近接触了一个叫JSON的数据格式(可以百度哈~), 数据结构是这样的: {“key_1”:“value_1”,“key_2”:“value_2”} 最外面用{}括起来,里面可以是很多个key:value的键值对,key在前面,用冒号映射value,每组键值对用逗号隔开,现在学长想考察下同学们,学长会先给出一个json,然后问一些key,让你找到这个key对应的value 输入 ...原创 2019-01-16 20:47:43 · 517 阅读 · 0 评论 -
ZZULIOJ 1987: FJ的字符串
题目描述 FJ在沙盘上写了这样一些字符串: A1 = “A” A2 = “ABA” A3 = “ABACABA” A4 = “ABACABADABACABA” … … 你能找出其中的规律并写所有的数列AN吗? 输入 仅有一个数:N≤26。 输出 请输出相应的字符串AN,以一个换行符结束。输出中不得含有多余的空格或换行、回车符。 样例输入 3 样例输出 ABACABA 规律:就...原创 2018-12-30 16:44:14 · 345 阅读 · 2 评论 -
Uva 136 Ugly Numbers
Ugly numbers are numbers whose only prime factors are 2, 3 or 5. The sequence 1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, … shows the first 11 ugly numbers. By convention, 1 is included. Write a program to fi...原创 2019-01-16 20:58:39 · 146 阅读 · 0 评论 -
ZZULIOJ 1546: 小L的加法器(贪心)
题目描述 给定n个正整数让小L计算累加和,聪明的小L设计了一个加法器,但是加法器一次只能进行两个数的加法运算,而且两数和越大,相加的过程用时越长,假定一次加法操作用时正好为两个数的和,累加过程有很多方案,请你给出这些方案中,使n个数累加起来最少的用时是多少? 输入 第一行输入一个整数n(1<=n<=104),表示用来累加的数字个数,第二行输入n个数xi(1<=xi<=...原创 2019-04-25 23:23:45 · 281 阅读 · 0 评论 -
ZZULIOJ 2500: 建国与回文串
题目描述 建国最近学习了字符串,他对回文串很感兴趣(回文串是一个正读和反读都一样的字符串,比如“level”或者“noon”等等就是回文串),而且建国非常喜欢偶数,并把长度为偶数的回文串成为完美回文串,现在建国想请你判断一个字符串能否有两个完美回文串拼接组成,如果可以输出&amp;quot;Yes&amp;quot;,否组输出&amp;quot;No&amp;quot;。 输入 第一行输入一个整数T,表示样例数量。(1 &am原创 2019-01-06 09:29:51 · 407 阅读 · 1 评论 -
LRU management (模拟, stl)
ZYB has finished his computer course recently. He is very interested in the LRU algorithm for cache management. To simplify the problem, assume that a block contains a name (which is a string) and a s...原创 2019-07-28 23:30:02 · 259 阅读 · 0 评论 -
2019 Multi-University Training Contest 10 1005: Welcome Party (multiset)
Time Limit: 4000/4000 MS (Java/Others)Memory Limit: 524288/524288 K (Java/Others) Total Submission(s): 544Accepted Submission(s): 103 Problem Description The annual welcome party of the De...原创 2019-08-21 21:36:40 · 423 阅读 · 0 评论 -
The Preliminary Contest for ICPC Asia Xuzhou 2019 Center (map)
You are given a point set withnnpoints on the 2D-plane, your task is to find the smallest number of points you need to add to the point set, so that all the points in the set are center symmetric. ...原创 2019-09-07 20:50:54 · 154 阅读 · 0 评论