NOJ [1078] Wizards and Demonstration

  • 问题描述
  • Some country is populated by wizards. They want to organize a demonstration.

    There are n people living in the city, x of them are the wizards who will surely go to the demonstration. Other city people (n - xpeople) do not support the wizards and aren't going to go to the demonstration. We know that the city administration will react only to the demonstration involving at least y percent of the city people. Having considered the matter, the wizards decided to create clone puppets which can substitute the city people on the demonstration.

    So all in all, the demonstration will involve only the wizards and their puppets. The city administration cannot tell the difference between a puppet and a person, so, as they calculate the percentage, the administration will consider the city to be consisting of only n people and not containing any clone puppets.

    Help the wizards and find the minimum number of clones to create to that the demonstration had no less than y percent of the city people.

  • 输入
  • The first line contains three space-separated integers, n, x, y (1 ≤ n, x, y ≤ 10^4, x ≤ n) — the number of citizens in the city, the number of wizards and the percentage the administration needs, correspondingly.

    Please note that y can exceed 100 percent, that is, the administration wants to see on a demonstration more people that actually live in the city ( > n).
  • 输出
  • Print a single integer — the answer to the problem, the minimum number of clones to create, so that the demonstration involved no less than y percent of n (the real total city population).
    Sample test(s)


    签到题,但不管题目简单还是难,我们都要仔细去对待。
    #include<stdio.h>
    #include<math.h>
    
    int main()
    {
    	int n,x,y;
    	while(~scanf("%d%d%d",&n,&x,&y))
    	{
    		int num=ceil(n*(y*1.0/100));
    		if(x>=num)
    		    printf("0\n");
    	    else
    	    	printf("%d\n", num - x );
    	}
    	return 0;
    }


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值