C - Will It Stop?Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=87794#problem/C Description Byteasar was wandering around the library of the University of Warsaw and at one of its facades he noticed…
L. Ministry of Truth Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100187/problem/K Description Andrey works in the Ministry of Truth. His work is changing articles in newspapers and magazines so that they praise the Party an…
Problem E. Explicit Formula Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100610 Description Consider 10 Boolean variables x1, x2, x3, x4, x5, x6, x7, x8, x9, and x10. Consider all pairs and triplets of distinct variables amon…
B. Archer Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/312/problem/B Description SmallR is an archer. SmallR is taking a match of archer with Zanoes. They try to shoot in the target in turns, and SmallR shoots first. The…
A. Fashion in Berland 题目连接: http://www.codeforces.com/contest/691/problem/A Description According to rules of the Berland fashion, a jacket should be fastened by all the buttons except only one, but not necessarily it should be the last one. Also if…
A. Opponents 题目连接: http://www.codeforces.com/contest/688/problem/A Description Arya has n opponents in the school. Each day he will fight with all opponents who are present this day. His opponents have some fighting plan that guarantees they will win…
后天考试,今天做题,我真佩服自己... 这次又只A俩水题... orz各路神犇... 话说这次模拟题挺多... 半个多小时把前面俩水题做完,然后卡C,和往常一样,题目看懂做不出来... A: 算是模拟吧,反正看懂题目后很可耻的生硬水果,没被hack我觉得非常开心... 由于要求两个人至少一个没跳过,画图后发现很偷懒的方法. 虽然跟样例不同,但过了... #include <cstdio> int main() { int n, m; scanf("%d%d", &n…
对于这道水题本人觉得应该应用贪心算法来解这道题: 下面就贴出本人的代码吧: #include<cstdio> #include<iostream> using namespace std; ],b[]; int main(void) { int n; ; ,sum2 = ; ;i<=;++i){ scanf("%d",&a[i]); sum1 += a[i]; } ;i<=;++i){ scanf("%d",&b[…
Problem H. Hard TestTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100342/attachments Description Andrew is having a hard time preparing his 239-th contest for Petrozavodsk. This time the solution to the problem is based on Di…
题目链接:http://codeforces.com/gym/101873/problem/K 题意: 现在给出 $n(1 \le n \le 1e4)$ 个员工,最多可以裁员 $k$ 人,名字为 $s_i$ 的员工的薪资为 $c_i(1 \le c_i \le 1e5)$. 已知必须节省下 $d(1 \le d \le 1e9)$ 元才能拯救公司,问要裁员哪些人. 题解: 薪资越高的人越要裁掉. (这么个大水题,居然没人发现,交的人不多.可能是这套题英语阅读量有点烦人吧……) AC代码: #i…
http://codeforces.com/problemset/problem/777/D 题意:给出n道字符串,删除最少的字符使得s[i] <= s[i+1]. 思路:感觉比C水好多啊,大概是题目比较难看懂吧.直接从后面往前扫,用后面的答案更新前面的答案.考虑如果后面的字符串比前面的大,那么直接保存当前的字符串,否则暴力扫一遍,前面的字符串大于后面的字符串的那一位直接跳出. #include <bits/stdc++.h> using namespace std; ]; ]; int…
题目链接:https://codeforces.com/gym/102361/problem/A 题意:给定二维平面上的\(n\)个点,\(q\)次询问,每次加入一个点,询问平面上有几个包含该点的直角三角形. 分析:这是一篇鸽了很久的题解,主要原因就是现场赛的时候这题惨遭卡常,锅++.现在回过头来想这题,主要问题出在现场赛时误判了\(map\)的时间复杂度,把极角排序的正确想法成功叉掉,以及现场赛时候的共线计数使用了\(gcd\),使得整体复杂度上升.(但还是有大佬拿gcd思想过了,我太菜了)现…
B. Chocolate 题目连接: http://www.codeforces.com/contest/617/problem/D Descriptionww.co Bob loves everything sweet. His favorite chocolate bar consists of pieces, each piece may contain a nut. Bob wants to break the bar of chocolate into multiple pieces…
A. Elephant 题目连接: http://www.codeforces.com/contest/617/problem/A Descriptionww.co An elephant decided to visit his friend. It turned out that the elephant's house is located at point 0 and his friend's house is located at point x(x > 0) of the coord…
D. Polyline 题目连接: http://www.codeforces.com/contest/617/problem/D Descriptionww.co There are three points marked on the coordinate plane. The goal is to make a simple polyline, without self-intersections and self-touches, such that it passes through…
A. Bulbs 题目连接: http://www.codeforces.com/contest/615/problem/A Description Vasya wants to turn on Christmas lights consisting of m bulbs. Initially, all bulbs are turned off. There are n buttons, each of them is connected to some set of bulbs. Vasya…
A. The Text Splitting 题目连接: http://www.codeforces.com/contest/612/problem/A Description You are given the string s of length n and the numbers p, q. Split the string s to pieces of length p and q. For example, the string "Hello" for p = 2, q = 3…
B. The Best Gift 题目连接: http://www.codeforces.com/contest/609/problem/B Description Emily's birthday is next week and Jack has decided to buy a present for her. He knows she loves books so he goes to the local bookshop, where there are n books on sale…
A. USB Flash Drives 题目连接: http://www.codeforces.com/contest/609/problem/A Description Sean is trying to save a large file to a USB flash drive. He has n USB flash drives with capacities equal to a1, a2, ..., an megabytes. The file size is equal to m…
A. Flea travel Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/55/problem/A Description A flea is sitting at one of the n hassocks, arranged in a circle, at the moment. After minute number k the flea jumps through k - 1hass…
A. Treasure Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/494/problem/A Description Malek has recently found a treasure map. While he was looking for a treasure he found a locked door. There was a string s written on the…
B. Rebranding Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/591/problem/B Description The name of one small but proud corporation consists of n lowercase English letters. The Corporation has decided to try rebranding — an…
B. Bakery 题目连接: http://www.codeforces.com/contest/707/problem/B Description Masha wants to open her own bakery and bake muffins in one of the n cities numbered from 1 to n. There are m bidirectional roads, each of whose connects some pair of cities.…
D. Iterated Linear Function 题目连接: http://www.codeforces.com/contest/678/problem/D Description Consider a linear function f(x) = Ax + B. Let's define g(0)(x) = x and g(n)(x) = f(g(n - 1)(x)) for n > 0. For the given integer values A, B, n and x find t…
C. Joty and Chocolate 题目连接: http://www.codeforces.com/contest/678/problem/C Description Little Joty has got a task to do. She has a line of n tiles indexed from 1 to n. She has to paint them in a strange pattern. An unpainted tile should be painted R…
B. The Same Calendar 题目连接: http://www.codeforces.com/contest/678/problem/B Description The girl Taylor has a beautiful calendar for the year y. In the calendar all days are given with their days of week: Monday, Tuesday, Wednesday, Thursday, Friday,…
A. Johny Likes Numbers 题目连接: http://www.codeforces.com/contest/678/problem/A Description Johny likes numbers n and k very much. Now Johny wants to find the smallest integer x greater than n, so it is divisible by the number k. Input The only line con…
C. Cinema 题目连接: http://www.codeforces.com/contest/670/problem/C Description Moscow is hosting a major international conference, which is attended by n scientists from different countries. Each of the scientists knows exactly one language. For conveni…
A. Holidays 题目连接: http://www.codeforces.com/contest/670/problem/A Description On the planet Mars a year lasts exactly n days (there are no leap years on Mars). But Martians have the same weeks as earthlings - 5 work days and then 2 days off. Your tas…
C. Vanya and Label time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output While walking down the street Vanya saw a label "Hide&Seek". Because he is a programmer, he used & as a bitwi…