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);(都是后话了。。。)

回归正题,写题解。。。

A. A Very Hard Question
 
time limit per test

1.0 s

memory limit per test

256 MB

input

standard input

output

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?

Input

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.

Output

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.

Example
input
3
10 25
300 20
550 100
output
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的更多相关文章

  1. 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 ...

  2. 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 ...

  3. Codeforces Gym101502 J-取数博弈

    还有J题,J题自己并不是,套的板子,大家写的都一样,因为大家都是套板子过的,贴一下代码,等学会了写一篇博客... J.Boxes Game 代码: 1 //J. Boxes Game-取数博弈-不会, ...

  4. 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 ...

  5. 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 ...

  6. 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 ...

  7. 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 ...

  8. Codeforces 586D. Phillip and Trains 搜索

    D. Phillip and Trains time limit per test: 1 second memory limit per test :256 megabytes input: stan ...

  9. 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 ...

随机推荐

  1. java实现可安装的exe程序

    java实现可安装的exe程序 通过编写Java代码,实现可安装的exe文件的一般思路: 1.在eclipse中创建java项目,然后编写Java代码,将编写好的Java项目导出一个.jar格式的ja ...

  2. Eclipse将java项目导出可执行的jar文件

    1.在java项目上右键,点击“Export”,会弹出一个选择导出的文件类型 版权声明:本文为博主原创文章,未经博主允许不得转载. 原文地址:https://www.cnblogs.com/poter ...

  3. 多线程之volatile关键字(五)

    开始全文之前,先铺垫一下jvm基础知识以及线程栈: JVM栈是线程私有的,每个线程创建的同时都会创建JVM栈,JVM栈中存放的为当前线程中局部基本类型的变量(java中定义的八种基本类型:boolea ...

  4. zoj 4056

    At 0 second, the LED light is initially off. After BaoBao presses the button 2 times, the LED light ...

  5. Linux学习-服务器硬件数据的收集

    以系统内建 dmidecode 解析硬件配备 系统有个名为 dmidecode 的软件,它可以解析 CPU 型号.主板型号与内存相 关的型号等等~ [root@study ~]# dmidecode ...

  6. Activity树图

  7. javascript 内置日期转换方法

    var d = new Date(); console.log(d); // 输出:Mon Nov 04 2013 21:50:33 GMT+0800 (中国标准时间) console.log(d.t ...

  8. webdriver高级应用- 使用日志模块记录测试过程中的信息

    在自动化脚本执行过程中,使用Python的日志模块记录在测试用例执行过程中一些重要信息或者错误日志等,用于监控和后续调试脚本. 在pycharm下新建工程,并创建Log.py.Logger.conf以 ...

  9. 设计模式之工厂模式 Factory实现

    simpleFactory //car接口 public interface Car { void run(); } //两个实现类 public class Audi implements Car{ ...

  10. FastText 介绍

    FastText 介绍 在面试百度的NLP工程师时,被问及常用的词向量表示学习方法有哪些,我说知道word2vec,然后大佬又问我知道FastText么... 这就很尴尬了,不会! 不同于word2v ...