cf 1A Theatre Square
在刷完十多道CF A,B题水题后 ,便迫不及待的开始写下我的第一篇博客,以此来纪念我ACM的开始 。
纯小白,代码有很多不足之处,希望大家指教。也希望我的解题报告可以对大家有那么一点点的帮助。
1,CodeForces 1A
Theatre Square 点击此处打开链接
题意:有一块n*m的面积需要你用a*a的砖将之铺满 砖可以重叠,求最少的砖的数量
思路:将n和m分开来看待即可,将面积问题装换为线问题。分别求出用长为a的线
铺满长为n,m的线所需的数量即可
#include <iostream>
#include<cstdio>
using namespace std;int main()
{long long n,m,a;long long ans=1;scanf("%lld%lld%lld",&n,&m,&a);if(n%a==0)ans*=n/a;elseans*=n/a+1;if(m%a==0)ans*=m/a;elseans*=m/a+1;printf("%lld\n",ans);return 0;
}
cf 1A Theatre Square相关推荐
- 1A. Theatre Square
1A. Theatre Square 题目 翻译 题目 输入 输出 分析 代码 题目 翻译 题目 首都柏林的剧院广场是一个n×m 的矩形.在城市周年纪念之际,决定用方形的花岗岩石板铺砌广场,每个石板大 ...
- CodeForces 1A Theatre Square(水题)
A. Theatre Square time limit per test 1 second memory limit per test 256 megabytes input standard in ...
- CF Theatre Square
Theatre Square time limit per test 2 seconds memory limit per test 64 megabytes input standard input ...
- 【CodeForces - 1A】Theatre Square(水题,几何)(CODEFORCES,梦的开始)
题干: Theatre Square in the capital city of Berland has a rectangular shape with the size n × m meters ...
- CodeForces刷题:Theatre Square、Watermelon、Chat Server‘s Outgoing Traffic、Triangle、Die Roll
记录Codeforces刷题QAQ 一.Theatre Square 题面翻译 用 $ a \times a$ 的石板覆盖 $n \times m $ 的长方形广场,允许石板覆盖的区域超出广场,不允许 ...
- Theatre Square
time limit per test 1 second memory limit per test 256 megabytes input standard input output standar ...
- CodeForces-1A Theatre Square【水题】
A. Theatre Square time limit per test 1 second memory limit per test 256 megabytes input standard in ...
- E - Theatre Square
E - Theatre Square 一个城市的广场面积有 N×M平方米,过段时间,恰逢这个城市的庆典活动,主办方决定在广场上铺设一种新的地砖,这种地砖每块都是a×a平方米的. 那么问题来了,最少需要 ...
- New Theatre Square
https://codeforces.com/problemset/problem/1359/B 思路:可以用bfs搜索每一个连通块,得到每一个连通块的 . 的数量,然后我们再判断是贴一块划算还是贴两 ...
最新文章
- 记录一次MySQL两千万数据的大表优化解决过程,提供三种解决方案
- FLANN特征匹配(Python)
- 看看人家 SpringBoot + vue后台管理系统,多么优雅...
- 数据结构与算法(C++)-- 算法分析
- python的文件式如何操作_Python文件操作
- VTK:图片之ImageRotate
- 【转载】ASP.NET应用程序与页面生命周期
- docker 使用中遇到的问题
- 实惨!连各大编程语言都摆起地摊了!
- Kubernetes-PersistentVolume(PV)介绍(八)
- ai端到端_如何使用行为树构建端到端的对话式AI系统
- 从数据仓库系统对比看Hive发展前景
- 查找树的指定层级_非递归层次遍历方法实现二叉树中指定节点的层次数查找
- java9的垃圾收集机制,JAVA学习笔记9——垃圾回收机制+构造方法+重载
- 10、【易混淆概念集】-第六章1 三点估算 类比估算和参数估算的区别 储备分析 历时估算 项目进度网络图
- linux怎么给用户777权限,linux下 chmod 777 中777这个数字是怎么出来的
- 麦克表单可以做二维码吗_令令开门二维码门禁设备、手机均断网,可以开门吗?...
- ​​​LabVIEW DLL传递一个二维数组报错
- Zotero | 文献关联
- Python 实现n*n螺旋矩阵