UVa:10673 Play with Floor and Ceil
来源:互联网 发布:淘宝桔子表行是正品吗 编辑:程序博客网 时间:2024/05/24 01:51
数学水题,列一个方程,直接暴力即可。
#include <iostream>#include <cstdio>#include <cstring>#include <algorithm>#include <cmath>#define MAXN 100000000#define ll long longusing namespace std;int main(){ int T; scanf("%d",&T); while(T--) { ll x,k; scanf("%lld%lld",&x,&k); ll a=(int)floor(x*1.0/k),b=(int)ceil(x*1.0/k); ll xx,yy; for(int i=0; i<=MAXN; ++i) if((x-i*a)%b==0) { xx=i; yy=(x-i*a)/b; break; } printf("%lld %lld\n",xx,yy); } return 0;}
- uva 10673 - Play with Floor and Ceil
- UVA 10673 Play with Floor and Ceil
- UVa 10673 - Play with Floor and Ceil
- uva 10673 - Play with Floor and Ceil
- UVA 10673 Play with Floor and Ceil
- UVA - 10673 Play with Floor and Ceil
- UVA 10673 Play with Floor and Ceil
- UVa:10673 Play with Floor and Ceil
- UVa 10673 - Play with Floor and Ceil
- Play with Floor and Ceil - UVa 10673
- UVA - 10673 Play with Floor and Ceil
- UVA 10673 Play with Floor and Ceil
- uva 10673 Play with Floor and Ceil(简单数论)
- UVa 10673 Play with Floor and Ceil (数论)
- uva 10673 - Play with Floor and Ceil(欧几里得)
- uva 10673 - Play with Floor and Ceil(欧几里得算法)
- UVA 10673 Play with Floor and Ceil (扩展欧几里得算法)
- UVa 10673 - Play with Floor and Ceil (扩展欧几里得)
- 黑马程序员_java网络编程技术的理解
- Property Service学习(一)
- 华为Ascend Mate | 6.1英寸大屏手机 | 零距离高清图赏
- 黑马程序员_Java反射技术
- POJ2965(枚举+位运算)
- UVa:10673 Play with Floor and Ceil
- 寻找调用DebugPort的函数
- 换系统---保留旧数据
- Android-SDK-Manager 不能更新最有效的解决方法
- [ACM - 数论]Eddy's digital Roots(九余数定理)
- 华为 Ascend Mate 初体验|主流跑分软件测试|特色功能体验|拍照能力对比
- twitter面试题之装水问题
- 华为 Ascend Mate 电池续航测试|5小时日常使用测试+8小时待机测试
- JS中如何检测img图片加载完成?