cf
Ha.wang
这个作者很懒,什么都没留下…
展开
-
D. Candy Box (easy version)
This problem is actually a subproblem of problem G from the same contest.There are n candies in a candy box. The type of the i-th candy is ai (1≤ai≤n).You have to prepare a gift using some of these ...原创 2019-07-07 21:49:30 · 642 阅读 · 0 评论 -
G - Pairing Socks Kattis - pairingsocks 栈的应用
Simone’s mother often complains about how Simone never helps with chores at home. In return, Simone often points out that many of the chores her mother assigns her are NP-complete to perform optimally...原创 2019-06-23 21:22:37 · 300 阅读 · 0 评论 -
C. Valeriy and Deque
Recently, on the course of algorithms and data structures, Valeriy learned how to use a deque. He built a deque filled with n elements. The i-th element is ai (i = 1,2,…,n). He gradually takes the fir...原创 2019-06-24 13:06:48 · 241 阅读 · 0 评论 -
B. Merge it!
You are given an array aa consisting of nn integers a1,a2,…,an.In one operation you can choose two elements of the array and replace them with the element equal to their sum (it does not matter where...原创 2019-06-24 21:19:18 · 374 阅读 · 0 评论 -
C. Lose it!
You are given an array a consisting of n integers. Each ai is one of the six following numbers: 4,8,15,16,23,42.Your task is to remove the minimum number of elements to make this array good.An array...原创 2019-06-24 21:26:57 · 463 阅读 · 0 评论 -
A - Rooms and Passages Gym - 102215A
There are (n+1)(n+1) rooms in the dungeon, consequently connected by nn passages. The rooms are numbered from 00 to nn, and the passages — from 11 to nn. The ii-th passage connects rooms (i−1)(i−1) an...原创 2019-06-26 21:01:31 · 1766 阅读 · 0 评论 -
A. From Hero to Zero
You are given an integer nn and an integer kk.In one step you can do one of the following moves:decrease nn by 11;divide nn by kk if nn is divisible by kk.For example, if n=27n=27 and k=3k=3 you c...原创 2019-06-26 21:07:33 · 245 阅读 · 1 评论 -
B. Catch Overflow!
You are given a function ff written in some basic language. The function accepts an integer value, which is immediately written into some variable xx. xx is an integer variable and can be assigned val...原创 2019-06-26 21:21:45 · 213 阅读 · 0 评论 -
C. Ehab and a Special Coloring Problem
You’re given an integer原创 2019-06-29 21:37:12 · 187 阅读 · 0 评论 -
B. Nick and Array 贪心
B. Nick and Arraytime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputNick had received an awesome array of integers a=[a1,a2,…,an] as a gift for h...原创 2019-06-23 21:18:49 · 493 阅读 · 0 评论