ural 1255. Graveyard of the Cosa Nostra
1255. Graveyard of the Cosa Nostra
Memory limit: 64 MB
Input
Output
Sample
| input | output | 
|---|---|
| 5 4 | 6 | 
Problem Source: Open collegiate programming contest for student teams, Ural State University, March 15, 2003
/**
Create By yzx - stupidboy
*/
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <deque>
#include <vector>
#include <queue>
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <ctime>
#include <iomanip>
using namespace std;
typedef long long LL;
typedef double DB;
#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 int Getint()
{
int Ret = ;
char Ch = ' ';
bool Flag = ;
while(!(Ch >= '' && Ch <= ''))
{
if(Ch == '-') Flag ^= ;
Ch = getchar();
}
while(Ch >= '' && Ch <= '')
{
Ret = Ret * + Ch - '';
Ch = getchar();
}
return Flag ? -Ret : Ret;
} int n, k; inline void Input()
{
cin >> n >> k;
} inline void Solve()
{
if(n < k) cout << << endl;
else cout << ((n / k) * n) + ((n % k) * (n / k)) + max( * (n % k) - k, ) << endl;
} int main()
{
freopen("a.in", "r", stdin);
Input();
Solve();
return ;
}
ural 1255. Graveyard of the Cosa Nostra的更多相关文章
- URAL —— 1255 & HDU 5100——Chessboard ——————【数学规律】
		用 k × 1 的矩形覆盖 n × n 的正方形棋盘 用 k × 1 的小矩形覆盖一个 n × n 的正方形棋盘,往往不能实现完全覆盖(比如,有时候 n × n 甚至根本就不是 k 的整倍数). 解题 ... 
- 100-days: thirteen
		Title: “The Godfather turns 50” <教父>50周年 turn 达到某个年龄 Mario Puzo's(马里奥·普佐) "The Godfather ... 
- leggere la nostra recensione del primo e del secondo
		La terra di mezzo in trail running sembra essere distorto leggermente massima di recente, e gli aggi ... 
- hdu 1255
		覆盖的面积 Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Sub ... 
- POJ3154 Graveyard
		Graveyard Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 1654 Accepted: 840 Specia ... 
- 后缀数组 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 ... 
- ural 2070. Interesting Numbers
		2070. Interesting Numbers Time limit: 2.0 secondMemory limit: 64 MB Nikolay and Asya investigate int ... 
随机推荐
- AFNetworking(AFN)总结
			AFNetworking(AFN) ----主要做下载上传之用 //他是干啥的?发送请求,主要做下载上传之用 (苹果自带有获取服务器数据的方法NSURLConnection send,AFNetwor ... 
- nyoj1007(euler 函数)
			euler(x)公式能计算小于等于x的并且和x互质的数的个数: 我们再看一下如何求小于等于n的和n互质的数的和, 我们用sum(n)表示: 若gcd(x, a)=1,则有gcd(x, x-a)=1: ... 
- sql server 常用脚本(日常查询所需)
			1:查看sql server代理中作业的运行状况的脚本 -- descr : a simple sql script to view sql server jobs run status -- las ... 
- C/C++学习笔记---高地址、低地址、大段字节序、小段字节序
			字节顺序是指占内存多于一个字节类型的数据在内存中的存放顺序,通常有小端.大端两种字节顺序. 小端字节序指低字节数据存放在内存低地址处,高字节数据存放在内存高地址处: 大端字节序是高字节数据存放在低地址 ... 
- C# 面试宝典
			1.简述 private. protected. public. internal 修饰符的访问权限. private 私有成员 只有类成员才能访问 protected 保护成员 只有该类及该类的 ... 
- Delphi按下F1不能出现帮助文档的解决方法
			不光是Delphi,Windows里面所有的之所以无法打开.hlp帮助文档的问题都可以使用以下的方法来解决 问题:情况是这样的,不是打不开hlp帮助文档,按F1出现的是Windows的帮助.而Delp ... 
- Ajax 的 GET 和 POST 模式
			Ajax 异步请求数据的方式有两种:GET 和 POST. 如果是 GET 模式,则直接将数据放置到异步请求的 URL 地址中,而 send() 方法不发送任何数据: var queryString ... 
- play-framework的安装与使用
			一.下载: 到http://www.playframework.com/download下载 解压好包,然后输入: activator ui 访问:http://127.0.0.1:8888/home 
- fis3-postpackager-loader插件说明
			fis3-postpackager-loader 静态资源前端加载器,用来分析页面中使用的和依赖的资源(js或css), 并将这些资源做一定的优化后插入页面中.如把零散的文件合并. 注意 此插件做前端 ... 
- css 全局 兼容性问题
			css 笔记 第一种:常用的全局CSS属性设置 //参考大型网站,如凤凰网 (1)清除所有的标记的内外边距 body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,p ... 
