
dp
文章平均质量分 52
wxl7777
这个作者很懒,什么都没留下…
展开
-
西北大学第四届程序设计竞赛新生赛(同步赛)(J)
链接:https://ac.nowcoder.com/acm/contest/321/J来源:牛客网 众所周知,八意永琳擅长制作药物.今天八意永琳又制作了很多份药物,但是由于材料组成的不同,最终的品级也会不同已知八意永琳制作的药物中,一共有n种不同的主材料,用1...n编号,每种主材料有ai种产地,每种产地都有自己的品级.每种主材料只取某个产地的一份,最终该药物的品级为所有主材料的...原创 2018-12-24 20:20:15 · 269 阅读 · 0 评论 -
Codeforces Global Round 1 D. Jongmah
You are playing a game of Jongmah. You don't need to know the rules to solve this problem. You have nntiles in your hand. Each tile has an integer between 11 and mm written on it.To win the game, yo...原创 2019-02-10 20:52:28 · 498 阅读 · 0 评论 -
B. Working out
Summer is coming! It's time for Iahub and Iahubina to work out, as they both want to look hot at the beach. The gym where they go is a matrixawithnlines andmcolumns. Let numbera[i][j]represent...原创 2019-06-12 21:01:37 · 320 阅读 · 1 评论 -
D. Mysterious Present
Peter decided to wish happy birthday to his friend from Australia and send him a card. To make his present more mysterious, he decided to make achain. Chain here is such a sequence of envelopesA = {...原创 2019-06-13 17:12:58 · 616 阅读 · 0 评论 -
C. Bear and Prime Numbers
Recently, the bear started studying data structures and faced the following problem.You are given a sequence of integersx1, x2, ..., xnof lengthnandmqueries, each of them is characterized by t...原创 2019-06-13 21:14:18 · 351 阅读 · 0 评论 -
B. Bear and Blocks
One day, little Vasya found himself in a maze consisting of(n + 1)rooms, numbered from1to(n + 1). Initially, Vasya is at the first room and to get out of the maze, he needs to get to the(n + 1)-...原创 2019-06-10 22:30:43 · 180 阅读 · 0 评论 -
C. Barcode
You've got ann × mpixel picture. Each pixel can be white or black. Your task is to change the colors of as few pixels as possible to obtain a barcode picture.A picture is a barcode if the followin...原创 2019-06-11 11:35:32 · 435 阅读 · 0 评论 -
D. Distance in Tree
Atreeis a connected graph that doesn't contain any cycles.Thedistancebetween two vertices of a tree is the length (in edges) of the shortest path between these vertices.You are given a tree wi...原创 2019-06-11 21:19:52 · 268 阅读 · 0 评论 -
E. Lunar New Year and Red Envelopes
题目链接:http://codeforces.com/problemset/problem/1106/ELunar New Year is approaching, and Bob is going to receive some red envelopes with countless money!But collecting money from red envelopes is a t...原创 2019-06-21 16:06:11 · 493 阅读 · 0 评论