There is a river of width n">nn. The left bank of the river is cell 0">00 and the right bank is c ...
传送门 A. Payment Without Change 签到。 Code B. Minimize the Permutation 题意: 给出一个 n 的排列,现在对于一个位置 i ,可以交换 a i,a i 。但要满足每个位置只能交换一次且最多交换 n 次。 输出操作过后字典序最小的序列。 思路: 直接从后往前每个位置不断贪心考虑即可。 每次扫一遍序列至少会交换一次,所以复杂度为 O n 。 ...
2019-11-05 11:47 0 276 推荐指数:
There is a river of width n">nn. The left bank of the river is cell 0">00 and the right bank is c ...
E. Yet Another Division Into Teams There are n students at your university. The programming skill o ...
F. Equalizing Two Strings You are given two strings s and t both of length n and both consisting of ...
https://codeforces.com/contest/1256 A:Payment Without Change【思维】 题意:给你a个价值n的物品和b个价值1的物品,问是否存在取物方案使得价值为s 题解:min(s/n,a)*n+b>=s?YES:NO B ...
Codeforces Round #739 (Div. 3) div3掉大分,不考算法考手速真来不及,还是得多练 目录: A. Dislike of Threes B. Who's Opposite? C. Infinity Table D. Make a Power of Two ...
A. ConneR and the A.R.C. Markland-N 题目链接:https://codeforces.com/contest/1293/problem/A 题意: 有一个长为 n 的楼层,其中有 k 个楼层没有餐厅 ,你现在在 s 层,问你最少走多少个楼层可以到达餐厅吃饭 ...
A. Collecting Coins 题目链接:https://codeforces.com/contest/1294/problem/A 题意: 你有三个姐妹她们分别有 a , b , c枚硬币,你有n枚,你可以把硬币随意分给她们(必须分完),使她们的硬币数A = B = C 分析 ...
比赛链接:https://codeforces.com/contest/1333 比赛的时候,写D的时候用了cin,cout的优化结果还是被卡了,看来cin,cout得少用。 A - Little Artem 给你n * m的矩阵,只有B和W,相邻有其他不一样的点成为好点,让好点B ...