s_id
stringlengths
10
10
p_id
stringlengths
6
6
u_id
stringlengths
10
10
date
stringlengths
10
10
language
stringclasses
1 value
original_language
stringclasses
11 values
filename_ext
stringclasses
1 value
status
stringclasses
1 value
cpu_time
int64
0
100
memory
stringlengths
4
6
code_size
int64
15
14.7k
code
stringlengths
15
14.7k
problem_id
stringlengths
6
6
problem_description
stringlengths
358
9.83k
input
stringlengths
2
4.87k
output
stringclasses
807 values
__index_level_0__
int64
1.1k
1.22M
s672221837
p00026
u506132575
1416138610
Python
Python
py
Accepted
20
4292
718
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys def printp(): for q in p: print q def if_in_paper(x,y): if 0 <= x and x < 10 and 0 <= y and y <10: return True else: return False def pro(x,y,lis): for e in lis: px,py = x+e[0], y+e[1] if if_in_paper(px,py): p[py][px] += 1 p...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,902
s924942480
p00026
u567380442
1423051216
Python
Python3
py
Accepted
30
6756
634
import sys f = sys.stdin def drop(paper, x, y): if 0 <= x < len(paper[0]) and 0 <= y < len(paper): paper[y][x] += 1 drop_range = {} drop_range[1] = ((0, 0), (0, -1), (1, 0), (0, 1), (-1, 0)) drop_range[2] = drop_range[1] + ((-1, -1), (1, -1), (1, 1), (-1, 1)) drop_range[3] = drop_range[2] + ((0, -2), (2, ...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,903
s297229653
p00026
u540744789
1426596824
Python
Python
py
Accepted
10
4336
1,034
p = [[0 for a in range(10)] for b in range(10)] def smallink(x,y): return [(x+i,y+j) for i in range(-1,2,1) for j in range(-1,2,1)\ if abs(i)+abs(j)<=1 and x+i>=0 and x+i<=9 and y+j>=0\ and y+j<=9] def ink(x,y): return [(x+i,y+j) for i in range(-1,2,1) for j in range(-1,2,1)\ ...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,904
s190761039
p00026
u540744789
1426596926
Python
Python
py
Accepted
10
4328
979
import sys p = [[0 for a in range(10)] for b in range(10)] def smallink(x,y): return [(x+i,y+j) for i in range(-1,2,1) for j in range(-1,2,1)\ if abs(i)+abs(j)<=1 and x+i>=0 and x+i<=9 and y+j>=0\ and y+j<=9] def ink(x,y): return [(x+i,y+j) for i in range(-1,2,1) for j in range(-1,2,1)\ ...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,905
s443256934
p00026
u408260374
1431430147
Python
Python3
py
Accepted
40
6772
752
board = [[0]*10 for _ in range(10)] while True: try: x, y, size = map(int, input().split(',')) except: break small = [(-1, 0), (0, -1), (0, 0), (0, 1), (1, 0)] med = [(-1, -1), (-1, 0), (-1, 1), (0, -1), (0, 0), (0, 1), (1, -1), (1, 0), (1, 1)] large = [(-2, 0),...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,906
s606079015
p00026
u873482706
1434550758
Python
Python
py
Accepted
20
4340
1,125
def main(): if size == 1: index_lis = [(0,0),(0,-1),(0,1),(-1,0),(1,0)] elif size == 2: index_lis = [(0,0),(0,-1),(0,1),(-1,-1),(-1,0),(-1,1),(1,-1),(1,0),(1,1)] elif size == 3: index_lis = [(0,0),(0,-1),(0,-2),(0,1),(0,2),(-1,-1),(-1,0),(-1,1), (1,-1),(1,0),(1,1...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,907
s279001464
p00026
u379956761
1435306092
Python
Python3
py
Accepted
30
6780
990
import sys def small(paper, x, y): paper[x][y] += 1 paper[x-1][y] += 1 paper[x][y-1] += 1 paper[x][y+1] += 1 paper[x+1][y] += 1 def medium(paper, x, y): small(paper, x, y) paper[x-1][y-1] += 1 paper[x-1][y+1] += 1 paper[x+1][y-1] += 1 paper[x+1][y+1] += 1 def large(paper, x, y...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,908
s672683221
p00026
u071010747
1445314614
Python
Python3
py
Accepted
20
7764
1,276
# -*- coding:utf-8 -*- def check(x,i,y,j): flagx=True if (x+i>=0 and x+i<=9) else False flagy=True if (y+j>=0 and y+j<=9) else False return (flagx and flagy) def main(): LIST=[] for i in range(10): LIST.append([0,0,0,0,0,0,0,0,0,0]) count=0 M=0 while True: try:...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,909
s561197308
p00026
u140201022
1447080610
Python
Python
py
Accepted
10
6432
754
#!/usr/bin/env python # -*- coding: UTF-8 -*- l=[[0]*10 for _ in range(10)] while 1: try: x,y,s=map(int,raw_input().split(',')) l[y][x]+=1 syo=[[0,1],[0,-1],[1,0],[-1,0]] chu=[[1,1],[-1,-1],[1,-1],[-1,1]] dai=[[0,2],[0,-2],[2,0],[-2,0]] for i in syo: if ...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,910
s474101655
p00026
u650459696
1458737211
Python
Python3
py
Accepted
20
7712
710
p = [[0 for i in range(14)] for j in range(14)] c, m = 0, 0 while True: try: x, y, size = map(int,input().split(',')) except: break x += 2 y += 2 p[x][y] += 1 p[x - 1][y] += 1 p[x + 1][y] += 1 p[x][y - 1] += 1 p[x][y + 1] += 1 if size > 1: p[x - 1][y - 1] ...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,911
s013995884
p00026
u148101999
1459472905
Python
Python
py
Accepted
20
6592
822
from __future__ import (absolute_import, division, print_function, unicode_literals) from sys import stdin from collections import Counter import sys NUM = [[0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0], [0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]] pa...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,912
s601722064
p00026
u130979865
1459957987
Python
Python
py
Accepted
10
6436
1,892
# -*- coding: utf-8 -*- import sys def small_inc(x, y, cells): cells[x][y] += 1 if y > 0: cells[x][y-1] += 1 if x > 0: cells[x-1][y] += 1 if x < MAPSIZE-1: cells[x+1][y] += 1 if y < MAPSIZE-1: cells[x][y+1] += 1 def medium_inc(x, y, cells): if y > 0: ce...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,913
s246112465
p00026
u572790226
1460626156
Python
Python3
py
Accepted
20
7896
1,824
class Paper: def __init__(self, x, y): self.A = [[0 for i in range(x)] for j in range(y)] self.size = (x, y) def drop(self, x, y, s): if s == 1: if y+1 <= self.size[1]-1: self.A[y+1][x] += 1 for i in range(max(0, x-1) , 1 + min...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,914
s148461864
p00026
u894114233
1463043270
Python
Python
py
Accepted
20
6340
860
paper=[[-float('inf')]*14]*2+[[-float('inf')]*2+[0]*10+[-float('inf')]*2 for _ in xrange(10)]+[[-float('inf')]*14]*2 while 1: try: x,y,size=map(int,raw_input().split(",")) x+=2 y+=2 paper[x][y]+=1 paper[x+1][y]+=1 paper[x-1][y]+=1 paper[x][y+1]+=1 pape...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,915
s594056350
p00026
u766477342
1468326063
Python
Python3
py
Accepted
30
7664
890
d = [[0] * 10 for i in range(10)] def b(x, y): for i in range(x - 2, x + 3): a = 3 - abs(x - i) for a in range(y - a + 1, y + a): if 0 <= i < 10 and 0 <= a < 10: d[a][i] += 1 def m(x, y): for i in range(x - 1, x + 2): for j in range(y - 1, y + 2): ...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,916
s007285829
p00026
u896025703
1469599066
Python
Python3
py
Accepted
20
7652
632
masu = [[0 for x in range(10)] for y in range(10)] syou = [[-1,0], [0,-1], [0,0], [0,1], [1,0]] tyuu = [[-1,-1], [-1,1], [1,-1], [1,1]] + syou dai = [[-2,0], [0,-2], [0,2], [2,0]] + tyuu def drop(x,y,s): if s == 1: l = syou elif s == 2: l = tyuu elif s == 3: l = dai for dx,dy in l: nx = x + dx ny = y + dy ...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,917
s115588064
p00026
u358919705
1471991749
Python
Python3
py
Accepted
40
7684
561
a = [[0] * 14 for _ in range(14)] while True: try: x, y, s = map(int, input().split(',')) except: break x += 2 y += 2 for d in [(0, 0), (0, -1), (0, 1), (-1, 0), (1, 0)]: a[x + d[0]][y + d[1]] += 1 if s >= 2: for d in [(1, 1), (1, -1), (-1, 1), (-1, -1)]: ...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,918
s466973868
p00026
u379499530
1473140075
Python
Python
py
Accepted
10
6280
591
p = [[0 for i in xrange(10)] for i in xrange(10)] def drop(x, y, s): r = [] d = [[x, y - 1], [x - 1, y], [x + 1, y], [x, y + 1], \ [x - 1, y + 1], [x + 1, y + 1], [x - 1, y - 1], [x + 1, y - 1], \ [x, y + 2], [x - 2, y], [x + 2, y], [x, y - 2]] for i in d[0:s*4]: if min(i) >= 0 an...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,919
s262538893
p00026
u379499530
1473140227
Python
Python
py
Accepted
10
6488
544
p = [[0 for i in xrange(10)] for i in xrange(10)] def drop(x, y, s): d = [[x, y - 1], [x - 1, y], [x + 1, y], [x, y + 1], \ [x - 1, y + 1], [x + 1, y + 1], [x - 1, y - 1], [x + 1, y - 1], \ [x, y + 2], [x - 2, y], [x + 2, y], [x, y - 2]] for i in d[0:s*4]: if min(i) >= 0 and max(i) < ...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,920
s844727555
p00026
u922871577
1479443482
Python
Python
py
Accepted
10
6384
644
import sys drops = [None, [(0,0),(-1,0),(1,0),(0,-1),(0,1)], [(0,0),(-1,0),(1,0),(0,-1),(0,1),(-1,1),(-1,-1),(1,-1),(1,1)], [(0,0),(-1,0),(1,0),(0,-1),(0,1),(-1,1),(-1,-1),(1,-1),(1,1),(-2,0),(2,0),(0,-2),(0,2)]] B = [[0 for j in xrange(10)] for i in xrange(10)] for line in sys.stdin: ...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,921
s746401303
p00026
u777299405
1479905202
Python
Python3
py
Accepted
30
7664
620
import sys field = [[0 for i in range(10)] for j in range(10)] def ink(x, y, s): for dx, dy in ((0, 0), (0, 1), (1, 0), (-1, 0), (0, -1)): plot(x + dx, y + dy) if s == 1: return for dx, dy in ((1, 1), (-1, -1), (-1, 1), (1, -1)): plot(x + dx, y + dy) if s == 2: return ...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,922
s459683545
p00026
u301729341
1481098812
Python
Python3
py
Accepted
30
7704
1,049
Masu = [] def access(x,y): if x < 0 or y < 0 or x > 9 or y > 9: return Masu[y][x] += 1 for i in range(10): Masu.append([0,0,0,0,0,0,0,0,0,0]) kosu = 0 komax = 0 while True: try: x,y,s = map(int,input().split(",")) if s == 1: for j in range(3): ...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,923
s011332230
p00026
u811733736
1481621330
Python
Python3
py
Accepted
20
7732
2,235
import sys class Paper(object): def __init__(self, x=None, y=None): if x == None: self.x = 10 else: self.x = x if y == None: self.y = 10 else: self.y = y t = [0] * self.x self.sheet = [t[:] for _ in range(self.y)] ...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,924
s634855216
p00026
u661290476
1482330999
Python
Python3
py
Accepted
20
7696
526
board=[[0]*10 for i in range(10)] ink=[[[0,0,0,0,0],[0,0,1,0,0],[0,1,1,1,0],[0,0,1,0,0],[0,0,0,0,0]], [[0,0,0,0,0],[0,1,1,1,0],[0,1,1,1,0],[0,1,1,1,0],[0,0,0,0,0]], [[0,0,1,0,0],[0,1,1,1,0],[1,1,1,1,1],[0,1,1,1,0],[0,0,1,0,0]]] while True: try: x,y,s=map(int,input().split(",")) except: break ...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,925
s470087391
p00026
u711765449
1484468174
Python
Python3
py
Accepted
30
7772
1,268
a = [[0 for i2 in range(10)] for i1 in range(10)] def small_ink(x,y): a[x][y] += 1 a[x-1][y] += 1 try: a[x+1][y] += 1 except: pass a[x][y-1] += 1 try: a[x][y+1] += 1 except: pass if x-1 < 0: a[x-1][y] -= 1 if y-1 < 0: a[x][y-1] -= 1 ...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,926
s426531926
p00026
u964040941
1485442676
Python
Python3
py
Accepted
30
7728
676
paper = [[0] * 10 for i in range(10)] while True: try: x,y,s = map(int,input().split(',')) except: break if s == 1: for i in range(10): for j in range(10): if abs(x - i) + abs(y - j) <= 1: paper [i] [j] += 1 elif s == 2: fo...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,927
s583795074
p00026
u032662562
1486715858
Python
Python3
py
Accepted
20
7624
1,283
pap = [[0 for x in range(10)] for y in range(10)] def brot(x,y,s): if s==1: for dx in range(-1,+1+1): for dy in range(-1,+1+1): px = x + dx py = y + dy if abs(dx)+abs(dy)<2 and px in range(0,10) and py in range(0,10): pap[p...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,928
s468067734
p00026
u032662562
1486774921
Python
Python3
py
Accepted
30
7764
835
pap = [[0 for x in range(10)] for y in range(10)] ink = [ [], [[-1,0],[0,-1],[0,0],[0,1],[1,0]], [[-1,-1],[-1,0],[-1,1],[0,-1],[0,0],[0,1],[1,-1],[1,0],[1,1]], [[-2,0],[-1,-1],[-1,0],[-1,1],[0,-2],[0,-1],[0,0],[0,1],[0,2],[1,-1],[1,0],[1,1],[2,0]] ] def brot(x,y,s): global pap for i in ...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,929
s623677683
p00026
u901080241
1488972338
Python
Python3
py
Accepted
30
7536
1,020
arr = [0]*100 while True: try: x,y,s = map(int, input().split(",")) if s==3: if x <= 7: arr[10*y+x+2] += 1 if x >= 2: arr[10*y+x-2] += 1 if y <= 7: arr[10*y+x+20] += 1 if y >= 2: arr[10*y+...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,930
s067750001
p00026
u462831976
1492729352
Python
Python3
py
Accepted
30
7840
854
# -*- coding: utf-8 -*- import sys import os import math P = [[0 for i in range(10)] for j in range(10)] def paint(x, y): if 0 <= x <= 9 and 0 <= y <= 9: P[x][y] += 1 for s in sys.stdin: x, y, s = map(int, s.split(',')) if s >= 1: paint(x, y) paint(x - 1, y) paint(x + 1,...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,931
s930056758
p00026
u905313459
1496471410
Python
Python3
py
Accepted
30
7648
585
import sys n1 = [[0, 1], [1, 0], [-1, 0], [0, -1]] n2 = n1 + [[a, b] for a in [-1, 1] for b in [-1, 1]] n3 = n2 + [[a*2, b*2] for a, b in n1] mas = [[0]*10 for i in range(10)] for i in sys.stdin: try: x, y, a = list(map(int, i.split(","))) mas[y][x] += 1 for k,l in eval("n"+str(a)): ...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,932
s152224981
p00026
u546285759
1497692084
Python
Python3
py
Accepted
20
7612
597
t = [[0 for i in range(10)] for j in range(10)] case1 = [(0, 0), (0, -1), (1, 0), (0, 1), (-1, 0)] case2 = [(1, -1), (1, 1), (-1, 1), (-1, -1)] case3 = [(0, -2), (2, 0), (0, 2), (-2, 0)] while True: try: x, y, s = map(int, input().split(',')) except: break for c in [case1, case2, case3][:s]:...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,933
s762407621
p00026
u354053070
1501991919
Python
Python3
py
Accepted
20
7620
707
paper = [[0 for _ in range(10)] for _ in range(10)] dx = [1, 0, -1, 0] dy = [0, 1, 0, -1] def paint(x, y): if 0 <= x <= 9 and 0 <= y <= 9: paper[x][y] += 1 while True: try: x, y, s = map(int, input().split(",")) except EOFError: break if x == y == s == -1: break pai...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,934
s529028638
p00026
u584777171
1503498724
Python
Python3
py
Accepted
20
7868
1,392
import sys table = [[0 for j in range(10)] for i in range(10)] def flag(x, y): if x > 9 or y > 9 or x < 0 or y < 0: return False else: return True def small(x, y): table[x][y] += 1 if flag(x+1, y): table[x+1][y] += 1 if flag(x-1, y): table[x-1][y] += 1 if flag...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,935
s663494400
p00026
u957021183
1504848855
Python
Python3
py
Accepted
20
7900
992
# Aizu Problem 0026: Dropping Ink # import sys, math, os # read input: PYDEV = os.environ.get('PYDEV') if PYDEV=="True": sys.stdin = open("sample-input.txt", "rt") paper = [[0 for col in range(10)] for row in range(10)] # ink forms: 1=small, 2=medium, 3=large ink_forms = {1: [[0, 0], [-1, 0], [1, 0], [0, -1], [...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,936
s631478181
p00026
u133119785
1509260019
Python
Python3
py
Accepted
30
7824
1,105
import sys b = [ list(0 for i in range(14)) for j in range(14)] def s(b,x,y): b[x][y] += 1 b[x+1][y] += 1 b[x-1][y] += 1 b[x][y+1] += 1 b[x][y-1] += 1 def m(b,x,y): b[x-1][y-1] += 1 b[x ][y-1] += 1 b[x+1][y-1] += 1 b[x-1][y ] += 1 b[x ][y ] += 1 b[x+1][y ] += 1 ...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,937
s981917439
p00026
u236679854
1512518093
Python
Python3
py
Accepted
20
5608
870
paper = [[0 for i in range(10)] for j in range(10)] def drop_ink(x, y, s): for i in range(-1, 2): for j in range(-1, 2): if s == 1 and i * j != 0: continue if 0 <= x + i < 10 and 0 <= y + j < 10: paper[x+i][y+j] += 1 if s == 3: if x - 2 >=...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,938
s138880683
p00026
u299798926
1513299100
Python
Python3
py
Accepted
20
5624
1,435
A=[[int(0) for i in range(10)]for j in range(10)] count=0 while 1: try: x,y,s = map(int, input().split(',')) if s==1: for i in range(x-1,x+2): if i>=0 and i<=9: A[i][y]=A[i][y]+1 for i in range(y-1,y+2): if i>=0 and i<=9: ...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,939
s847098597
p00026
u203261375
1513498589
Python
Python3
py
Accepted
20
5620
1,334
def check(x, y): return 0 <= x <= 9 and 0 <= y <= 9 def small(x, y, area): if check(x+1, y): area[x+1][y] += 1 if check(x, y+1): area[x][y+1] += 1 if check(x-1, y): area[x-1][y] += 1 if check(x, y-1): area[x][y-1] += 1 area[x][y] += 1 return area def media...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,940
s315495998
p00026
u024715419
1515999891
Python
Python3
py
Accepted
20
5640
1,461
p = [[0 for i in range(14)] for j in range(14)] while True: try: x_inp, y_inp, s = map(int, input().split(",")) x = x_inp + 2 y = y_inp + 2 if s == 1: p[y-1][x] = p[y-1][x] + 1 p[y][x-1] = p[y][x-1] + 1 p[y][x] = p[y][x] + 1 p[y][x+...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,941
s566744016
p00026
u957840591
1516436601
Python
Python3
py
Accepted
20
5620
1,341
import sys def small(grid, x, y): grid[x][y] += 1 grid[x + 1][y] += 1 grid[x][y + 1] += 1 grid[x][y - 1] += 1 grid[x - 1][y] += 1 return grid def middle(grid, x, y): grid[x][y] += 1 grid[x + 1][y] += 1 grid[x][y + 1] += 1 grid[x][y - 1] += 1 grid[x - 1][y] += 1 grid[x...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,942
s310304107
p00026
u764789069
1516803143
Python
Python
py
Accepted
10
4692
612
paper=[[0 for i in range(10)] for j in range(10)] #print paper def drop(x,y): global paper if 0<=x<10 and 0<=y<10: paper[y][x] += 1 return def ink(x,y,s): drop(x,y) drop(x-1,y); drop(x+1,y) drop(x,y-1); drop(x,y+1) if s==1: return drop(x-1,y-1); drop(x-1,y+1) drop(x+1,y-1);...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,943
s495115400
p00026
u150984829
1516993623
Python
Python3
py
Accepted
20
5604
332
import sys a=[[0]*10for _ in[0]*10] p=[[(-1,0),(0,-1),(0,0),(0,1),(1,0)],[(-1,-1),(-1,1),(1,-1),(1,1)],[(-2,0),(0,-2),(0,2),(2,0)]] for e in sys.stdin: x,y,s=map(int,e.split(',')) for f in p[:s]: for s,t in f: if 0<=y+s<10 and 0<=x+t<10:a[y+s][x+t]+=1 print(sum(1 for r in a for c in r if c==0)) print(max(max(r)f...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,944
s070528235
p00026
u043254318
1517067580
Python
Python3
py
Accepted
20
5608
885
def get_input(): while True: try: yield ''.join(input()) except EOFError: break N = list(get_input()) board = [[0 for i in range(14)] for j in range(14)] for l in range(0,len(N)): x,y,s = [int(i) for i in N[l].split(",")] x = x + 2 y = y + 2 if s >= 1: ...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,945
s968296825
p00026
u744114948
1521095844
Python
Python3
py
Accepted
30
5608
873
p = [[0] * 10 for _ in range(10)] x, y, s = 0, 0, 0 while True: try: x, y, s = map(int, input().split(",")) except: break if s >= 1: p[x][y] += 1 for i in range(x-1, x+2, 2): if -1 < i < 10: p[i][y] += 1 for i in range(y-1, y+2, 2): ...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,946
s675538869
p00026
u898097781
1525328565
Python
Python3
py
Accepted
20
5608
886
import sys lines = [] for line in sys.stdin: lines.append(line.strip().split(',')) field = [[0 for i in range(10)] for j in range(10)] def drop(x, y, z): if z==1: for i in range(-1,2): for j in range(-1,2): if abs(i)+abs(j)<2 and 0<=y+j<=9 and 0<=x+i<=9: ...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,947
s200978807
p00026
u724548524
1525853574
Python
Python3
py
Accepted
20
5608
634
def dot(h, w): global area if 0 <= h and h < 10 and 0 <= w and w < 10: area[h][w] += 1 def sdot(h,w): [dot(h + i, w + j) for j in range(-1, 2) for i in range(-1 + abs(j), 2 - abs(j))] def mdot(h,w): [dot(h + i, w + j) for j in range(-1, 2) for i in range(-1, 2)] def ldot(h, w): [dot(h + i, w...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,948
s076453644
p00026
u136916346
1527395721
Python
Python3
py
Accepted
30
6008
661
import sys,collections c=[tuple([i,j]) for i in range(10) for j in range(10)] d=[list(map(int,text.split(","))) for text in sys.stdin] o=[] for b in d: if b[2]==1: t=[tuple([b[0]+i,b[1]+j]) for i in range(-1,2) for j in range(-1,2) if (i==0 or j==0) and 0<=b[0]+i<=9 and 0<=b[1]+j<=9] elif b[2]==2: ...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,949
s018207017
p00026
u352394527
1527449552
Python
Python3
py
Accepted
20
5608
1,103
#sheet...紙全体、sheet[x][y]は(x, y)のインクの濃さ sheet = [[0 for _ in range(10)] for _ in range(10)] #小、中、大のインクの範囲 small_range = ((0, 0), (1, 0), (0, 1), (-1, 0), (0, -1)) middle_range = ((0, 0), (1, 0), (1, 1), (0, 1), (-1, 1), (-1, 0), (-1, -1), (0, -1), (1, -1)) large_range = ((0, 0), (1, 0), (2, 0), (1, 1), (0, 1), (0, 2), ...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,950
s540200695
p00026
u847467233
1529013075
Python
Python3
py
Accepted
20
5616
699
# AOJ 0026 Dropping Ink # Python3 2018.6.15 bal4u paper = [[0 for i in range(15)] for j in range(15)] base = 2 while True: try: x, y, s = list(map(int, input().split(','))) except EOFError: break x += 2 y += 2 if s == 3: paper[x-2][y] += 1 paper[x+2][y] += 1 paper[x][y-2] += 1 paper[x][y+2] ...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,951
s327624379
p00026
u724947062
1347283261
Python
Python
py
Accepted
20
5396
1,092
import sys paper = [[0] * 10 for x in xrange(10)] def dropInc(coord, size): x, y = coord if size == 1: paper[y][x] += 1 if y > 0: paper[y-1][x] += 1 if y < 9: paper[y+1][x] += 1 if x > 0: paper[y][x-1] += 1 if x < 9: paper...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,952
s669007460
p00026
u459861655
1352982392
Python
Python
py
Accepted
20
5016
769
drops = { 1: ((0,0,0,0,0), (0,0,1,0,0), (0,1,1,1,0), (0,0,1,0,0), (0,0,0,0,0)), 2: ((0,0,0,0,0), (0,1,1,1,0), (0,1,1,1,0), (0,1,1,1,0), (0,0,0,0,0)), 3: ((0,0,1,0,0), (0,1,1,1,0), (1,1,1,1,1), (0,1,1,1,0), (0,0,1,0,0))} paper = [[0 for i in xrange(14)] for j in xrange(14)] def solve(x, y, size): for i...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,953
s044747357
p00026
u459861655
1352984470
Python
Python
py
Accepted
10
5016
651
drops = { 1: ((0,0,0,0,0), (0,0,1,0,0), (0,1,1,1,0), (0,0,1,0,0), (0,0,0,0,0)), 2: ((0,0,0,0,0), (0,1,1,1,0), (0,1,1,1,0), (0,1,1,1,0), (0,0,0,0,0)), 3: ((0,0,1,0,0), (0,1,1,1,0), (1,1,1,1,1), (0,1,1,1,0), (0,0,1,0,0))} paper = [[0] * 14 for j in xrange(14)] def solve(x, y, size): for i in xrange(5): ...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,954
s902544209
p00026
u647766105
1355624998
Python
Python
py
Accepted
10
4280
767
import sys board=[[0]*10 for i in xrange(10)] large=[[0,0,1,0,0], [0,1,1,1,0], [1,1,1,1,1], [0,1,1,1,0], [0,0,1,0,0],] middle=[[0,0,0,0,0], [0,1,1,1,0], [0,1,1,1,0], [0,1,1,1,0], [0,0,0,0,0],] small=[[0,0,0,0,0], [0,0,1,0,0], [0,1,1,1,0], ...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,955
s247938952
p00026
u647766105
1355628302
Python
Python
py
Accepted
20
4280
750
import sys board=[[0]*10 for i in xrange(10)] large=[[0,0,1,0,0], [0,1,1,1,0], [1,1,1,1,1], [0,1,1,1,0], [0,0,1,0,0],] middle=[[0,0,0,0,0], [0,1,1,1,0], [0,1,1,1,0], [0,1,1,1,0], [0,0,0,0,0],] small=[[0,0,0,0,0], [0,0,1,0,0], [0,1,1,1,0], ...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,956
s063315454
p00026
u647766105
1355628389
Python
Python
py
Accepted
10
4280
750
import sys board=[[0]*10 for i in xrange(10)] large=[[0,0,1,0,0], [0,1,1,1,0], [1,1,1,1,1], [0,1,1,1,0], [0,0,1,0,0],] middle=[[0,0,0,0,0], [0,1,1,1,0], [0,1,1,1,0], [0,1,1,1,0], [0,0,0,0,0],] small=[[0,0,0,0,0], [0,0,1,0,0], [0,1,1,1,0], ...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,957
s565505001
p00026
u647766105
1355628633
Python
Python
py
Accepted
10
4276
722
import sys board=[[0]*10 for i in xrange(10)] large=[[0,0,1,0,0], [0,1,1,1,0], [1,1,1,1,1], [0,1,1,1,0], [0,0,1,0,0],] middle=[[0,0,0,0,0], [0,1,1,1,0], [0,1,1,1,0], [0,1,1,1,0], [0,0,0,0,0],] small=[[0,0,0,0,0], [0,0,1,0,0], [0,1,1,1,0], ...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,958
s848725089
p00026
u419407022
1356269540
Python
Python
py
Accepted
20
4440
847
cell = [[0] * 10 for i in xrange(10)] large = [[0,0,1,0,0], [0,1,1,1,0], [1,1,1,1,1], [0,1,1,1,0], [0,0,1,0,0]] medium= [[0,0,0,0,0], [0,1,1,1,0], [0,1,1,1,0], [0,1,1,1,0], [0,0,0,0,0]] small = [[0,0,0,0,0], [0,0,1,0,0], [0,1,1...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,959
s264502832
p00026
u782850731
1362264189
Python
Python
py
Accepted
20
4680
843
from __future__ import (absolute_import, division, print_function, unicode_literals) from sys import stdin from collections import Counter NUM = [[0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0], [0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]] paper = Coun...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,960
s963007964
p00026
u282635979
1363949842
Python
Python
py
Accepted
10
4544
1,727
mass = [[0 for p in xrange(14)] for q in xrange(14)] while True: try: x,y,size = map(int,raw_input().split(',')) x += 2 ; y += 2 if size == 1: mass[x-2][y-2]+=0;mass[x-1][y-2]+=0;mass[x][y-2]+=0;mass[x+1][y-2]+=0;mass[x+2][y-2]+=0 mass[x-2][y-1]+=0;mass[x-1][y-1]+=0;mass[x][y-1]+=1;mass[x+1][y-1]+=0;mass...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,961
s627901911
p00026
u542421762
1368264220
Python
Python
py
Accepted
20
4280
1,592
import sys class Paper: def __init__(self): self.paper = [[0 for x in range(10)] for y in range(10)] def white_space(self): s = 0 for x in range(10): for y in range(10): if self.paper[x][y] == 0: s += 1 return s def most_da...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,962
s786661494
p00026
u912237403
1378028509
Python
Python
py
Accepted
20
4268
625
def drop(x,y): global paper if 0<=x<10 and 0<=y<10: paper[y][x]+=1 return def ink(x,y,size): drop(x,y) drop(x-1,y) drop(x+1,y) drop(x,y-1) drop(x,y+1) if size==1: return drop(x-1,y-1) drop(x-1,y+1) drop(x+1,y-1) drop(x+1,y+1) if size==2: return drop(x-2,y) ...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,963
s191726062
p00026
u813384600
1379507076
Python
Python
py
Accepted
20
4280
476
px = ((0,0,-1,1), (-1,-1,1,1), (0,0,-2,2)) py = ((-1,1,0,0), (-1,1,-1,1), (-2,2,0,0)) p = [[0]*14 for i in range(14)] while True: try: x,y,s = map(int,raw_input().split(',')) x += 2 y += 2 p[x][y] += 1 for i in range(s): for j in range(4): p[x+px...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,964
s182949968
p00026
u523886269
1381552335
Python
Python
py
Accepted
10
4332
1,427
import sys SIZE = 10 paper = [] def main(): init() for line in sys.stdin: data = line.strip().split(',') i = int(data[0]) j = int(data[1]) size = int(data[2]) if size == 1: drop_small(i, j) elif size == 2: drop_medium(i, j) e...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,965
s446582173
p00026
u633068244
1393391879
Python
Python
py
Accepted
10
4272
616
paper = [[0 for i in range(10)] for j in range(10)] def drop(x,y): global paper if 0 <= x < 10 and 0<= y < 10: paper[y][x] += 1 return def ink(x,y,s): drop(x,y) drop(x+1,y); drop(x,y+1) drop(x-1,y); drop(x,y-1) if s == 1: return drop(x+1,y+1); drop(x+1,y-1) drop(x-1,y+1); d...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,966
s131372400
p00026
u912237403
1394294193
Python
Python
py
Accepted
10
4268
564
import sys def ink(x,y,size): global paper paper[y][x]+=1 for d in [-1,1]: paper[y+d][x]+=1 paper[y][x+d]+=1 if size==1: return for d in [-1,1]: paper[y+d][x+d]+=1 paper[y+d][x-d]+=1 if size==2: return for d in [-2,2]: paper[y+d][x]+=1 paper[y]...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,967
s820713417
p00026
u912237403
1394294578
Python
Python
py
Accepted
10
4268
524
import sys def ink(x,y,size): global P P[y][x]+=1 for d in [-1,1]: P[y+d][x]+=1 P[y][x+d]+=1 if size==1: return for d in [-1,1]: P[y+d][x+d]+=1 P[y+d][x-d]+=1 if size==2: return for d in [-2,2]: P[y+d][x]+=1 P[y][x+d]+=1 return R=range(14)...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,968
s911156694
p00026
u912237403
1394295484
Python
Python
py
Accepted
10
4280
516
import sys def ink(x,y,s): global P P[y][x]+=1 P[y+1][x]+=1 P[y-1][x]+=1 P[y][x+1]+=1 P[y][x-1]+=1 if s==1: return P[y+1][x+1]+=1 P[y+1][x-1]+=1 P[y-1][x+1]+=1 P[y-1][x-1]+=1 if s==2: return P[y+2][x]+=1 P[y-2][x]+=1 P[y][x+2]+=1 P[y][x-2]+=1 return P...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,969
s957435139
p00026
u491763171
1396402122
Python
Python
py
Accepted
10
4312
843
small_x = [-1, 0, 0, 1] small_y = [0, -1, 1, 0] middle_x = [-1, -1, -1, 0, 0, 1, 1, 1] middle_y = [-1, 0, 1, -1, 1, -1, 0, 1] big_x = [-2, -1, -1, -1, 0, 0, 0, 0, 1, 1, 1, 2] big_y = [0, -1, 0, 1, -2, -1, 1, 2, -1, 0, 1, 0] dx = [[], small_x, middle_x, big_x] dy = [[], small_y, middle_y, big_y] field = [[0] * 10 for _...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,970
s850777978
p00026
u246033265
1396619957
Python
Python
py
Accepted
10
4272
527
dx = [[0, 1, 0, -1, 0], [1, 1, -1, -1], [2, 0, -2, 0]] dy = [[0, 0, 1, 0, -1], [-1, 1, 1, -1], [0, 2, 0, -2]] a = [[0 for i in range(14)] for j in range(14)] try: while True: x, y, s = map(int, raw_input().split(',')) x += 2 y += 2 for i in range(s): for j in range(len(dx...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,971
s383072593
p00026
u436634575
1401166971
Python
Python3
py
Accepted
30
6768
680
import sys def plot(x, y): global ban if 0 <= x < 10 and 0 <= y < 10: ban[y][x] += 1 def drop(x, y, s): for dx, dy in [(0, 0), (-1, 0), (1, 0), (0, -1), (0, 1)]: plot(x + dx, y + dy) if s == 1: return for dx, dy in [(-1, -1), (-1, 1), (1, -1), (1, 1)]: plot(x + dx, y + dy) if s...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,972
s082020694
p00026
u187074069
1594822248
Python
Python3
py
Accepted
20
5612
921
mat = [] for i in range(10): mat.append([0]*10) while True: try: lst = list(map(int, input().split(','))) x, y, s = lst[0], lst[1], lst[2] if s == 1: tmplst = [[x, y], [x, y-1], [x-1, y], [x+1, y], [x, y+1]] elif s == 2: tmplst = [[x, y], [x, y-...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,973
s568071631
p00026
u260980560
1589609594
Python
Python3
py
Accepted
20
5612
884
import sys readlines = sys.stdin.readlines write = sys.stdout.write def solve(): P = [] for line in readlines(): x, y, s = map(int, line.split(",")) P.append((x, y, s)) L = 10 MP = [[0]*L for i in range(L)] def update(k, ps): for x, y, s in P: if k <= s: ...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,974
s207760292
p00026
u240091169
1589036058
Python
Python3
py
Accepted
20
5608
1,191
paper = [[0 for i in range(10)] for j in range(10)] while True : try : x, y, s = map(int, input().split(",")) paper[x][y] += 1 if x > 0 : paper[x-1][y] += 1 if y > 0 : paper[x][y-1] += 1 if x < 9 : paper[x+1][y] += 1 if y <...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,975
s713299026
p00026
u072053884
1585540590
Python
Python3
py
Accepted
20
5600
682
def solve(): from sys import stdin input_lines = stdin paper = [0] * 196 size = [[0, -1, 1, -14, 14], [0, -1, 1, -15, -14, -13, 13, 14, 15], [0, -1, 1, -15, -14, -13, 13, 14, 15, -28, -2, 2, 28]] for line in input_lines: x, y, s = map(int, line.split(',')) ...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,976
s333327068
p00026
u808372529
1584064927
Python
Python3
py
Accepted
20
5604
1,040
sheet = [[0 for _ in range(10)] for _ in range(10)] #小、中、大のインクの範囲 small_range = ((0, 0), (1, 0), (0, 1), (-1, 0), (0, -1)) middle_range = ((0, 0), (1, 0), (1, 1), (0, 1), (-1, 1), (-1, 0), (-1, -1), (0, -1), (1, -1)) large_range = ((0, 0), (1, 0), (2, 0), (1, 1), (0, 1), (0, 2), (-1, 1), (-1, 0), (-2, 0), (-1, -1), (0...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,977
s062554847
p00026
u472768263
1570701964
Python
Python3
py
Accepted
20
5824
2,879
def paint(masu,data): masu[data[1]][data[0]]+=1 #インクを垂らした場所 #print(masu) if data[2]==1: #インク小の時 if data[0]!=0: masu[data[1]][data[0]-1]+=1 if data[0]!=9: masu[data[1]][data[0]+1]+=1 if data[1]!=0: masu...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,978
s561918845
p00026
u824708460
1566281716
Python
Python3
py
Accepted
20
5608
841
def small(x, y, a): a[x][y] += 1 a[x + 1][y] += 1 a[x - 1][y] += 1 a[x][y + 1] += 1 a[x][y - 1] += 1 def medium(x, y, a): small(x, y, a) a[x + 1][y + 1] += 1 a[x - 1][y + 1] += 1 a[x - 1][y - 1] += 1 a[x + 1][y - 1] += 1 def large(x, y, a): medium(x, y, a) a[x + 2][y]...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,979
s739281434
p00026
u506537276
1560319032
Python
Python3
py
Accepted
30
5624
1,026
p = [[0 for j in range(10)] for i in range(10)] s1i = [-1, 0, 0, 1] s1j = [0, -1, 1, 0] s2i = [-1, -1, -1, 0, 0, 1, 1, 1] s2j = [-1, 0, 1, -1, 1, -1, 0, 1] s3i = [-2, -1, -1, -1, 0, 0, 0, 0, 1, 1, 1, 2] s3j = [0, -1, 0, 1, -2, -1, 1, 2, -1, 0, 1, 0] while True: try: x, y, s = map(int, input().split(",")) exce...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,980
s363613860
p00026
u548252256
1560266817
Python
Python3
py
Accepted
20
5616
1,741
if __name__ == '__main__': DI = [[0 for _ in range(10)] for _ in range(10)] while True: try: x,y,s = map(int,input().split(",")) if s == 0: break if s == 1: #自身 DI[x][y] += 1 #up if y >= 1 : DI[x][y-1] += 1 #down if y <= 8: DI[x][y+1] += 1 #left if x >= 1: ...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,981
s495168926
p00026
u625806423
1557141445
Python
Python3
py
Accepted
20
5620
1,434
def small_ink(paper,x,y): paper[x][y] += 1 if 0 <= x-1 and x-1 < 10: paper[x-1][y] += 1 if 0 <= y-1 and y-1 < 10: paper[x][y-1] += 1 if 0 <= x+1 and x+1 < 10: paper[x+1][y] += 1 if 0 <= y+1 and y+1 < 10: paper[x][y+1] += 1 return paper def middle_ink(paper,x,y): paper = small_ink(paper,x,...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,982
s108901814
p00026
u406093358
1555565792
Python
Python
py
Accepted
10
4696
909
import sys field = [] for i in range(0, 10): lst = [] for j in range(0, 10): lst.append(0) field.append(lst) for line in sys.stdin: x, y, s = map(int, line.split(',')) field[x][y] += 1 for i in range(0, 2): nextx = x-1+2*i nexty = y-1+2*i if 0 <= nextx and nextx < 10: field[nextx][y] += 1 if 0 <= next...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,983
s844137084
p00026
u990228206
1553160853
Python
Python3
py
Accepted
20
5608
673
paper=[[0 for i in range(10)] for j in range(10)] while 1: try: x,y,s=map(int,input().split(",")) if s==1: r=[[-1,0],[1,0],[0,0],[0,-1],[0,1]] elif s==2: r=[[-1,-1],[-1,0],[-1,1],[0,-1],[0,0],[0,1],[1,-1],[1,0],[1,1]] elif s==3: r=[[-2,0],[-1,-1],[...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,984
s792210993
p00026
u563075864
1542967719
Python
Python3
py
Accepted
20
5616
767
a = [[0 for i in range(14)] for j in range(14)] drop = [0 for i in range(3)] drop[0] = [ [0,0,0,0,0], [0,0,1,0,0], [0,1,1,1,0], [0,0,1,0,0], [0,0,0,0,0] ] drop[1] = [ [0,0,0,0,0], [0,1,1,1,0], [0,1,1,1,0], [0,1,1,1,0], [0,0,0,0,0] ] drop[2] = [ [0,0,1,0,0], [0,1,1,1,0], [1,1,1,1,1], [0,1,1,1,0], [0,0,1,0...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,985
s009063265
p00026
u067299340
1542250600
Python
Python3
py
Accepted
20
5612
1,144
paper = [[0]*10 for l in range(10)] while True: try: x,y,s = map(int, input().split(",")) # s size paper[x][y] += 1 if y - 1 >= 0: paper[x][y - 1] += 1 if x - 1 >= 0: paper[x - 1][y] += 1 if x + 1 < 10: paper[x + 1][y] += 1 ...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,986
s112023176
p00026
u717526540
1541665370
Python
Python3
py
Accepted
20
5624
780
paper = [[0 for i in range(15)] for j in range(15)] base = 2 while True: try: x, y, s = list(map(int, input().split(','))) except EOFError: break x += 2 y += 2 if s == 3: paper[x-2][y] += 1 paper[x+2][y] += 1 paper[x][y-2] += 1 paper[x][y+2...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,987
s217584068
p00026
u319725914
1534256494
Python
Python3
py
Accepted
20
5616
674
ar = [[0]*14 for _ in range(14)] while(True): try: x,y,s = map(int,input().split(",")) if s == 3: for x1,y1 in [[-2,0],[0,2],[2,0],[0,-2],[-1,-1],[0,-1],[1,-1],[-1,0],[0,0],[1,0],[-1,1],[0,1],[1,1]]: ar[y1+y+2][x1+x+2] += 1 elif s == 2: for x1,y1 in [...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,988
s273706653
p00026
u079141094
1517116328
Python
Python3
py
Accepted
20
5616
1,749
import sys class Board(): def __init__(self): self.B = [0 for _ in range(12 * 12)] for i in range(0, 12): self.B[i] = -1 for i in range(12, 12 * 12, 12): self.B[i] = -1 for i in range(11, 11 * 12, 12): self.B[i] = -1 for i in...
p00026
<H1>Dropping Ink</H1> <p> As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system. </p> <p> We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From th...
2,5,3 3,6,1 3,4,2 4,5,2 3,6,3 2,4,1
77 5
7,989
s132080370
p00027
u223900719
1545575660
Python
Python
py
Accepted
10
4648
282
M=[ 31, 29, 31, 30, 31,30,31,31,30,31,30,31] DAY=["Wednesday","Thursday","Friday","Saturday","Sunday","Monday","Tuesday"] m=2 d=29 while True: m,d=map( int , raw_input().split() ) if m==d==0: quit() else: x=0 for i in range(m-1): x+=M[i] x+=d print DAY[x%7]
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicat...
1 1 2 29 0 0
Thursday Sunday
7,990
s474160057
p00027
u647694976
1556078391
Python
Python3
py
Accepted
30
6040
239
from datetime import date dic={3:"Thursday",4:"Friday",5:"Saturday",6:"Sunday",0:"Monday",1:"Tuesday",2:"Wednesday"} while True: m,d=map(int,input().split()) if m==0 and d==0: break print(dic[date(2004,m,d).weekday()])
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicat...
1 1 2 29 0 0
Thursday Sunday
7,991
s940496432
p00027
u861198832
1556450865
Python
Python3
py
Accepted
20
6056
184
import sys from datetime import * for line in sys.stdin: a, b = map(int,line.split()) try: print(date(2004, a, b).strftime("%A")) except ValueError: break
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicat...
1 1 2 29 0 0
Thursday Sunday
7,992
s322962509
p00027
u193025715
1408266869
Python
Python3
py
Accepted
30
7056
286
#!/usr/bin/python import datetime days = [ 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday' ] while True: m, d = map(int, input().split(' ')) if m == 0: break print(days[datetime.date(2004, m, d).weekday()])
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicat...
1 1 2 29 0 0
Thursday Sunday
7,993
s894041735
p00027
u560838141
1408859085
Python
Python
py
Accepted
10
4396
249
import datetime weekdays = [ "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday", ] while True: m, d = map(int, raw_input().strip().split(" ")) if m == 0: break print weekdays[datetime.date(2004, m, d).weekday()]
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicat...
1 1 2 29 0 0
Thursday Sunday
7,994
s504638665
p00027
u733620181
1409888125
Python
Python
py
Accepted
10
4404
240
from datetime import date week = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'] while True: line = map(int, raw_input().split()) if line[0] == 0: break print week[date(2004,line[0],line[1]).weekday()]
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicat...
1 1 2 29 0 0
Thursday Sunday
7,995
s154929983
p00027
u855866586
1412387746
Python
Python
py
Accepted
10
4220
392
days=['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'] dom=[31,29,31,30,31,30,31,31,30,31,30,31] while True: try: try: (m,d)=map(int,raw_input().split()) except: break if m==0 and d==0: break day=4-1 for i in xrange(m-1): day+=do...
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicat...
1 1 2 29 0 0
Thursday Sunday
7,996
s610929615
p00027
u855866586
1412387776
Python
Python
py
Accepted
20
4928
302
days=['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday'] import calendar while True: try: try: (m,d)=map(int,raw_input().split()) except: break if m==0 and d==0: break print days[calendar.weekday(2004,m,d)] except EOFError: break
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicat...
1 1 2 29 0 0
Thursday Sunday
7,997
s536235713
p00027
u506132575
1416139278
Python
Python
py
Accepted
20
4408
344
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys from datetime import date def print_week(n): n_to_week = {0:"Monday",1:"Tuesday",2:"Wednesday",3:"Thursday",4:"Friday",5:"Saturday",6:"Sunday"} print n_to_week[n] for s in sys.stdin: d = map(int,s.split()) if d == [0,0]: exit() print_week(date(20...
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicat...
1 1 2 29 0 0
Thursday Sunday
7,998
s862177378
p00027
u567380442
1422705976
Python
Python3
py
Accepted
40
7052
310
import datetime import sys week = {0:'Monday', 1:'Tuesday', 2:'Wednesday', 3:'Thursday', 4:'Friday', 5:'Saturday', 6:'Sunday'} f = sys.stdin while True: month, date = map(int, f.readline().split()) if month == 0: break day = datetime.date(2004, month, date) print(week[day.weekday()])
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicat...
1 1 2 29 0 0
Thursday Sunday
7,999
s441004085
p00027
u879226672
1424758725
Python
Python
py
Accepted
10
4408
430
from datetime import date while True: m,d = map(int,raw_input().split(" ")) if m ==0: break w = date(2004,m,d).isoweekday() if w==1: print 'Monday' elif w==2: print 'Tuesday' elif w==3: print 'Wednesday' elif w==4: print 'Thursday' e...
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicat...
1 1 2 29 0 0
Thursday Sunday
8,000
s554228556
p00027
u744114948
1426000411
Python
Python3
py
Accepted
30
7060
233
import datetime week=["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"] while True: a,b=map(int, input().split()) if a == b == 0: break print(week[datetime.date(2004, a, b).weekday()])
p00027
<H1>What day is today?</H1> <p> Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29. </p> <H2>Input</H2> <p> The input is a sequence of datasets. The end of the input is indicat...
1 1 2 29 0 0
Thursday Sunday
8,001