Logo
(追記) (追記ここまで)

7850번 - Circle Drawing 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
3 초 128 MB174337.500%

문제

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

출력

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

제한

  • 1 ≤ Xsize, Ysize ≤ 1000,
  • 1 ≤ N ≤ 10000,
  • 0 ≤ xi < Xsize,
  • 0 ≤ yi < Ysize,
  • 1 ≤ Ri ≤ 200,
  • 0 ≤ ci ≤ 9.

예제 입력 1

5 5 1
2 2 1 3

예제 출력 1

00000
00300
03330
00300
00000

예제 입력 2

4 3 2
2 2 2 5
0 1 1 9

예제 출력 2

9050
9955
9555

힌트

출처

ICPC > Regionals > Northern Eurasia > Far Eastern Russia Regional Contest > NEERC Far-Eastern Subregional 2004 E번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /