http://codeforces.com/contest/816/problem/B To stay woke and attentive during classes, Karen needs some coffee! Karen, a coffee aficionado, wants to know the optimal temperature for brewing the perfect cup of coffee. Indeed, she has spent some time r…
C. Karen and Game time limit per test 2 seconds memory limit per test 512 megabytes input standard input output standard output On the way to school, Karen became fixated on the puzzle game on her phone! The game is played as follows. In each level,…
To stay woke and attentive during classes, Karen needs some coffee! Karen, a coffee aficionado, wants to know the optimal temperature for brewing the perfect cup of coffee. Indeed, she has spent some time reading several recipe books, including the u…
http://codeforces.com/contest/816/problem/A 题意: 给出一个时间,问最少过多少时间后是回文串. 思路: 模拟,先把小时的逆串计算出来: ① 如果逆串=分钟,那么此时已经是回文串了. ② 如果逆串>分钟,那么只需要逆串-分钟即可.(注意此时逆串>=60的情况) ③ 如果逆串<分钟,此时在这个小时内要构成回文串已经是不可能的了,那么就加上60-minute分钟,进入一个新的小时,然后重复上述步骤. #include<iostream>…
C. Karen and Supermarket On the way home, Karen decided to stop by the supermarket to buy some groceries. She needs to buy a lot of goods, but since she is a student her budget is still quite limited. In fact, she can only spend up to b dollars.…
容易发现,删除的顺序不影响答案. 所以可以随便删. 如果行数大于列数,就先删列:否则先删行. #include<cstdio> #include<algorithm> using namespace std; int p1,ans1[510*110],ans2[510*110],p2; int n,m,a[110][110]; int main(){ scanf("%d%d",&n,&m); for(int i=1;i<=n;++i){ f…
Interesting drink 题目链接: http://codeforces.com/contest/706/problem/B Description Vasiliy likes to rest after a hard work, so you may often meet him in some bar nearby. As all programmers do, he loves the famous drink "Beecola", which can be bough…
1.题目A:Karen and Morning 题意: 给出hh:mm格式的时间,问至少经过多少分钟后,该时刻为回文字符串? 思路: 简单模拟,从当前时刻开始,如果hh的回文rh等于mm则停止累计.否则,根据rh和mm的大小来累计sum,然后hh+1,不断尝试. #include<iostream> using namespace std; int main() { int hh,mm; char c; while (cin >> hh >> c >> mm…
传送门:Problem B https://www.cnblogs.com/violet-acmer/p/9721160.html 题意: Karen有n个关于煮咖啡的食谱,每个食谱都有个煮咖啡的最适宜的温度范围,给你 m 个操作,每个操作都是个温度区间,问在此区间内满足条件的温度个数. 需要满足的条件为:在温度 T 时,在n个食谱中查找最宜温度包含T的食谱个数,只有当食谱个数 >= k 时,此温度才算可以计入答案. 题解: 差分数组 AC代码: #include<iostream> #…
A. Karen and Morning time limit per test 2 seconds memory limit per test 512 megabytes input standard input output standard output Karen is getting ready for a new school day! It is currently hh:mm, given in a 24-hour format. As you know, Karen loves…
A:暴力枚举第一列加多少次,显然这样能确定一种方案. #include<iostream> #include<cstdio> #include<cmath> #include<cstdlib> #include<cstring> #include<algorithm> using namespace std; #define ll long long #define N 110 char getc(){char c=getchar()…
python 2.7,用来熟悉Python 由于都是智障题,所以我也不讲述题意和题解,直接贴代码了-- A import sys h,m = map(int,raw_input().split(":")) ans = 0 while True: if h%10 == m/10 and h/10 == m%10: break ans = ans + 1 h,m = (h+m/59)%24,(m+1)%60 print ans B import sys maxn = 200005 # cl…
题目链接: http://codeforces.com/contest/734/problem/D D. Anton and Chess time limit per test4 secondsmemory limit per test256 megabytes 问题描述 Anton likes to play chess. Also, he likes to do programming. That is why he decided to write the program that pla…
B. Berland National LibraryTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/567/problem/B Description Berland National Library has recently been built in the capital of Berland. In addition, in the library you can take any o…
B. Valera and Fruits time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Valera loves his garden, where n fruit trees grow. This year he will enjoy a great harvest! On the i-th tree bi fruit gr…
D. Make a Permutation! time limit per test: 2 seconds memory limit per test: 256 megabytes input: standard input output: standard output Ivan has an array consisting of n elements. Each of the elements is an integer from 1 to n. Recently Ivan learned…
B. Text Document Analysis 题目连接: http://codeforces.com/contest/723/problem/B Description Modern text editors usually show some information regarding the document being edited. For example, the number of words, the number of pages, or the number of cha…
B. Pyramid of Glasses 题目连接: http://www.codeforces.com/contest/676/problem/B Description Mary has just graduated from one well-known University and is now attending celebration party. Students like to dream of a beautiful life, so they used champagne…
E. Frog Fights 题目连接: http://www.codeforces.com/contest/625/problem/E Description stap Bender recently visited frog farm and was inspired to create his own frog game. Number of frogs are places on a cyclic gameboard, divided into m cells. Cells are nu…
F. Restore a Number Vasya decided to pass a very large integer n to Kate. First, he wrote that number as a string, then he appended to the right integer k — the number of digits in n. Magically, all the numbers were shuffled in arbitrary order whil…
C. Balls and Boxes time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Little Vasya had n boxes with balls in the room. The boxes stood in a row and were numbered with numbers from 1 to n from…