当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

2383:Circle Drawing

题目描述
Graphics libraries usually implement drawing of graphics primitives, like lines, polygons and circles. Your task is to write a program that draws circles.

Graphic canvas is represented as an array of Xsize by Ysize pixels. Each pixel have a color ranged from 0 to 9. Initially all pixels have color 0. Pixels are thought of as small sqares with the side of length 1. A circle with center (xc, yc) and radius R is a set of pixels (x, y) satisfying the inequality (x − xc)2 + (y − yc)2 ≤ R2

To draw a circle, your program should set the color of all pixels in a set defined above to the color of the circle. After drawing N given circles, the program should output the color of all pixels of the canvas.

输入解释
Input contains numbers Xsize Ysize N followed by N sets of numbers xi yi Ri ci, describing the coordinates of center, radius and color of i-th circle.
1 <= Xsize, Ysize <= 1000, 1 <= N <= 10000, 0 <= xi < Xsize, 0 <= yi < Ysize, 1 <= Ri <= 212, 0 <= ci <= 9.
输出解释
Output should contain Ysize lines of Xsize characters each, where i-th character of j-th line is a digit corresponding to color of the pixel (i, j).
输入样例
5 5 1
2 2 1 3
输出样例
00000
00300
03330
00300
00000
提示
This problem has huge input and output data,use scanf() and printf() instead of cin and cout to read data to avoid time limit exceed.

该题目是Virtual Judge题目,来自 北京大学POJ

源链接: POJ-2383

最后修改于 2020-10-29T06:31:08+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
3000 65536