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 ...
随机推荐
- DOM对象与JQUERY对象的相互转化
普通处理,通过标准JavaScript处理: 1 var p = document.getElementById('imooc') 2 p.innerHTML = '您好!学习jQuery才是最佳的途 ...
- grep如何忽略.svn目录,以及如何忽略多个目录
grep如何忽略.svn目录,以及如何忽略多个目录 这是我在网上看到的文章,不过里面还有问题,我的不支持,需要更换架包 grep -r 'function_name' * (*表示当前目录下所有文件, ...
- 趣味C++
用三段 140 字符以内的代码生成一张 1024×1024 的图片 Kyle McCormick 在 StackExchange 上发起了一个叫做TweetableMathematical A ...
- SQL小纸条--一些方便平时参考的SQL语句--随用随查
SQL 语句 语句 语法 AND / OR SELECT column_name(s)FROM table_nameWHERE conditionAND|OR condition ALTER TABL ...
- [LeetCode] Letter Combinations of a Phone Number
Given a digit string, return all possible letter combinations that the number could represent. A map ...
- GMap.Net开发之在地图上添加多边形
上一篇介绍了在GMap上添加自定义标签(GMapMarker),这篇介绍在GMap上添加多边形(GMapPolyogn),并且介绍如何在地图上画任意的多边形. 如果已经知道了多边形的各个点的位置,就可 ...
- VS2010 打开 VS2012 的项目
用 VS2010 打开 VS2012 项目,只需两步. 1. 修改解决方案文件(*.sln) 使用记事本打开 *.sln 文件,将里面的 Microsoft Visual Studio Solutio ...
- ASP.NET MVC 4 WebAPI Simple Sample
// Controllers.cs namespace Microshaoft.WebApi.Controllers { using Microshaoft.WebApi.Models; using ...
- 学习iOS的网站
ios开发者 http://www.codeios.com/ cocoachina http://www.cocoachina.com code4app http://code4app.com ...
- 背景虚化 Google Camera App Nokia Refocus HTC One M8 的 Duo景深相机
背景虚化是单反中一种比较常见的拍照形式,参看 http://www.techbang.com/posts/%2017842 https://refocus.nokia.com/