题目在此

找出中有多少个太阳以及每个太阳的散发线段。

算法

原图:

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

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

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

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

可能参数没调好,WA了一次。

代码

codeforces 316F3 Suns and Rays的更多相关文章

  1. 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 ...

  2. Codeforces Round #425 (Div. 2)C

    题目连接:http://codeforces.com/contest/832/problem/C C. Strange Radiation time limit per test 3 seconds ...

  3. 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 ...

  4. Codeforces Round #425 (Div. 2) C - Strange Radiation

    地址:http://codeforces.com/contest/832/problem/C 题目: C. Strange Radiation time limit per test 3 second ...

  5. python爬虫学习(5) —— 扒一下codeforces题面

    上一次我们拿学校的URP做了个小小的demo.... 其实我们还可以把每个学生的证件照爬下来做成一个证件照校花校草评比 另外也可以写一个物理实验自动选课... 但是出于多种原因,,还是绕开这些敏感话题 ...

  6. 【Codeforces 738D】Sea Battle(贪心)

    http://codeforces.com/contest/738/problem/D Galya is playing one-dimensional Sea Battle on a 1 × n g ...

  7. 【Codeforces 738C】Road to Cinema

    http://codeforces.com/contest/738/problem/C Vasya is currently at a car rental service, and he wants ...

  8. 【Codeforces 738A】Interview with Oleg

    http://codeforces.com/contest/738/problem/A Polycarp has interviewed Oleg and has written the interv ...

  9. CodeForces - 662A Gambling Nim

    http://codeforces.com/problemset/problem/662/A 题目大意: 给定n(n <= 500000)张卡片,每张卡片的两个面都写有数字,每个面都有0.5的概 ...

随机推荐

  1. Oracle查询数据中占用空间最大的表

    --第一步,查询istaudit数据库文件ID,文件路径 select file#,name from v$datafile where lower(name) like '%istaudit.dbf ...

  2. 关于Repeater中使用DorpWownList的问题

    关于Repeater中使用DorpWownList的问题 前台: <asp:Repeater ID="Repeater1" runat="server" ...

  3. Windows最常用的几个网络CMD命令总结

    Windows最常用的几个网络CMD命令总结 http://www.cnblogs.com/sbaicl/archive/2013/03/05/2944001.html 一.ping 主要是测试本机T ...

  4. 阿里云部署 Flask + WSGI + Nginx 详解

    抵不住朋友的诱惑,今天终于入手了一台阿里云服务器,是Ubuntu 1.4 32位版本,最初考虑是用来尝尝鲜只是买了个最低配的,价格算起来与在国外买个空间的价格相当吧(可能一年才贵100多),但用起来感 ...

  5. ios 面试题 经典(比较全) 根据重点总结

    史上最全的iOS面试题及答案 1.写一个NSString类的实现 + (id)initWithCString:(c*****t char *)nullTerminatedCString encodin ...

  6. GNU自动补全模块readline解析

    readline模块定义了一系列函数用来读写Python解释器中历史命令,并提供自动补全命令功能.这个模块可以通过relcompleter模块直接调用,模块中的设置会影响解释器中的交互提示,以及内置函 ...

  7. HTML5 总结-表单-表单元素

    HTML5 表单元素 HTML5 的新的表单元素: HTML5 拥有若干涉及表单的元素和属性. 本章介绍以下新的表单元素: datalist keygen output 浏览器支持 Input typ ...

  8. ThinkPHP第十一天(关联模型使用,独立分组配置,MySQL concat用法)

    1.关联模型的使用 定义方式:新建一个类文件UserRelationModel.class.php Class UserRelationModel extends RelationModel{ pro ...

  9. JS常用方法函数(1)

    1.字符串长度截取 function cutstr(str, len) { var temp, icount = 0, patrn = /[^\x00-\xff]/, strre = "&q ...

  10. qt实现-给SQLITE添加自定义函数

    需要使用sqlite里的password对某个字段进行加密,由于使用的sqlite是由QT封装好的QSqlDatabase,没有发现加载扩展函数的方法,所以自己实现了一个. 在网上也没找到相应的参考, ...