ACM简单题
ACM水题,C++简单题
aaakirito
GRIT
展开
-
问题 D: 计算
题目描述 小明在你的帮助下,破密了Ferrari设的密码门,正要往前走,突然又出现了一个密码门,门上有一个算式,其中只有“(”,“)”,“0-9”,“+”,“-”,“*”,“/”,“^”求出的值就是密码。小明数学学得不好,还需你帮他的忙。(“/”用整数除法,取商)输入输入共1行,为一个算式。输出 输出共1行,就是密码。样例输入1+(3+2)*(7^2+6*9...原创 2017-07-20 14:42:16 · 1381 阅读 · 0 评论 -
HDU 5831 Rikka with Parenthesis II
As we know, Rikka is poor at math. Yuta is worrying about this situation, so he gives Rikka some math tasks to practice. There is one of them:Correct parentheses sequences can be defined recurs...原创 2016-08-15 16:45:14 · 367 阅读 · 0 评论 -
2017hdu新生赛 1008 最大收益
最大收益Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1359 Accepted Submission(s): 182Problem DescriptionElly的叔叔经营一家电脑装配公司Shume原创 2017-11-29 14:44:13 · 567 阅读 · 0 评论 -
2017hdu新生赛 1008 友好整数
友好整数Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 224 Accepted Submission(s): 54Problem Description在成功解决他的数学作业之后,Elly感到很无聊,原创 2017-11-29 14:37:56 · 1535 阅读 · 0 评论 -
2017hdu新生赛 1007 找方块
找方块Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 158 Accepted Submission(s): 48Problem Description小明最近看到一件艺术品,是由许多黑白方块组成的矩形原创 2017-11-29 14:34:49 · 672 阅读 · 0 评论 -
2017hdu新生赛 1006 稿件整理
稿件整理Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 443 Accepted Submission(s): 48Problem Description面对每天敲代码找Bug的日子,小Q实在受够了,他原创 2017-11-29 14:32:31 · 664 阅读 · 0 评论 -
2017hdu新生赛 1005 整数的Alvin值
整数的Alvin值Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 401 Accepted Submission(s): 87Problem Descriptionalvin在理解了一个数的二进制表达之原创 2017-11-29 14:29:52 · 475 阅读 · 0 评论 -
2017hdu新生赛 1004 正品的概率
正品的概率Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1072 Accepted Submission(s): 125Problem Description袋中有m枚正品硬币,n枚次品硬币(次品硬币原创 2017-11-29 14:23:34 · 496 阅读 · 0 评论 -
2017hdu新生赛 1003 下起楼来我最快
下起楼来我最快Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2011 Accepted Submission(s): 250Problem Description王尼玛是一名机智的程序员,他的机智主要原创 2017-11-29 13:31:12 · 551 阅读 · 0 评论 -
2017hdu新生赛 1002身份证验证
身份证验证Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1690 Accepted Submission(s): 222Problem Description大学时代的小Q,是一个志向远大的热血青年,原创 2017-11-29 13:12:31 · 745 阅读 · 0 评论 -
2017hdu新生赛 1001考研
考研Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1011 Accepted Submission(s): 492Problem Description今天参加比赛的同学,我想以后准备考研的一定有不少原创 2017-11-29 13:09:08 · 738 阅读 · 0 评论 -
Atcoder Blue and Red Balls
https://atcoder.jp/contests/abc132/tasks/abc132_dD - Blue and Red BallsTime Limit: 2 sec / Memory Limit: 1024 MBScore :400pointsProblem StatementThere areKblue balls andN−Kred balls. T...原创 2019-06-30 15:48:26 · 642 阅读 · 0 评论 -
AtCoder Beginner Contest 092 D - Grid Components
#include<cstdio>#include <cmath>using namespace std;int main(){ int a,b; scanf("%d%d",&b,&a); int ta=a-1; int tb=b-1; a=a-1; b=b-1; printf("%d %d\n",...原创 2018-03-27 15:22:41 · 247 阅读 · 0 评论 -
AtCoder Beginner Contest 092 C - Traveling Plan
#include <iostream>#include <cstdlib>using namespace std;int v[100005];int main() { int n; cin>>n; int ans=0; for(int i=1;i<=n;i++){ scanf("%d",&v[...原创 2018-03-27 15:21:17 · 249 阅读 · 0 评论 -
AtCoder Beginner Contest 092 A - Traveling Budget
w=[]for i in range(4): w.append(input())print min(w[0],w[1])+min(w[2],w[3])原创 2018-03-27 15:19:58 · 190 阅读 · 0 评论 -
AtCoder Grand Contest 020 B - Ice Rink Game
B - Ice Rink GameTime limit : 2sec / Memory limit : 512MBScore : 500 pointsProblem StatementAn adult game master and N children are playing a game on an ice rink. The game consis原创 2018-01-15 14:56:33 · 501 阅读 · 0 评论 -
AtCoder Beginner Contest 085 C - Otoshidama
C - OtoshidamaTime limit : 2sec / Memory limit : 256MBScore : 300 pointsProblem StatementThe commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the w原创 2018-01-11 15:31:50 · 380 阅读 · 0 评论 -
Codeforces Round #462 (Div. 2) B. A Prosperous Lot
B. A Prosperous Lottime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputApart from Nian, there is a daemon named Sui, which terrifies children and cause...原创 2018-02-18 10:58:22 · 315 阅读 · 0 评论 -
Codeforces Round #461 C. Cave Painting
C. Cave Paintingtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputImp is watching a documentary about cave painting.Some numbers, carved in chaotic o...原创 2018-02-14 11:22:05 · 252 阅读 · 0 评论 -
CF 1A - Theatre Square
A. Theatre Squaretime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputTheatre Square in the capital city of Berland has a rectangular shape with the siz...原创 2018-02-10 19:48:10 · 211 阅读 · 0 评论 -
Codeforces Round #456 B. New Year's Eve
B. New Year's Evetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputSince Grisha behaved well last year, at Ne原创 2018-01-08 18:42:48 · 297 阅读 · 0 评论 -
Codeforces Round #456 A. Tricky Alchemy
A. Tricky Alchemytime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputDuring the winter holidays, the demand for原创 2018-01-07 19:58:11 · 574 阅读 · 0 评论 -
Codeforces Round #441 D. Sorting the Coins
D. Sorting the Coinstime limit per test1 secondmemory limit per test512 megabytesinputstandard inputoutputstandard outputRecently, Dima met with Sasha in a phil原创 2017-10-19 11:24:10 · 502 阅读 · 0 评论 -
Codeforces Round #441 C. Classroom Watch
C. Classroom Watchtime limit per test1 secondmemory limit per test512 megabytesinputstandard inputoutputstandard outputEighth-grader Vova is on duty today in th原创 2017-10-19 11:20:57 · 270 阅读 · 0 评论 -
Codeforces Round #441 B. Divisiblity of Differences
B. Divisiblity of Differencestime limit per test1 secondmemory limit per test512 megabytesinputstandard inputoutputstandard outputYou are given a multiset of n原创 2017-10-19 11:12:51 · 346 阅读 · 0 评论 -
Codeforces Round #441 A. Trip For Meal
A. Trip For Mealtime limit per test1 secondmemory limit per test512 megabytesinputstandard inputoutputstandard outputWinnie-the-Pooh likes honey very much! That原创 2017-10-19 11:06:43 · 271 阅读 · 0 评论 -
Codeforces Round #440 B. Maximum of Maximums of Minimums
B. Maximum of Maximums of Minimumstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given an array a1原创 2017-10-19 10:53:10 · 382 阅读 · 0 评论 -
Codeforces Round #440 A. Search for Pretty Integers
A. Search for Pretty Integerstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given two lists of non原创 2017-10-19 10:48:27 · 404 阅读 · 0 评论 -
Codeforces Round #438 B. Race Against Time
B. Race Against Timetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputHave you ever tried to explain to the原创 2017-10-06 15:11:29 · 253 阅读 · 0 评论 -
Codeforces Round #438 A. Bark to Unlock
A. Bark to Unlocktime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAs technologies develop, manufacturers ar原创 2017-10-06 15:07:24 · 490 阅读 · 0 评论 -
AtCoder Beginner Contest 086 C - Traveling
C - TravelingTime limit : 2sec / Memory limit : 256MBScore : 300 pointsProblem StatementAtCoDeer the deer is going on a trip in a two-dimensional plane. In his plan, he will depart from point (0,0) at...原创 2018-02-27 20:26:12 · 412 阅读 · 0 评论 -
UVa1589 ACM/ICPC 2011 象棋
Xiangqi is one of the most popular two-player board games in China. The game represents a battlebetween two armies with the goal of capturing the enemy’s “general” piece. In this problem, you aregiven原创 2016-08-15 08:53:06 · 849 阅读 · 2 评论 -
UVa220 ACM/ICPC 1992黑白棋
Othello is a game played by two people on an 8 x 8 board, using disks that are white on one side andblack on the other. One player places disks with the white side up and the other player places disks原创 2016-08-10 13:33:16 · 1691 阅读 · 0 评论 -
UVa202 ACM/ICPC 1990 循环小数
The decimal expansion of the fraction 1/33 is 0.03, where the 03 is used to indicate that the cycle 03repeats indefinitely with no intervening digits. In fact, the decimal expansion of every rational原创 2016-07-27 20:28:35 · 966 阅读 · 1 评论 -
UVa232 ACM/ICPC 1994 纵横字谜的答案
输入一个输入一个r行c列(1≤r,c≤10)的网格,黑格用“*”表示,每个白格都填有一个字母。如果一个白格的左边相邻位置或者上边相邻位置没有白格(可能是黑格,也可能出了网格边界),则称这个白格是一个起始格。首先把所有起始格按照从上到下、从左到右的顺序编号为1, 2, 3,…。接下来要找出所有横向单词(Across)。这些单词必须从一个起始格开始,向右延伸到一个黑格的左边或者整个网格的最右列原创 2016-07-27 14:06:12 · 1517 阅读 · 0 评论 -
AtCoder Beginner Contest 091 C - 2D Plane 2N Points
C - 2D Plane 2N PointsTime limit : 2sec / Memory limit : 256MBScore : 400 pointsProblem StatementOn a two-dimensional plane, there are N red points and N blue points. The coordinates of the i-th red p...原创 2018-03-27 11:12:00 · 600 阅读 · 0 评论 -
hdu 1029 Ignatius and the Princess IV
Ignatius and the Princess IVTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32767 K (Java/Others)Total Submission(s): 28791 Accepted Submission(s): 12188Problem Descriptio原创 2017-01-04 15:52:45 · 496 阅读 · 0 评论 -
我要拿走你的蜡烛 1004
Problem DescriptionDarkrai最近喜欢玩《炉石传说》,他在一局比赛中使用了吉安娜英雄,选择了冰法套牌。炉石传说游戏的目的是使对方英雄的生命值降低到0点及0点以下,谁先做到谁就获得胜利。炉石传说有一个规则限制是法力水晶,每回合玩家会有一定的法力水晶(本题目中全部看作10个),每使用一张卡牌,会消耗卡牌左上角的数字的法力水晶,法力水晶不够即无法使用。本题目中涉及...原创 2017-01-04 19:36:03 · 1015 阅读 · 2 评论 -
2017 Multi-University Training Contest 9 solutions 1008 Numbers(hdu6168)
将b数组排序,取出最小的两项作为a1,a2a1,a2,删除a1,a2,a1+a2a1,a2,a1+a2,再取出最小项作为a3a3,再删除a3,a1+a3,a2+a3a3,a1+a3,a2+a3,再取出最小项作为a4a4,依次列推。 刚开始用vector写的超时,复杂度为O(nˆ3) #include...原创 2017-08-29 17:53:49 · 309 阅读 · 0 评论 -
2017 Multi-University Training Contest 2 solutions 1001 Is Derek lying?
首先,我们统计出Derek和Alfia答案相同的题目数量k1和答案不同的题目数量k2. 对于两人答案相同的题目,共有以下两种情况:两人都对b.两人都错 对于两人答案不同的题目,共有以下三种情况: c.Derek对Alfia错 d.Alfia对Derek错 e.两人都错 于是我们可以列出一些方程: k1+k2=n a+b=k1 c+d+e=k2 a+c=x a+d=y 又a,b,原创 2017-08-07 10:34:42 · 283 阅读 · 0 评论