算术
来源:互联网 发布:知达常青藤中学校费用 编辑:程序博客网 时间:2024/04/28 05:07
Problem B算术
Description
要求(A/B)%9973,但由于A很大,我们只给出n(n=A%9973)(我们给定的A必能被B整除,且gcd(B,9973)= 1,gcd表示最大公约数)。
Input
每组数据有两个数n(0<= n < 9973)和B(1<= B <= 10^9) ,以EOF为结尾。
Output
对应每组数据输出(A/B)%9973。
Sample Input
1000 53
87 123456789
Sample Output
7922
6060
#include <iostream>#include <cstdio>#include <string.h>using namespace std;int main(){ int numcase; long long n,b; while(scanf("%lld %lld",&n,&b)!=EOF) { int x; for(int i = 0; i < 9973; ++i) { if(( b * i - n ) % 9973 == 0) { x = i; break; } } printf("%d\n",x); } return 0;}
0 0
- 算术
- 算术
- 算术平均数
- 算术函数
- 算术题
- 算术编码
- 算术编码
- 算术平均数
- 算术编码
- 算术转换
- 算术表达式
- 算术运算
- 算术类型
- 算术编码
- 小学生算术
- 算术表达式
- 小学生算术
- 小学生算术
- 消防局的设立
- javascript中 函数体里 return返回值 与 参数传参 的区别
- 一个猜数字的游戏
- spring boot quick start
- 词法分析☞NFA语言识别
- 算术
- Linux 查看CPU信息,机器型号,内存等信息
- Python单元测试框架-用例执行顺序
- 第七周分解三位数
- python八大排序算法
- 单例模式 接口回调 异常
- IplImage结构体
- Ubuntu下安装hive,并配置mysql作为元数据库
- TBSchedule原理与实践