Codeforces Round #347 (Div. 2) A
Description
Greatest common divisor GCD(a, b) of two positive integers a and b is equal to the biggest integer d such that both integers a and b are divisible by d. There are many efficient algorithms to find greatest common divisor GCD(a, b), for example, Euclid algorithm.
Formally, find the biggest integer d, such that all integers a, a + 1, a + 2, ..., b are divisible by d. To make the problem even more complicated we allow a and b to be up to googol, 10100 — such number do not fit even in 64-bit integer type!
The only line of the input contains two integers a and b (1 ≤ a ≤ b ≤ 10100).
Output one integer — greatest common divisor of all integers from a to b inclusive.
1 2
1
61803398874989484820458683436563811772030917980576 61803398874989484820458683436563811772030917980576
61803398874989484820458683436563811772030917980576
求a到b的最大公约数
那么只有1和本身这两种情况..
#include<stdio.h>
#include<string.h>
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
string s1,s2;
cin>>s1>>s2;
if(s1==s2)
{
cout<<s1<<endl;
}
else
{
puts("");
}
return ;
}
Codeforces Round #347 (Div. 2) A的更多相关文章
- Codeforces Round #347 (Div. 2) C. International Olympiad 找规律
题目链接: http://codeforces.com/contest/664/problem/C 题解: 这题最关键的规律在于一位的有1989-1998(9-8),两位的有1999-2098(99- ...
- Codeforces Round #347 (Div. 2) B. Rebus
题目链接: http://codeforces.com/contest/664/problem/B 题意: 给你一个等式,把等式左边的问号用1到n(n为等式右边的数)的数填好,使得等式成立 题解: 贪 ...
- Codeforces Round #347 (Div.2)_B. Rebus
题目链接:http://codeforces.com/contest/664/problem/B B. Rebus time limit per test 1 second memory limit ...
- Codeforces Round #347 (Div.2)_A. Complicated GCD
题目链接:http://codeforces.com/contest/664/problem/A A. Complicated GCD time limit per test 1 second mem ...
- Codeforces Round #347 (Div. 2) (练习)
A: 题意:找到[a, b]的最大公约数: 思路:相同时为本身,不同时为1. 套路:碰到水题别想太多: 猜想:两个相邻数,必有一奇一偶,如果偶数有因子3或者其他,奇数可不可能有相同的呢? 枚举一些数后 ...
- Codeforces Round #347 (Div. 2)
unrating的一场CF A - Complicated GCD #include <bits/stdc++.h> const int N = 1e5 + 5; char a[105], ...
- codeforces Round #347 (Div. 2) C - International Olympiad
思路:从后往前一位一位的模拟,每次判断一下当前枚举的数是否之间枚举过了.或者当前枚举数过小,小于1989. #include<cstdio> #include<cstring> ...
- Codeforces Round #366 (Div. 2) ABC
Codeforces Round #366 (Div. 2) A I hate that I love that I hate it水题 #I hate that I love that I hate ...
- Codeforces Round #354 (Div. 2) ABCD
Codeforces Round #354 (Div. 2) Problems # Name A Nicholas and Permutation standard input/out ...
随机推荐
- appium如何连接模拟器代码实例
from appium import webdriver def connect(self): self.desired_caps = {} self.desired_caps['platformNa ...
- python爬虫(7)--Beautiful Soup的用法
1.Beautiful Soup简介 简单来说,Beautiful Soup是python的一个库,最主要的功能是从网页抓取数据. Beautiful Soup提供一些简单的.python式的函数用来 ...
- 认识RESTFul
背景1. 概念提出者:Fielding2. 全写:Representational State Transfer,(资源的)表现层状态转化?3. http://www.ruanyifeng.com/b ...
- 使用线程池优化Echo模型
在上一篇文章中 http://www.cnblogs.com/gosaint/p/8492356.html 我阐述了使用线程为每一个客户端创建一个工作线程来负责任务的执行.但是会存在如 ...
- jquery datatable 多行(单行)选择(select),行获取/行删除
jquery datatable 多行(单行)选择(select),行获取/行删除 代码展示 // 示例数据源 var dataSet = [ ['Tasman','Internet Explorer ...
- Java界面设计
---------------siwuxie095 Java SE(Java Standard Edition) 即 Java 标准版, 一般也 ...
- Ros疑问汇总
一.机器人描述文件三个: 机器人主体body文件: gazebo属性文件: 主文件 smartcar.urdf: 二.启动文件smartcar_display.rviz.launch:启动节点和模拟器 ...
- linux 监控内存介绍
一:系统监控:1.对cpu的监测:查看进程占用内存情况 top pid user PRI NI size RSS share stat 进程号 进程所属用户 优先级 优先级 进程所占空间 使用物理内存 ...
- rvm 安装后的补充工作:source $HOME/.profile
rvm安装后会在 $HOME/.bash_profile 文件追加一行代码: [[ -s "$HOME/.rvm/scripts/rvm" ]] && source ...
- R: 判别分析
判别与聚类的比较: 聚类分析和判别分析有相似的作用,都是起到分类的作用. 判别分析是已知分类然后总结出判别规则,是一种有指导的学习: 聚类分析则是有了一批样本,不知道它们的分类,甚至连分成几类也不知道 ...