题意:你起初有一支军队,有$k$个士兵,现在有$n$座城堡,你若想占领第$i$座城堡,至少得有$a[i]$个士兵才能占领$($占领后士兵不会减少$)$,占领了第$i$座城堡后,你将得到$b[i]$个士兵,然后你有两种方式防御你占领的城堡: 在你占领第$i$个城堡后留下一个士兵防御第$i$个城堡 有$m$个传送门,能从$u_{i}$传送到$v_{i}(u_{i}>v_{i})$,你可以在占领完第$u_{i}$座城堡后再派一个士兵去防御第$v_{i}$个城堡 如果你防御了第$i$座城堡,你能得到$c…
链接: https://codeforces.com/contest/1271/problem/D 题意: You play a strategic video game (yeah, we ran out of good problem legends). In this game you control a large army, and your goal is to conquer n castles of your opponent. Let's describe the game p…
目录 Codeforces Round #608 (Div. 2) 题解 前言 A. Suits 题意 做法 程序 B. Blocks 题意 做法 程序 C. Shawarma Tent 题意 做法 程序 D. Portals 题意 做法 程序 E. Common Number 题意 做法 程序 结束语 Codeforces Round #608 (Div. 2) 题解 前言 题目链接:仅仅只是为了方便以题目作为关键字能查找到我的题解而已(逃 Codeforces 1271A Codeforce…
#define HAVE_STRUCT_TIMESPEC #include<bits/stdc++.h> using namespace std; ],b[],c[]; int u,v; ],least[]; pair<]; vector<]; bool cmp(int a,int b){ return a>b; } int main(){ ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int n,m,…
A. Mafia Time Limit: 20 Sec  Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/348/problem/A Description One day n friends gathered together to play "Mafia". During each round of the game some player must be the supervisor and other n - 1…
B. Urbanization 题目链接 http://codeforces.com/contest/735/problem/B 题面 Local authorities have heard a lot about combinatorial abilities of Ostap Bender so they decided to ask his help in the question of urbanization. There are n people who plan to move…
题目链接: http://codeforces.com/problemset/problem/268/E E. Playlist time limit per test 1 secondmemory limit per test 256 megabytes 问题描述 Manao's friends often send him new songs. He never listens to them right away. Instead, he compiles them into a play…
B. Sail 题目连接: http://www.codeforces.com/contest/298/problem/B Description The polar bears are going fishing. They plan to sail from (sx, sy) to (ex, ey). However, the boat can only sail by wind. At each second, the wind blows in one of these directio…
A. Purification Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/329/problem/A Description You are an adventurer currently journeying inside an evil temple. After defeating a couple of weak zombies, you arrived at a square r…
A. Exams Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/480/problem/A Description Student Valera is an undergraduate student at the University. His end of term exams are approaching and he is to pass exactly n exams. Valera…