HDU
来源:互联网 发布:旗帜软件照片处理器 编辑:程序博客网 时间:2024/06/11 05:17
本来是个求逆元的题,
但是这里可以 枚举 (A / B),已知 A % m = n ,
#include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>#include <string>#include <cmath>#include <set>#include <map>#include <stack>#include <queue>#include <ctype.h>#include <vector>#include <algorithm>#include <sstream>#define PI acos(-1.0)#define in freopen("in.txt", "r", stdin)#define out freopen("out.txt", "w", stdout)using namespace std;typedef long long ll;const int maxn = 500 + 7, INF = 0x3f3f3f3f, mod = 1e9 + 7;int T;ll b, t, n;int main() { scanf("%d", &T); while(T--) { scanf("%lld%lld", &n, &b); for(ll i = 1; i <= 9973; ++i) { ll t = i*b-n; if(t % 9973 == 0) { printf("%lld\n", (i%9973)); break; } } } return 0;}
阅读全文
1 0
- hdu
- hdu
- HDU
- hdu ()
- hdu
- hdu
- HDU
- HDU
- hdu
- hdu
- HDU
- Hdu
- hdu
- hdu-
- hdu
- hdu
- hdu
- HDU
- 【PAT】【Advanced Level】1113. Integer Set Partition (25)
- IntelliJ IDEA搭建Springboot项目解决热加载问题
- Java 学习大纲
- Spring In Action(一)DI、AOP
- 拖拽照片墙
- HDU
- 真Unity3d_2dtoolkit显示中文
- xjoi奋斗群群赛8
- DCGAN论文笔记+源码解析
- java中queue的使用
- 前端面试中的常见的算法问题
- python3下使用TensorFlow Object Detection打包TFRecord
- Cookie Cannot be resolved to a type
- Lucene学习总结之三:Lucene的索引文件格式(1)