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 ...
随机推荐
- charles 模拟手机弱网、修改请求参数、修改返回值
1.charles模拟弱网(断网) 2.charles修改请求参数 (1)先访问一次需要改的请求,在charles上找到相应的请求地址 (2)然后在需要打断点的请求上右键,勾选[Breakpoints ...
- nginx静态资源web服务
静态资源:非服务器动态运行生成的文件 浏览器端渲染:html ,css,js 图片:jpeg,gif,png 视频:flv ,mpeg 文件:txt,等任意下载文件 静态资源服务场景:CDN 文件读取 ...
- Python简单试题3
1,水仙花数 水仙花数是指一个 3 位数,它的每个位上的数字的 3次幂之和等于它本身 (例如:1^3 + 5^3+ 3^3 = 153) 代码如下: 方法一: for i in range(100, ...
- ACM-ICPC 2018 徐州赛区网络预赛 H. Ryuji doesn't want to study
262144K Ryuji is not a good student, and he doesn't want to study. But there are n books he should ...
- V4L2使用V4L2_MEMORY_USERPTR和V4L2_MEMORY_MMAP的区别
视频应用可以通过两种方式从V4L2驱动申请buffer 1. USERPTR, 顾名思义是用户空间指针的意思,应用层负责分配需要的内存空间,然后以指针的形式传递给V4L2驱动层,V4L2驱动会把cap ...
- matlab图形handle
- 自建NAS如何使用大于2TB的硬盘(从分区开始)
目录 自建NAS如何使用大于2TB的硬盘(从分区开始) 对分区进行格式化 挂载到某一目录(需设置开机自动挂载) 上传文件测试: 补充 自建NAS如何使用大于2TB的硬盘(从分区开始) 需求说明: 自建 ...
- MyBatis拦截器打印不带问号的完整sql语句方法
/* Preparing: SELECT * FROM tb_user WHERE id = ? AND user_name = ? 目标是打印:SELECT * FROM tb_user WHER ...
- day03_10 注释及简单的用户输入输出
单行注释# print ("我爱北京天安门") print ("我爱北京天安门") #print ("我爱北京天安门") #print (& ...
- python-网络编程-02
[1] server端 首先我们看下一个最简单http服务端 import socket def handle_request(client): buf = client.recv(1024) cli ...