message
stringlengths
2
19.9k
message_type
stringclasses
2 values
message_id
int64
0
1
conversation_id
int64
322
108k
cluster
float64
15
15
__index_level_0__
int64
644
217k
Provide a correct Python 3 solution for this coding contest problem. A robot is put at the origin in a two-dimensional plane. Initially, the robot is facing in the positive x-axis direction. This robot will be given an instruction sequence s. s consists of the following two kinds of letters, and will be executed in o...
instruction
0
20,121
15
40,242
"Correct Solution: ``` s = [len(x) for x in input().split('T')] x, y = map(int, input().split()) len_s = len(s) sx = [s[i] for i in range(len_s) if i % 2 == 0] sy = [s[i] for i in range(len_s) if i % 2 == 1] x -= sx[0] sx = sx[1:] def is_reachable(p, s): origin = 8000 if origin+p < 0: return False ...
output
1
20,121
15
40,243
Provide tags and a correct Python 3 solution for this coding contest problem. The king is left alone on the chessboard. In spite of this loneliness, he doesn't lose heart, because he has business of national importance. For example, he has to pay an official visit to square t. As the king is not in habit of wasting hi...
instruction
0
20,628
15
41,256
Tags: greedy, shortest paths Correct Solution: ``` # -*- coding: utf-8 -*- """ Created on Tue Feb 27 20:06:06 2018 @author: hp """ #read the input start = input() end = input() x1 = ord(start[0]) - ord('a') + 1 y1 = eval(start[1]) x2 = ord(end[0]) - ord('a') + 1 y2 = eval(end[1]) #number of steps steps = max(abs(x1 -...
output
1
20,628
15
41,257
Provide tags and a correct Python 3 solution for this coding contest problem. The king is left alone on the chessboard. In spite of this loneliness, he doesn't lose heart, because he has business of national importance. For example, he has to pay an official visit to square t. As the king is not in habit of wasting hi...
instruction
0
20,629
15
41,258
Tags: greedy, shortest paths Correct Solution: ``` p = ["a", "b", "c", "d", "e", "f", "g", "h"] s = input() t = input() x_dif = p.index(t[0]) - p.index(s[0]) y_dif = int(t[1]) - int(s[1]) x,y = abs(x_dif), abs(y_dif) count = (max(x,y)) print(count) if x_dif < 0: hmove = "L" else: hmove = "R" if y_dif < 0: ...
output
1
20,629
15
41,259
Provide tags and a correct Python 3 solution for this coding contest problem. The king is left alone on the chessboard. In spite of this loneliness, he doesn't lose heart, because he has business of national importance. For example, he has to pay an official visit to square t. As the king is not in habit of wasting hi...
instruction
0
20,630
15
41,260
Tags: greedy, shortest paths Correct Solution: ``` tmp = input() sx, sy = ord(tmp[0])-97, int(tmp[1])-1 tmp = input() ex, ey = ord(tmp[0])-97, int(tmp[1])-1 dx, dy = ex-sx, ey-sy h = [('R' if dx > 0 else 'L')]*max(dx, -dx) v = [('U' if dy > 0 else 'D')]*max(dy, -dy) r = max(len(h), len(v)) print(r) for i in range(r): ...
output
1
20,630
15
41,261
Provide tags and a correct Python 3 solution for this coding contest problem. The king is left alone on the chessboard. In spite of this loneliness, he doesn't lose heart, because he has business of national importance. For example, he has to pay an official visit to square t. As the king is not in habit of wasting hi...
instruction
0
20,631
15
41,262
Tags: greedy, shortest paths Correct Solution: ``` y_cor = { 'a': 1, 'b': 2, 'c': 3, 'd': 4,'e':5, 'f':6, 'g':7, 'h': 8 ,} a = input(); b = input() x1 = y_cor[a[0]]; y1 = int(a[1]) x2 = y_cor[b[0]]; y2 = int(b[1]) s = ""; c = 0 while(True): if([x1,y1]==[x2,y2]): break if(x2>x1): x1+=1; s+=("R"); if...
output
1
20,631
15
41,263
Provide tags and a correct Python 3 solution for this coding contest problem. The king is left alone on the chessboard. In spite of this loneliness, he doesn't lose heart, because he has business of national importance. For example, he has to pay an official visit to square t. As the king is not in habit of wasting hi...
instruction
0
20,632
15
41,264
Tags: greedy, shortest paths Correct Solution: ``` col = list('abcdefgh') beg = list(input()) end = list(input()) beg[0] = col.index(beg[0])+1 beg[1] = int(beg[1]) end[0] = col.index(end[0])+1 end[1] = int(end[1]) print(max(abs(beg[0]-end[0]),abs(beg[1]-end[1]))) while True: if (beg[0] == end[0] and beg[1] == end[...
output
1
20,632
15
41,265
Provide tags and a correct Python 3 solution for this coding contest problem. The king is left alone on the chessboard. In spite of this loneliness, he doesn't lose heart, because he has business of national importance. For example, he has to pay an official visit to square t. As the king is not in habit of wasting hi...
instruction
0
20,633
15
41,266
Tags: greedy, shortest paths Correct Solution: ``` l1,n1 = list(input()) l2,n2 = list(input()) ans=[] diff1 = (ord(l2)-ord(l1)) # if + then h > a move right diff2 = (ord(n2)-ord(n1)) # if + then 8 > 1 move down #L, R, U, D, LU, LD, RU or RD. while diff1!=0 and diff2!=0: if diff1>0 and diff2>0: ans.append('...
output
1
20,633
15
41,267
Provide tags and a correct Python 3 solution for this coding contest problem. The king is left alone on the chessboard. In spite of this loneliness, he doesn't lose heart, because he has business of national importance. For example, he has to pay an official visit to square t. As the king is not in habit of wasting hi...
instruction
0
20,634
15
41,268
Tags: greedy, shortest paths Correct Solution: ``` a = input() b = input() if a == b: print(0) quit() a1 = int(str(ord(a[0])-96) + a[1]) b1 = int(str(ord(b[0])-96) + b[1]) def ok(i, j): return 0 < i <= 8 and 0 < j <= 8 g = {} for i in range(1,9): for j in range(1,9): g[10*i+j] = [] for ...
output
1
20,634
15
41,269
Provide tags and a correct Python 3 solution for this coding contest problem. The king is left alone on the chessboard. In spite of this loneliness, he doesn't lose heart, because he has business of national importance. For example, he has to pay an official visit to square t. As the king is not in habit of wasting hi...
instruction
0
20,635
15
41,270
Tags: greedy, shortest paths Correct Solution: ``` s = input() t = input() def str_to_nmb(argument): switcher = { "a" : 1, "b" : 2, "c" : 3, "d" : 4, "e" : 5, "f" : 6, "g" : 7, "h" : 8 } return switcher.get(argument, "nothing") s = [st...
output
1
20,635
15
41,271
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The king is left alone on the chessboard. In spite of this loneliness, he doesn't lose heart, because he has business of national importance. For example, he has to pay an official visit to squa...
instruction
0
20,636
15
41,272
Yes
output
1
20,636
15
41,273
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The king is left alone on the chessboard. In spite of this loneliness, he doesn't lose heart, because he has business of national importance. For example, he has to pay an official visit to squa...
instruction
0
20,637
15
41,274
Yes
output
1
20,637
15
41,275
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The king is left alone on the chessboard. In spite of this loneliness, he doesn't lose heart, because he has business of national importance. For example, he has to pay an official visit to squa...
instruction
0
20,638
15
41,276
Yes
output
1
20,638
15
41,277
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The king is left alone on the chessboard. In spite of this loneliness, he doesn't lose heart, because he has business of national importance. For example, he has to pay an official visit to squa...
instruction
0
20,639
15
41,278
Yes
output
1
20,639
15
41,279
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The king is left alone on the chessboard. In spite of this loneliness, he doesn't lose heart, because he has business of national importance. For example, he has to pay an official visit to squa...
instruction
0
20,640
15
41,280
No
output
1
20,640
15
41,281
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The king is left alone on the chessboard. In spite of this loneliness, he doesn't lose heart, because he has business of national importance. For example, he has to pay an official visit to squa...
instruction
0
20,641
15
41,282
No
output
1
20,641
15
41,283
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The king is left alone on the chessboard. In spite of this loneliness, he doesn't lose heart, because he has business of national importance. For example, he has to pay an official visit to squa...
instruction
0
20,642
15
41,284
No
output
1
20,642
15
41,285
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The king is left alone on the chessboard. In spite of this loneliness, he doesn't lose heart, because he has business of national importance. For example, he has to pay an official visit to squa...
instruction
0
20,643
15
41,286
No
output
1
20,643
15
41,287
Provide tags and a correct Python 3 solution for this coding contest problem. Ayrat is looking for the perfect code. He decided to start his search from an infinite field tiled by hexagons. For convenience the coordinate system is introduced, take a look at the picture to see how the coordinates of hexagon are defined...
instruction
0
20,721
15
41,442
Tags: binary search, implementation, math Correct Solution: ``` # Contest: 21 - Codeforces Rating >= 2200 (https://a2oj.com/ladder?ID=21) # Problem: (25) Hexagons (Difficulty: 5) (http://codeforces.com/problemset/problem/615/E) def rint(): return int(input()) def rints(): return list(map(int, input().split()...
output
1
20,721
15
41,443
Provide tags and a correct Python 3 solution for this coding contest problem. Ayrat is looking for the perfect code. He decided to start his search from an infinite field tiled by hexagons. For convenience the coordinate system is introduced, take a look at the picture to see how the coordinates of hexagon are defined...
instruction
0
20,722
15
41,444
Tags: binary search, implementation, math Correct Solution: ``` if __name__ == '__main__': n = int(input()) l, r = 1, 10 ** 9 x, mid = 0, 0 while l <= r: mid = (l+r)//2 if 3*mid*(mid-1) <= n: l = mid + 1 x = mid else: r = mid - 1 a, b = (n-...
output
1
20,722
15
41,445
Provide tags and a correct Python 3 solution for this coding contest problem. Ayrat is looking for the perfect code. He decided to start his search from an infinite field tiled by hexagons. For convenience the coordinate system is introduced, take a look at the picture to see how the coordinates of hexagon are defined...
instruction
0
20,723
15
41,446
Tags: binary search, implementation, math Correct Solution: ``` ru = (1,2) r = (2,0) rd = (1,-2) ld = (-1,-2) l = (-2,0) lu = (-1,2) x, y = 0, 0 n = int(input()) l = -1 r = int(1e18) while r - l > 1: m = (r + l)//2 if 5 * m + 3 * m * (m - 1) > n: r = m else: l = m x += l * (1) y += l * (-2) n -= 5 * l ...
output
1
20,723
15
41,447
Provide tags and a correct Python 3 solution for this coding contest problem. Ayrat is looking for the perfect code. He decided to start his search from an infinite field tiled by hexagons. For convenience the coordinate system is introduced, take a look at the picture to see how the coordinates of hexagon are defined...
instruction
0
20,724
15
41,448
Tags: binary search, implementation, math Correct Solution: ``` #!/usr/bin/env python3 def binsearch(p, l, r): # (l,r], return the smallest n which p holds while l+1 != r: m = (l + r) // 2 if p(m): r = m else: l = m return r n = int(input()) if n == 0: print(0...
output
1
20,724
15
41,449
Provide tags and a correct Python 3 solution for this coding contest problem. Ayrat is looking for the perfect code. He decided to start his search from an infinite field tiled by hexagons. For convenience the coordinate system is introduced, take a look at the picture to see how the coordinates of hexagon are defined...
instruction
0
20,725
15
41,450
Tags: binary search, implementation, math Correct Solution: ``` import math def main(m): if m == 0: print("0 0") else: x = math.floor(1/6*((12*m - 3)**0.5 + 3)) # Approx ?... while True: d = m - (x**3 - (x-1)**3) if (d < 0): x -= 1 elif (d > x * 6 + 6)...
output
1
20,725
15
41,451
Provide tags and a correct Python 3 solution for this coding contest problem. Ayrat is looking for the perfect code. He decided to start his search from an infinite field tiled by hexagons. For convenience the coordinate system is introduced, take a look at the picture to see how the coordinates of hexagon are defined...
instruction
0
20,726
15
41,452
Tags: binary search, implementation, math Correct Solution: ``` #By Tianyi Chen n=int(input()) def j(i): return 3*i*(i+1)<=n high=10**18;low=0 while high-low>5: mid=high+low>>1 if j(mid):low=mid else:high=mid while j(low+1):low+=1 r=low x=r<<1;y=0 n-=3*r*(r+1) r+=1 if n: n-=1;x+=1;y+=2 if n: sub=min(n,r-1);n-=sub...
output
1
20,726
15
41,453
Provide tags and a correct Python 3 solution for this coding contest problem. Ayrat is looking for the perfect code. He decided to start his search from an infinite field tiled by hexagons. For convenience the coordinate system is introduced, take a look at the picture to see how the coordinates of hexagon are defined...
instruction
0
20,727
15
41,454
Tags: binary search, implementation, math Correct Solution: ``` from math import sqrt, ceil from collections import namedtuple def add(a, b): return a[0] + b[0], a[1] + b[1] def count(p): return p * (3 * p + 2) def bin_search(n): l = 0 r = ceil(sqrt(n)) while r - l > 1: m = (l + r) // 2 ...
output
1
20,727
15
41,455
Provide tags and a correct Python 3 solution for this coding contest problem. Ayrat is looking for the perfect code. He decided to start his search from an infinite field tiled by hexagons. For convenience the coordinate system is introduced, take a look at the picture to see how the coordinates of hexagon are defined...
instruction
0
20,728
15
41,456
Tags: binary search, implementation, math Correct Solution: ``` #!/usr/bin/python3 import math def solve(n): if n == 0: return (0, 0) k = int(0.5 * (-1 + math.sqrt(1 + 4 * n / 3.0))) + 10 while 3 * k * (k + 1) >= n: k -= 1 n -= 3 * k * (k + 1) + 1 x = 1 + 2 * k y = 2 lim = [k] + [k + 1] * 5 ...
output
1
20,728
15
41,457
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Ayrat is looking for the perfect code. He decided to start his search from an infinite field tiled by hexagons. For convenience the coordinate system is introduced, take a look at the picture to...
instruction
0
20,729
15
41,458
Yes
output
1
20,729
15
41,459
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Ayrat is looking for the perfect code. He decided to start his search from an infinite field tiled by hexagons. For convenience the coordinate system is introduced, take a look at the picture to...
instruction
0
20,730
15
41,460
Yes
output
1
20,730
15
41,461
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Ayrat is looking for the perfect code. He decided to start his search from an infinite field tiled by hexagons. For convenience the coordinate system is introduced, take a look at the picture to...
instruction
0
20,732
15
41,464
Yes
output
1
20,732
15
41,465
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Ayrat is looking for the perfect code. He decided to start his search from an infinite field tiled by hexagons. For convenience the coordinate system is introduced, take a look at the picture to...
instruction
0
20,733
15
41,466
No
output
1
20,733
15
41,467
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Ayrat is looking for the perfect code. He decided to start his search from an infinite field tiled by hexagons. For convenience the coordinate system is introduced, take a look at the picture to...
instruction
0
20,734
15
41,468
No
output
1
20,734
15
41,469
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Ayrat is looking for the perfect code. He decided to start his search from an infinite field tiled by hexagons. For convenience the coordinate system is introduced, take a look at the picture to...
instruction
0
20,735
15
41,470
No
output
1
20,735
15
41,471
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Ayrat is looking for the perfect code. He decided to start his search from an infinite field tiled by hexagons. For convenience the coordinate system is introduced, take a look at the picture to...
instruction
0
20,736
15
41,472
No
output
1
20,736
15
41,473
Provide a correct Python 3 solution for this coding contest problem. AtCoDeer the deer found two rectangles lying on the table, each with height 1 and width W. If we consider the surface of the desk as a two-dimensional plane, the first rectangle covers the vertical range of [0,1] and the horizontal range of [a,a+W], ...
instruction
0
21,034
15
42,068
"Correct Solution: ``` w,a,b=map(int,input().split()) print(0 if a<=b+w and b<=a+w else min(abs(a+w-b),abs(a-w-b))) ```
output
1
21,034
15
42,069
Provide a correct Python 3 solution for this coding contest problem. AtCoDeer the deer found two rectangles lying on the table, each with height 1 and width W. If we consider the surface of the desk as a two-dimensional plane, the first rectangle covers the vertical range of [0,1] and the horizontal range of [a,a+W], ...
instruction
0
21,035
15
42,070
"Correct Solution: ``` w,a,b=map(int,input().split()) x=max(b-a-w,a-b-w) if x>0:print(x) else:print(0) ```
output
1
21,035
15
42,071
Provide a correct Python 3 solution for this coding contest problem. AtCoDeer the deer found two rectangles lying on the table, each with height 1 and width W. If we consider the surface of the desk as a two-dimensional plane, the first rectangle covers the vertical range of [0,1] and the horizontal range of [a,a+W], ...
instruction
0
21,036
15
42,072
"Correct Solution: ``` w, a, b = map(int, input().split()) print(max(0, (max(a, b) - (min(a, b) + w)))) ```
output
1
21,036
15
42,073
Provide a correct Python 3 solution for this coding contest problem. AtCoDeer the deer found two rectangles lying on the table, each with height 1 and width W. If we consider the surface of the desk as a two-dimensional plane, the first rectangle covers the vertical range of [0,1] and the horizontal range of [a,a+W], ...
instruction
0
21,037
15
42,074
"Correct Solution: ``` w, a, b = map(int, input().split()) print(max(0, b - a - w, a - b - w)) ```
output
1
21,037
15
42,075
Provide a correct Python 3 solution for this coding contest problem. AtCoDeer the deer found two rectangles lying on the table, each with height 1 and width W. If we consider the surface of the desk as a two-dimensional plane, the first rectangle covers the vertical range of [0,1] and the horizontal range of [a,a+W], ...
instruction
0
21,038
15
42,076
"Correct Solution: ``` w, a, b = map(int, input().split()) print(max(0, b - (a + w), a - (b + w))) ```
output
1
21,038
15
42,077
Provide a correct Python 3 solution for this coding contest problem. AtCoDeer the deer found two rectangles lying on the table, each with height 1 and width W. If we consider the surface of the desk as a two-dimensional plane, the first rectangle covers the vertical range of [0,1] and the horizontal range of [a,a+W], ...
instruction
0
21,039
15
42,078
"Correct Solution: ``` w, a, b = map(int, input().split()) print(max(0, max(a, b) - min(a, b) - w)) ```
output
1
21,039
15
42,079
Provide a correct Python 3 solution for this coding contest problem. AtCoDeer the deer found two rectangles lying on the table, each with height 1 and width W. If we consider the surface of the desk as a two-dimensional plane, the first rectangle covers the vertical range of [0,1] and the horizontal range of [a,a+W], ...
instruction
0
21,040
15
42,080
"Correct Solution: ``` W,a,b=map(int,input().split());print([abs(a-b)-W,0][abs(a-b)<=W]) ```
output
1
21,040
15
42,081
Provide a correct Python 3 solution for this coding contest problem. AtCoDeer the deer found two rectangles lying on the table, each with height 1 and width W. If we consider the surface of the desk as a two-dimensional plane, the first rectangle covers the vertical range of [0,1] and the horizontal range of [a,a+W], ...
instruction
0
21,041
15
42,082
"Correct Solution: ``` w, a, b = map(int,input().split()) s = abs(a-b) print([0, s-w][s>w]) ```
output
1
21,041
15
42,083
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. AtCoDeer the deer found two rectangles lying on the table, each with height 1 and width W. If we consider the surface of the desk as a two-dimensional plane, the first rectangle covers the verti...
instruction
0
21,042
15
42,084
Yes
output
1
21,042
15
42,085
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. AtCoDeer the deer found two rectangles lying on the table, each with height 1 and width W. If we consider the surface of the desk as a two-dimensional plane, the first rectangle covers the verti...
instruction
0
21,043
15
42,086
Yes
output
1
21,043
15
42,087
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. AtCoDeer the deer found two rectangles lying on the table, each with height 1 and width W. If we consider the surface of the desk as a two-dimensional plane, the first rectangle covers the verti...
instruction
0
21,044
15
42,088
Yes
output
1
21,044
15
42,089
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. AtCoDeer the deer found two rectangles lying on the table, each with height 1 and width W. If we consider the surface of the desk as a two-dimensional plane, the first rectangle covers the verti...
instruction
0
21,045
15
42,090
Yes
output
1
21,045
15
42,091
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. AtCoDeer the deer found two rectangles lying on the table, each with height 1 and width W. If we consider the surface of the desk as a two-dimensional plane, the first rectangle covers the verti...
instruction
0
21,046
15
42,092
No
output
1
21,046
15
42,093
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. AtCoDeer the deer found two rectangles lying on the table, each with height 1 and width W. If we consider the surface of the desk as a two-dimensional plane, the first rectangle covers the verti...
instruction
0
21,047
15
42,094
No
output
1
21,047
15
42,095
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. AtCoDeer the deer found two rectangles lying on the table, each with height 1 and width W. If we consider the surface of the desk as a two-dimensional plane, the first rectangle covers the verti...
instruction
0
21,048
15
42,096
No
output
1
21,048
15
42,097
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. AtCoDeer the deer found two rectangles lying on the table, each with height 1 and width W. If we consider the surface of the desk as a two-dimensional plane, the first rectangle covers the verti...
instruction
0
21,049
15
42,098
No
output
1
21,049
15
42,099
Provide a correct Python 3 solution for this coding contest problem. You decide to develop a game with your friends. The title of the game is "Battle Town". This is a game with the theme of urban warfare with tanks. As the first step in game development, we decided to develop the following prototype. In this prototyp...
instruction
0
21,118
15
42,236
"Correct Solution: ``` def move(act,y,x,direction):#ๆˆฆ่ปŠใฎๅ‹•ใ #print("x,y",y,x) #print("M,H",M,H) if x<0 or x == M or y<0 or y == H: return s_map if act == 'U':#Up if y == 0: s_map[y][x] = '^' else: if s_map[y-1][x] == '.':#ไธ‹ใŒๅนณๅœฐใชใ‚‰ s_map[y][x],s...
output
1
21,118
15
42,237
Provide a correct Python 3 solution for this coding contest problem. You decide to develop a game with your friends. The title of the game is "Battle Town". This is a game with the theme of urban warfare with tanks. As the first step in game development, we decided to develop the following prototype. In this prototyp...
instruction
0
21,119
15
42,238
"Correct Solution: ``` def move(y, x): p[2], p[3] = y, x if a[p[0] + y][p[1] + x] == ".":p[0] += y;p[1] += x def shoot(): th = p[0] + p[2] tw = p[1] + p[3] while 1: if a[th][tw] == "*":a[th][tw] = ".";break elif a[th][tw] == "#":break else: th += p[2]; tw += p[3] for u in r...
output
1
21,119
15
42,239