Codeforces Gym101502 A.Very Hard Question
2017 JUST Programming Contest 3.0
昨天的训练赛,打的好难过,因为被暴打了,写了8题,他们有的写了9题,差了一道dp,博客上写7道题的题解。
因为有一道是套板子过的,并不懂,他们说是取数博弈,也有学长说是记忆化dp,等学会了再写博客。。。
先占个坑,D题dp,J题记忆化dp(取数博弈)。。。
写其他的题解,这场比赛感触很深,测评姬一开始睡觉了,emnnn,然后发生了很多有趣的故事。。。
卡数组大小,卡输入输出,长个脑子了,不要轻易用cout,用的话关流同步ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);(都是后话了。。。)
回归正题,写题解。。。
1.0 s
256 MB
standard input
standard output
Husam was preparing himself for the Graduate Record Examinations (GRE). Yesterday, he read a very hard question, but he could not find a solution for it, so he did not sleep all the night.
Husam decided to tell you about the question, so you can help him to find the solution. The question is: If the price of the orange was increased by x%. How many oranges can be bought for the amount that used to buy yoranges?
Can you help Husam to solve this question?
The first line contains an integer T (1 ≤ T ≤ 104), where T is the number of test cases.
Then T lines follow, each line contains two integers y and x (1 ≤ y ≤ 106) (0 ≤ x ≤ 100), where y is the number of oranges, and x is the percentage increase in price.
For each test case, print a single line containing the number of oranges that can be bought for the same amount of money that used to buy y oranges before the price increased.
It is guaranteed that all answers are integer numbers. Do not print any floating-point values.
3
10 25
300 20
550 100
8
250
275
这个水题卡cout,很不幸被卡了一手。。。
代码:
//A. Very Hard Question-卡一手cout
#include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
using namespace std;
int main(){
int t;
scanf("%d",&t);
while(t--){
int n,m,ans;
scanf("%d%d",&n,&m);
ans=n**1.0/(+m);
printf("%d\n",ans);
}
return ;
}
Codeforces Gym101502 A.Very Hard Question的更多相关文章
- Codeforces Gym101502 E.The Architect Omar-find()函数
E. The Architect Omar time limit per test 1.0 s memory limit per test 256 MB input standard input ...
- Codeforces Gym101502 K.Malek and Summer Semester
K. Malek and Summer Semester time limit per test 1.0 s memory limit per test 256 MB input standard ...
- Codeforces Gym101502 J-取数博弈
还有J题,J题自己并不是,套的板子,大家写的都一样,因为大家都是套板子过的,贴一下代码,等学会了写一篇博客... J.Boxes Game 代码: 1 //J. Boxes Game-取数博弈-不会, ...
- Codeforces Gym101502 I.Move Between Numbers-最短路(Dijkstra优先队列版和数组版)
I. Move Between Numbers time limit per test 2.0 s memory limit per test 256 MB input standard inpu ...
- Codeforces Gym101502 H.Eyad and Math-换底公式
H. Eyad and Math time limit per test 2.0 s memory limit per test 256 MB input standard input outpu ...
- Codeforces Gym101502 F.Building Numbers-前缀和
F. Building Numbers time limit per test 3.0 s memory limit per test 256 MB input standard input ou ...
- Codeforces Gym101502 B.Linear Algebra Test-STL(map)
B. Linear Algebra Test time limit per test 3.0 s memory limit per test 256 MB input standard input ...
- Codeforces 586D. Phillip and Trains 搜索
D. Phillip and Trains time limit per test: 1 second memory limit per test :256 megabytes input: stan ...
- Codeforces Round #389 Div.2 D. Santa Claus and a Palindrome
time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standa ...
随机推荐
- python入门:1-99所有数的和的等式
#!/usr/bin/env python # -*- coding:utf-8 -*- #1-99所有数的和的等式 #start(开始,译音:思达二测)sum(合计,译音:桑木)temp(临时雇员, ...
- crond定时操作 crontab
* * * * * 分别表示 分钟 小时 日 月 星期(0-6) 30 17,28,19 * * * 或 30 17-19 * * * 在每天的17-19小时半点时刻执行 30 8-18 ...
- Java-basic-4-数据类型
Number类 装箱:将内置数据类型作为包装类对象使用:拆箱:相反 public class test{ public static void main(String args[]) { // box ...
- Python如何查看变量在内存中的地址
在python中可以用id()函数获取对象的内存地址. 用法: object = 1 + 2 object -- 对象
- nrf52810学习笔记——二
nrf52810为nordic支持蓝牙 5.0性价比最高的一款芯片,不过这个芯片的rom不得不吐槽下,只有192KB,不知道为什么定了个192,而不是大家所熟悉的256KB,估计价格是个原因吧,15. ...
- 安装liteIDE on mac
download and install: http://sourceforge.net/projects/liteide/files/ 解决不能编译,没有自动完成的问题: http://stacko ...
- CodeForces 543D 树形DP Road Improvement
题意: 有一颗树,每条边是好边或者是坏边,对于一个节点为x,如果任意一个点到x的路径上的坏边不超过1条,那么这样的方案是合法的,求所有合法的方案数. 对于n个所有可能的x,输出n个答案. 分析: 题解 ...
- windows下创建子进程过程中代码重复执行问题
windows在启动子进程的时候会将主进程文件倒入到子进程中.导入模块就相当于执行这个模块中的代码, 所以第一个print会在主进程中执行一次,又在被导入的过程中在子进程中又执行了一次. p.star ...
- jquery如何获取某一个兄弟节点
$('#id').siblings() 当前元素所有的兄弟节点 $('#id').prev() 当前元素前一个兄弟节点 $('#id').prevaAll() 当前元素之前所有的兄弟节点 $('#id ...
- Windows杂技
WINDOWS下 ,在某目录下按住shift加鼠标右键,可以直接有当前目录的dos窗口 win10不能用 解决办法是在当前文件夹的地址栏输入cmd然后回车 发现Powershell可以当作dos执行相 ...