URAL 1139 City Blocks(数论)
Input
Output
from fractions import gcd
n, m = map(int, raw_input().split(' '))
print n + m - gcd(n - 1, m - 1) - 2
URAL 1139 City Blocks(数论)的更多相关文章
- URAL 1133 Fibonacci Sequence(数论)
题目链接 题意 :给你第 i 项的值fi,第 j 项的值是 fj 让你求第n项的值,这个数列满足斐波那契的性质,每一项的值是前两项的值得和. 思路 :知道了第 i 项第j项,而且还知道了每个数的范围, ...
- Ural 2003: Simple Magic(数论&思维)
Do you think that magic is simple? That some hand-waving and muttering incomprehensible blubber is e ...
- HDU 2722 Here We Go(relians) Again (spfa)
Here We Go(relians) Again Time Limit : 2000/1000ms (Java/Other) Memory Limit : 32768/32768K (Java/ ...
- Here We Go(relians) Again
Here We Go(relians) Again Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/O ...
- (28)A practical way to help the homeless find work and safety
https://www.ted.com/talks/richard_j_berry_a_practical_way_to_help_the_homeless_find_work_and_safety/ ...
- codeforces 14A - Letter & codeforces 859B - Lazy Security Guard - [周赛水题]
就像title说的,是昨天(2017/9/17)周赛的两道水题…… 题目链接:http://codeforces.com/problemset/problem/14/A time limit per ...
- HDU 2722 Here We Go(relians) Again (最短路)
题目链接 Problem Description The Gorelians are a warlike race that travel the universe conquering new wo ...
- hdu 2722 Here We Go(relians) Again (最短路径)
Here We Go(relians) Again Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Jav ...
- 【CF MEMSQL 3.0 B. Lazy Security Guard】
time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standa ...
随机推荐
- OpenSSL-for-IOS
http://download.csdn.net/download/kokjuis/9723109
- php--在apache上配制rewrite重写
配置步骤: 第一步:找到apache的配置文件httpd.conf(文件在conf目录下) 第二步:你首先必须得让服务器支持mod_rewrite,如果你使用的是虚拟主机,请事先询问你的主机提供商. ...
- HTML5新标签和属性
1.<time>标签(支持IE9以上和其他浏览器) 今年是<time datetime="2015-12-12">2015年</time> &l ...
- Majority Element || leetcode
编程之美上一样的题目.寻找发帖水王. 利用分治的思想. int majorityElement(int* nums, int numsSize) { int candidate; int nTimes ...
- Educational Codeforces Round 16---部分题解
710A. King Moves 给你图中一点求出它周围有几个可达的点: 除边界之外都是8个,边界处理一下即可: #include<iostream> #include<cstdio ...
- win7系统中ftp服务器搭建方法(多图)
一.创建FTP站点 1.打开:控制面板---系统和安全---管理工具---Internet 信息服务 2. 建站:右键点击网站---添加FTP站点 3. 输入FTP 站点名称---选择你的 FTP 目 ...
- iOS苹果开发者客服电话地址
苹果开发者客服电话地址:https://developer.apple.com/contact/phone.php 中国大陆地区客服电话:4006 701 855 中国香港地区客服电话:(852) 2 ...
- 微信JS SDK Demo
微信JS-SDK 分享到朋友圈 分享给朋友 分享到QQ 拍照或从手机相册中选图 识别音频并返回识别结果 使用微信内置地图查看位置原文:http://www.cnblogs.com/txw1958/p/ ...
- Access 2003版数据库在Win7 64位系统下的不适应
使用ODBC连接不适应 使用microsoft.jet.4.0链接会出现“未在本地计算机上注册microsoft.jet.4.0” 应使用 Provider=Microsoft.ACE.OLEDB.1 ...
- cocos2dx 3.x(多个按钮button执行同一事件的区分)
// // ATTGamePoker.hpp // MalaGame // // Created by work on 2016/10/18. // // #ifndef ATTGamePoker_h ...