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的概 ...
随机推荐
- 远程读取URL 建议用curl代替file_get_contents
初学php的朋友们,很容易翻一个错误,在写采集程序或者调用api接口总会有线考虑到使用file_get_contents函数来或许内容,程序的访问量不大倒是没什么影响,但是访问量提升了那非常的悲剧了, ...
- Yii框架中的CURD操作
<?php $Admin = new Admin(); //查找多条记录,返回二维数组 $Admin->findAll(); $Admin->findAll("id = 2 ...
- java学习之IO字符流
package com.io; import java.io.*; /** * 文件字符流的读取 * @author ganhang * */ public class FileReaderDemo ...
- 虚拟rethat联网问题
近日在vmware虚拟了一台rethat的linux,但是使用桥连也上不了网! 宿主机是win7,由于在公司,是采用固定ip上网的,通过上网查资料,终于可以连接网络了: 步骤如下: 第一:修改vi / ...
- Get与POST的理解
针对GET& POST的掌握可以说是迷迷糊糊的,今天特意拿出来好好整理一下,便于掌握理解. 在服务器端都有一个用来标识资源位置的符号,被称为统一资源标识(URL). URI有两种形式.分别为U ...
- Codeforces 479D - Long Jumps
479D - Long Jumps, 480B - Long Jumps It , or . If we can already measure both x and y, output . Then ...
- line
小君童靴说头儿给了他一个project,实现给出屏幕上任意两个点,求出这两个点之间直线上的所有的点.觉得这个很好玩,就自己也写了一点code /* date : 2014/10/21 version ...
- Java, C#, Swift语法对比速查表
原文:Java, C#, Swift语法对比速查表 Java 8 C# 6 Swift 变量 类型 变量名; 类型 变量名; var 变量名 : 类型; 变量(类型推断) N/A var 变量名= ...
- Linux远程桌面工具 -- NoMachine
玩Linux系统,会经常用到远程桌面软件. 我一直用的2个是Xmanager 和 VNC. 今天看到一个新软件: NoMachine. NoMachine NX 是一个快速的终端服务器和虚拟桌面软件, ...
- C# ignoring letter case for if statement(Stackoverflow)
Question: I have this if statement: if (input == 'day') Console.Write({0}, dayData); When the user t ...