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. com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: 3 字节的 UTF-8 序列的字节 x 无效

    在启动Tomcat项目时,控制台报错:nested exception is com.sun.org.apache.xerces.internal.impl.io.MalformedByteSeque ...

  2. 【mysql】The server quit without updating PID file

      groupadd mysql useradd -r -g mysql mysql cd /usr/local/mysql chown -R mysql:mysql . scripts/mysql_ ...

  3. Hadoop4.2HDFS测试报告之六

    测试结论 第一组数据作表格作图: 第二组数据作表格作图: 根据以上图分析得出以下结论: 1. 本地存储的读写速率基本保持23M左右,说明本地存储比较稳定. 2. HDFS存储两个数据节点的读写速率性能 ...

  4. HDU 3861 The King’s Problem 强连通分量 最小路径覆盖

    先找出强连通分量缩点,然后就是最小路径覆盖. 构造一个二分图,把每个点\(i\)拆成两个点\(X_i,Y_i\). 对于原图中的边\(u \to v\),在二分图添加一条边\(X_u \to Y_v\ ...

  5. Ubuntu下安装anaconda和pycharm

    折腾了一上午,终于装好了,如下:Python环境的安装: 安装anaconda 建议去https://www.anaconda.com/download/#linux直接用Ubuntu界面的搜狐浏览器 ...

  6. 细嚼慢咽 Mongoose 5

    此文已由作者黄锴授权网易云社区发布. 欢迎访问网易云社区,了解更多网易技术产品运营经验. 前言 由于Mongoose一直没有中文文档,加上现在市面上充斥着太多"快速上手",很多中文 ...

  7. python学习-- class 类中需要注意的地方

    from django.db import models class Person(models.Model):     name = models.CharField(max_length=30) ...

  8. 从几率到logisitic函数

    odds 几率,又称事件的优势比.几率和概率的关系如下: o=p1−pp=o1+o Logistic 回归模型的因变量只有 1/0 两种取值.假设在 p 个独立自变量 x1,x2,…,xp 作用下,记 ...

  9. 【Kubernetes】The connection to the server <master>:6443 was refused - did you specify the right host or port?

    不知道怎么用着用着,使用kubectl 时报错,错误如下: root@R740--:~# kubectl get pod The connection to the server 107.105.13 ...

  10. 九度oj 题目1085:求root(N, k) 清华2010年机试题目

    题目描述: N<k时,root(N,k) = N,否则,root(N,k) = root(N',k).N'为N的k进制表示的各位数字之和.输入x,y,k,输出root(x^y,k)的值 (这里^ ...