NC50439 tokitsukaze and Soldier】的更多相关文章

题目 链接:https://ac.nowcoder.com/acm/contest/28886/1004 来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 524288K,其他语言1048576K 64bit IO Format: %lld 题目描述 在一个游戏中,tokitsukaze需要在n个士兵中选出一些士兵组成一个团去打副本. 第i个士兵的战力为v[i],团的战力是团内所有士兵的战力之和. 但是这些士兵有特殊的要求:如果选了第i个士兵,这个士兵希望团的人数不超…
D. Soldier and Number Game time limit per test3 seconds memory limit per test256 megabytes inputstandard input outputstandard output Two soldiers are playing a game. At the beginning first of them chooses a positive integer n and gives it to the seco…
Soldier and Cards 题目: Description Two bored soldiers are playing card war. Their card deck consists of exactly n cards, numbered from 1 to n, all values are different. They divide cards between them in some manner, it's possible that they have differ…
Soldier and Bananas 题目链接:http://acm.hust.edu.cn/vjudge/problem/visitOriginUrl.action?id=173141 题意: 给出第一个香蕉的价钱k,后买的第i个香蕉所需要的价钱就是i*k: 给出手上所有的钱,求出如果要买w个香蕉还少多少钱. 代码: #include<iostream> using namespace std; int main() { ; cin>>k>>n>>w;…
Soldier and Cards time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Two bored soldiers are playing card war. Their card deck consists of exactly n cards, numbered from 1 to n, all values are…
Soldier and Badges time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output Colonel has n badges. He wants to give one badge to every of his n soldiers. Each badge has a coolness factor, which show…
这是bestcorder 67 div1 的1003 当时不会做 看了赛后官方题解,然后翻译了一下就过了,而且速度很快,膜拜官方题解.. 附上官方题解: the soldier of love 我们注意到我们求的是每一组至少覆盖一个点的线段数量. 那么我们可以先求一个点都没有覆盖的的线段数量,在用nn减去即可. 我们把所有点和线段先这样离线处理: 对于每个线段,在他的右端点处记上一个左端点的标记. 对于每组点,在除了第一个点之外的其他点上,记上一个前一个点的标记,同时记录下这个点的编号. 然后从…
In the country there are n cities and m bidirectional roads between them. Each city has an army. Army of the i-th city consists of ai soldiers. Now soldiers roam. After roaming each soldier has to either stay in his city or to go to the one of neighb…
Description Two soldiers are playing a game. At the beginning first of them chooses a positive integer n and gives it to the second soldier. Then the second one tries to make maximum possible number of rounds. Each round consists of choosing a positi…
题目链接: http://codeforces.com/problemset/problem/546/E E. Soldier and Traveling time limit per test1 secondmemory limit per test256 megabytes 问题描述 In the country there are n cities and m bidirectional roads between them. Each city has an army. Army of…