codeforces 316F3 Suns and Rays
题目在此
找出中有多少个太阳以及每个太阳的散发线段。
算法
原图:

将图“缩小”,如果一个白点的四周有黑点,那么把这个白点变成黑点:

将图“放大”,即上述“缩小”的逆操作:

然后把细线提取出来,染色一下就可以了:

如果不“放大”,提取出来的细线是这样的:

可能参数没调好,WA了一次。
代码
codeforces 316F3 Suns and Rays的更多相关文章
- Codeforces Round #328 (Div. 2) B. The Monster and the Squirrel 打表数学
B. The Monster and the Squirrel Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/c ...
- Codeforces Round #425 (Div. 2)C
题目连接:http://codeforces.com/contest/832/problem/C C. Strange Radiation time limit per test 3 seconds ...
- Codeforces Round #425 (Div. 2) Problem C Strange Radiation (Codeforces 832C) - 二分答案 - 数论
n people are standing on a coordinate axis in points with positive integer coordinates strictly less ...
- Codeforces Round #425 (Div. 2) C - Strange Radiation
地址:http://codeforces.com/contest/832/problem/C 题目: C. Strange Radiation time limit per test 3 second ...
- python爬虫学习(5) —— 扒一下codeforces题面
上一次我们拿学校的URP做了个小小的demo.... 其实我们还可以把每个学生的证件照爬下来做成一个证件照校花校草评比 另外也可以写一个物理实验自动选课... 但是出于多种原因,,还是绕开这些敏感话题 ...
- 【Codeforces 738D】Sea Battle(贪心)
http://codeforces.com/contest/738/problem/D Galya is playing one-dimensional Sea Battle on a 1 × n g ...
- 【Codeforces 738C】Road to Cinema
http://codeforces.com/contest/738/problem/C Vasya is currently at a car rental service, and he wants ...
- 【Codeforces 738A】Interview with Oleg
http://codeforces.com/contest/738/problem/A Polycarp has interviewed Oleg and has written the interv ...
- CodeForces - 662A Gambling Nim
http://codeforces.com/problemset/problem/662/A 题目大意: 给定n(n <= 500000)张卡片,每张卡片的两个面都写有数字,每个面都有0.5的概 ...
随机推荐
- What day is that day?(快速幂,打表找周期,或者求通项公式)
有些题怎么都解不出来,这时候可以打表,找规律,求通项公式等,这些方法让人拍手叫绝,真不错…… Description It's Saturday today, what day is it after ...
- ThinkPHP第七天(F函数使用,项目分组配置,项目分组模板文件放置规则配置)
1.F(文件名称,写入数据,写入地址),用于将数据写入至磁盘文件中,如F('Data',$arr,'./Data/'),作用是将$arr写入至网站根目录的Data文件夹中的Data.php中. 2.读 ...
- [LeetCode]题解(python):017-Letter Combinations of a Phone Number
题目来源: https://leetcode.com/problems/letter-combinations-of-a-phone-number/ 题意分析: 这道题是输入一段数字字符digits, ...
- vagrant 入门1
1. Vagrant功能: Vagrant usesOracle's VirtualBox to build configurable, lightweight, and portable ...
- 如何用java比较两个时间或日期的大小
有一个字符串的时间,比如"2012-12-31 16:18:36" 与另一个时间做比较,如果前者比后者早,则返回true,否则返回false. 为此,我设计了一个方法. impor ...
- Java 如何判断一个字符是否是数字或字母
在C++中, 可以用isdigit()判断一个字符是否是数字,可以用isalpha()判断一个字符是否是字母,还有很多,都在<cctype>头文件中 而类似的方法在JAVA中,则主要是Ch ...
- MacBook外接显示器设置方法(新手入门贴)
小屏幕的MacBook/MacBook Pro放在桌上长时间使用,眼睛比较累,而且,长时间低头看屏幕,易得颈椎病,绝对有损健康.配一台大屏幕的外置显示器不失为两全其美的好办法. 首先,得买一台中意的大 ...
- BZOJ 2016: [Usaco2010]Chocolate Eating( 二分答案 )
因为没注意到long long 就 TLE 了... 二分一下答案就Ok了.. ------------------------------------------------------------ ...
- POJ 3384 Feng Shui 凸包直径 + 半平面交
G++一直没有过了 换成 C++果断A掉了...It's time to bet RP. 题意:给一个多边形,然后放进去两个圆,让两个圆的覆盖面积尽量最大,输出两个圆心的坐标. 思路:将多边形的边向里 ...
- Python 第十一篇:开发堡垒机
一:SqlAlchemy ORM ORM:Object Relational Mapping 对象关系映射是一种程序技术,用于实现面向对象编程语言里不同类型系统的数据之间的转换 SQLAlchemy是 ...