Educational Codeforces Round 39 B Weird Subtraction Process
传送门
模拟,写的比较土,别吐槽
#include <bits/stdc++.h> using namespace std; typedef long long ll ; typedef double dl ; #define INF 0x7fconst int inf = 987654321; const int sz = 1e6 + 5; const int mod = 1e9 + 7; const int sqrtn = 300;#define f(i,l,r) for(int i=l;i<=r;++i) #define g(i,l,r) for(int i=l;i>=r;--i) #define CLR(arr,val) memset(arr,val,sizeof(arr)) #define sz(a) strlen(a) #define FAST_IO ios::sync_with_stdio(false);cin.tie(0);#define lowbit(x) x&(-x) #define X first #define Y second #define pb push_back #define pii pair<int,int>int dir[8][2]={{1,0},{-1,0},{0,1},{0,-1},{1,1},{1,-1},{-1,1},{-1,-1}}; ll a,b;void work() {cin>>a>>b;while(1){if(a==0||b==0){break;}else{if(a>=2*b){a=a-a/(2*b)*(2*b);continue;}else{if(b>=2*a){b=b-b/(2*a)*(2*a);continue;}else{break;}}}} cout<<a<<" "<<b<<endl; }int main() {FAST_IO ;freopen("in","r",stdin);freopen("out","w",stdout);work();return 0; }
转载于:https://www.cnblogs.com/corx/p/8523835.html
Educational Codeforces Round 39 B Weird Subtraction Process相关推荐
- Educational Codeforces Round 39 G Almost Increasing Array
传送门 非减子序列 普通lcs Dp TLE ,换成upper_bound 竟然过了,神奇 #include <bits/stdc++.h> using namespace std; ty ...
- Educational Codeforces Round 39 F Largest Beautiful Number
传送门 暴力DP dp[i][j][k] 从j 到 k 发f(x) 的大小, #include <bits/stdc++.h> using namespace std; typedef l ...
- Educational Codeforces Round 39 A Partition
传送门 分治就好了,哈哈大于小于0的数据分开算 #include <bits/stdc++.h> using namespace std; typedef long long ll ; t ...
- Educational Codeforces Round 90 (Rated for Div. 2)(A, B, C, D, E)
Educational Codeforces Round 90 (Rated for Div. 2) Donut Shops 思路 分三种情况: a==c/ba == c / ba==c/b这个时候两 ...
- Educational Codeforces Round 24 E. Card Game Again(双指针)
题目链接:Educational Codeforces Round 24 E. Card Game Again 题意: 给你n个数和一个数k. 现在每次可以拿掉前x个数,后y个数,剩下的数的乘积要能被 ...
- Educational Codeforces Round 74 (Rated for Div. 2)
Educational Codeforces Round 74 (Rated for Div. 2) 原题地址 # 题目 分数 是否AC A Prime Subtraction 900 ✅ B Kil ...
- Educational Codeforces Round 113 (Rated for Div. 2) ABCD 解题思路
Educational Codeforces Round 113 (Rated for Div. 2) 经典卡CCC秒DDD,可惜了 怪自己特判写错了吧,对式子找了半天问题结果根本不是式子的问题 A ...
- [Educational Codeforces Round 16]A. King Moves
[Educational Codeforces Round 16]A. King Moves 试题描述 The only king stands on the standard chess board ...
- Educational Codeforces Round 114 (Rated for Div. 2) (A ~ F)全题解
整理的算法模板合集: ACM模板 点我看算法全家桶系列!!! 实际上是一个全新的精炼模板整合计划 Educational Codeforces Round 114 (Rated for Div. 2) ...
最新文章
- 两款旋转编码器测量LDP3806,BH60
- navicat修改sqlserver密码_oracle密码过期
- 记一次项目中由id类型引起的bug
- 一篇来自前端同学对后端接口的吐槽:痛!
- python使用函数的目的_python之函数基本使用
- tensorflow随笔-tf.group
- 电脑ip地址设置_路由器怎么设置静态IP 路由器设置静态IP方法【详解】
- Making the Grade POJ - 3666(离散化+dp)
- php中不让数组初始化,javascript中数组与php数组初始化差异
- linux网络子系统分析(三)—— 设备无关层
- zepto 自定义打包
- ddr3ddr4 lpddr4速率_LPDDR4和LPDDR3性能差别多少 LPDDR4和LPDDR3参数对比
- 【应届生租房】应届生如何租房以及注意事项
- 世界三大数学猜想 哥德巴赫猜想 费马大定理: 费马猜想: 质数算法c++ 1.NP完全问题 2.霍奇猜想 3.庞加莱猜想 4.黎曼假设 5.杨-米尔斯存在性和质量缺口 6.纳卫尔-
- vue项目如何打包以及如何变成android、ios应用程序
- 【JoJo的摄影笔记】黎明女神的呼唤—— 佳能王朝霸业崛起
- Spark MLlib特征处理:MinMax最大最小值区间缩放---原理及实战
- 互联网、云计算之用户服务
- python卡尔曼滤波室内定位_基于Unscented卡尔曼滤波的室内定位
- 方便快捷,浏览器利器——Vimium(详解)
热门文章
- 2022-2028年中国塑料制品行业投资分析及前景预测报告(全卷)
- 分布式训练使用手册-paddle 数据并行
- pytorch学习笔记(十二):详解 Module 类
- Pytorch Bi-LSTM + CRF 代码详解
- 低数值精度推理和训练
- 3D Cube计算引擎加速运算
- 客快物流大数据项目(六):Docker与虚拟机的形象比喻及组件介绍
- centos7 安装 Mysql 5.7.28,详细完整教程
- Django设计模型1.2
- Oracle报错createPool,Jmeter中连接Oracle报错Cannot create PoolableConnectionFactory