CodeForces 732 A.Buy a Shovel(水~)
来源:互联网 发布:淘宝店优惠券怎么设置 编辑:程序博客网 时间:2024/05/29 12:28
Description
有无限个10元硬币和一个r元金币,一件物品k元,问至少需要几件物品才不要找零
Input
两个整数k和r(1<=k<=1000,1<=r<=9)
Output
Sample Input
117 3
Sample Output
9
Solution
枚举件数,至多10件
Code
#include<cstdio>#include<iostream>#include<cstring>#include<algorithm>#include<cmath>#include<vector>#include<queue>#include<map>#include<set>#include<ctime>using namespace std;typedef long long ll;#define INF 0x3f3f3f3f#define maxn 1111int k,r;int main(){ while(~scanf("%d%d",&k,&r)) { for(int i=1;i<=10;i++) if(i*k%10==0||i*k%10==r) { printf("%d\n",i); break; } } return 0;}
0 0
- CodeForces 732 A.Buy a Shovel(水~)
- 【71.76%】【codeforces 732A】Buy a Shovel
- Codeforces 732A.Buy a Shovel
- CodeForces 732A Buy a Shovel
- Codeforces 732A-Buy a Shovel
- CodeForces 732A 之 Buy a Shovel
- codeforces 732A Buy a Shovel(水题)
- CodeForces-732A-Buy a Shovel(水题)
- codeforces——732A——Buy a Shovel
- A. Buy a Shovel
- A. Buy a Shovel
- CodeForces 732A Buy a Shovel(买铁铲不找零,掉分继续)
- Buy a Shovel
- Codeforces Round #377 (Div. 2) A. Buy a Shovel
- codeforces732A A. Buy a Shovel
- codeforces 230/A 水~~
- CodeForces 653A【水】
- Buy a Hat
- 进程环境
- [leetcode]566. Reshape the Matrix
- xdoj 1192: 锘爷考驾照
- 倒入包缺少R文件
- laravel中predis的应用
- CodeForces 732 A.Buy a Shovel(水~)
- jsp:include 之导入版权信息
- python使用mysql数据库
- Django与ajax之间的json传输
- 速度原理
- Android Activity onPause ,onStop ,onDestroy方法不一定执行
- Android中Handler的理解
- xdoj 1195: V8与女友
- mybatis输出高级映射(一对多查询)