Karen has just arrived at school, and she has a math test today! The test is about basic addition and subtraction. Unfortunately, the teachers were too busy writing tasks for Codeforces rounds, and had no time to make an actual test. So, they just pu…
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…
http://codeforces.com/contest/816/problem/A 题意: 给出一个时间,问最少过多少时间后是回文串. 思路: 模拟,先把小时的逆串计算出来: ① 如果逆串=分钟,那么此时已经是回文串了. ② 如果逆串>分钟,那么只需要逆串-分钟即可.(注意此时逆串>=60的情况) ③ 如果逆串<分钟,此时在这个小时内要构成回文串已经是不可能的了,那么就加上60-minute分钟,进入一个新的小时,然后重复上述步骤. #include<iostream>…
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…
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. The supermarket sells n goods…
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…
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 palindromes, and she believes that it is good luck to wake up when the time is a palindrome. What is the minimum number of minutes…
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()…