ural 1157. Young Tiler
1157. Young Tiler
Memory limit: 64 MB
Input
Output
Sample
| input | output |
|---|---|
2 3 1 |
16 |
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <deque>
#include <vector>
#include <queue>
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <ctime>
using namespace std;
typedef long long LL;
typedef double DB;
#define For(i, s, t) for(int i = (s); i <= (t); i++)
#define Ford(i, s, t) for(int i = (s); i >= (t); i--)
#define Rep(i, t) for(int i = (0); i < (t); i++)
#define Repn(i, t) for(int i = ((t)-1); i >= (0); i--)
#define rep(i, x, t) for(int i = (x); i < (t); i++)
#define MIT (2147483647)
#define INF (1000000001)
#define MLL (1000000000000000001LL)
#define sz(x) ((int) (x).size())
#define clr(x, y) memset(x, y, sizeof(x))
#define puf push_front
#define pub push_back
#define pof pop_front
#define pob pop_back
#define ft first
#define sd second
#define mk make_pair
inline void SetIO(string Name) {
string Input = Name+".in",
Output = Name+".out";
freopen(Input.c_str(), "r", stdin),
freopen(Output.c_str(), "w", stdout);
} inline int Getint() {
int Ret = ;
char Ch = ' ';
while(!(Ch >= '' && Ch <= '')) Ch = getchar();
while(Ch >= '' && Ch <= '') {
Ret = Ret*+Ch-'';
Ch = getchar();
}
return Ret;
} const int N = ;
int n, m, k;
int Dp[N];
bool Visit[N]; inline void Input() {
scanf("%d%d%d", &n, &m, &k);
} inline int Search(int x) {
if(Visit[x]) return Dp[x];
Visit[x] = ;
int t = sqrt(x)+1e-;
For(i, , t)
if(!(x%i)) Dp[x]++;
return Dp[x];
} inline void Solve() {
For(i, k+, )
if(Search(i) == m && Search(i-k) == n) {
printf("%d\n", i);
return;
}
puts("");
} int main() {
#ifndef ONLINE_JUDGE
SetIO("H");
#endif
Input();
Solve();
return ;
}
ural 1157. Young Tiler的更多相关文章
- ural 2064. Caterpillars
2064. Caterpillars Time limit: 3.0 secondMemory limit: 64 MB Young gardener didn’t visit his garden ...
- URAL 1208 Legendary Teams Contest(DFS)
Legendary Teams Contest Time limit: 1.0 secondMemory limit: 64 MB Nothing makes as old as years. A l ...
- URAL 1873. GOV Chronicles
唔 神题一道 大家感受一下 1873. GOV Chronicles Time limit: 0.5 secondMemory limit: 64 MB A chilly autumn night. ...
- Ural State University Internal Contest October'2000 Junior Session
POJ 上的一套水题,哈哈~~~,最后一题很恶心,不想写了~~~ Rope Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 7 ...
- Lesson 17 Always young
Text My aunt Jennifer is an actress. She must be at least thirty-five years old. In spit of this, sh ...
- 斯考特·杨(Scott Young)快速学习方法
上午在网上看到了斯考特·杨(Scott Young)的快速学习方法,感觉很受鼓舞. 现在已经读研究生了,可是发现自己自从上大学以来到现在,发现自己的学习方法有很大的问题. 我是个特别喜欢读书的人,在大 ...
- 后缀数组 POJ 3974 Palindrome && URAL 1297 Palindrome
题目链接 题意:求给定的字符串的最长回文子串 分析:做法是构造一个新的字符串是原字符串+反转后的原字符串(这样方便求两边回文的后缀的最长前缀),即newS = S + '$' + revS,枚举回文串 ...
- ural 2071. Juice Cocktails
2071. Juice Cocktails Time limit: 1.0 secondMemory limit: 64 MB Once n Denchiks come to the bar and ...
- ural 2073. Log Files
2073. Log Files Time limit: 1.0 secondMemory limit: 64 MB Nikolay has decided to become the best pro ...
随机推荐
- 白手起家搭建django app
$django-admin.py startproject web2 $cd web2/ $python manage.py startapp blog $vim web2/settings.py 注 ...
- 删除右键ATI CATALYST(R) Control Center的方法
http://share.weiyun.com/c47530d3e44ea15b606d4ba6f1b00a28
- HTML5 自制本地网页视频播放器
HTML5初试:本地视频用网页打开啦半个广告都可以没有,看来暴风什么的快要淘汰了. 视频格式还是有要求的,看来要备一个转码器. 格式 IE Firefox Opera Chrome Safari Og ...
- Python Django 的 django templatedoesnotexist
django 1.8版本的解决方案 在 setting.py 这个文件里 TEMPLATES = [ ...... #原来的 #'DIRS': [ ], // 这个 列表里添加 template路 ...
- Linux shell判断文件和文件夹是否存在
shell判断文件,目录是否存在或者具有权限 #!/bin/sh myPath="/var/log/httpd/" myFile="/var /log/httpd/acc ...
- 简单制作 OS X Yosemite 10.10 正式版U盘USB启动安装盘方法教程
转自: http://www.iplaysoft.com/osx-yosemite-usb-install-drive.html http://jingyan.baidu.com/article/02 ...
- 在SharePoint 2010 母版页里添加自定义用户控件
在SharePoint 2010 母版页里添加自定义用户控件(译) 使用自定义用户控件的好处: 1.容易部署:2.易于控制显示或隐藏. (在使用的过程中)可能要面对的问题是:如何在用户控件里使用Sha ...
- css 之盒子模型
display: none inline block float :none right left clear left right both 清除浮动 是清楚它之前的左 ...
- Java for LeetCode 030 Substring with Concatenation of All Words【HARD】
You are given a string, s, and a list of words, words, that are all of the same length. Find all sta ...
- codeforces B. Xenia and Ringroad 解题报告
题目链接:http://codeforces.com/problemset/problem/339/B 题目理解不难,这句是解题的关键 In order to complete the i-th ta ...