10098_CircleDrawing

2022-5-16 18:16| 发布者: Hocassian| 查看: 74| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-3-89504539370500-Problem List-采集的数据-后羿采集器.html

Pro.ID

10098

Title

Circle Drawing

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=10098

AC

1

Submit

8

Ratio

12.50%

时间&空间限制

  • Time Limit: 1000/500 MS (Java/Others)     Memory Limit: 32768/32768 K (Java/Others)
  • 描述

    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)2R2

    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 ≤ 200,   0 ≤ ci ≤ 9.

    输出

    Description

    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)2R2

    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

    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 ≤ 200,   0 ≤ ci ≤ 9.

    Output

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

    Sample Input

    Sample #1
    5 5 1
    2 2 1 3

    Sample #2
    4 3 2
    2 2 2 5
    0 1 1 9

    Sample Output

    Sample #1
    00000
    00300
    03330
    00300
    00000

    Sample #2
    9050
    9955
    9555

    Source

    样例输入

    Sample #1
    5 5 1
    2 2 1 3

    Sample #2
    4 3 2
    2 2 2 5
    0 1 1 9

    样例输出

    Sample #1
    00000
    00300
    03330
    00300
    00000

    Sample #2
    9050
    9955
    9555

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部