message
stringlengths
2
44.5k
message_type
stringclasses
2 values
message_id
int64
0
1
conversation_id
int64
276
109k
cluster
float64
23
23
__index_level_0__
int64
552
217k
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Pasha has a wooden stick of some positive integer length n. He wants to perform exactly three cuts to get four parts of the stick. Each part must have some positive integer length and the sum of...
instruction
0
77,146
23
154,292
Yes
output
1
77,146
23
154,293
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Pasha has a wooden stick of some positive integer length n. He wants to perform exactly three cuts to get four parts of the stick. Each part must have some positive integer length and the sum of...
instruction
0
77,147
23
154,294
No
output
1
77,147
23
154,295
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Pasha has a wooden stick of some positive integer length n. He wants to perform exactly three cuts to get four parts of the stick. Each part must have some positive integer length and the sum of...
instruction
0
77,148
23
154,296
No
output
1
77,148
23
154,297
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Pasha has a wooden stick of some positive integer length n. He wants to perform exactly three cuts to get four parts of the stick. Each part must have some positive integer length and the sum of...
instruction
0
77,149
23
154,298
No
output
1
77,149
23
154,299
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Pasha has a wooden stick of some positive integer length n. He wants to perform exactly three cuts to get four parts of the stick. Each part must have some positive integer length and the sum of...
instruction
0
77,150
23
154,300
No
output
1
77,150
23
154,301
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given a set of points on a straight line. Each point has a color assigned to it. For point a, its neighbors are the points which don't have any other points between them and a. Each poin...
instruction
0
77,964
23
155,928
No
output
1
77,964
23
155,929
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given a set of points on a straight line. Each point has a color assigned to it. For point a, its neighbors are the points which don't have any other points between them and a. Each poin...
instruction
0
77,965
23
155,930
No
output
1
77,965
23
155,931
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given a 0-1 rectangular matrix. What is the number of squares in it? A square is a solid square frame (border) with linewidth equal to 1. A square should be at least 2 × 2. We are only i...
instruction
0
78,371
23
156,742
No
output
1
78,371
23
156,743
Provide a correct Python 3 solution for this coding contest problem. The Smart Beaver from ABBYY loves puzzles. One of his favorite puzzles is the magic square. He has recently had an idea to automate the solution of this puzzle. The Beaver decided to offer this challenge to the ABBYY Cup contestants. The magic squar...
instruction
0
78,539
23
157,078
"Correct Solution: ``` import sys, random def f(b): global a a = [[0] * n for o in range(n)] for i in range(n): for j in range(n): a[i][j] = b[i * n + j] rez = 0 for i in range(n): ns = 0 for j in range(n): ns += a[i][j] rez += abs(su - ns) ...
output
1
78,539
23
157,079
Provide a correct Python 3 solution for this coding contest problem. The Smart Beaver from ABBYY loves puzzles. One of his favorite puzzles is the magic square. He has recently had an idea to automate the solution of this puzzle. The Beaver decided to offer this challenge to the ABBYY Cup contestants. The magic squar...
instruction
0
78,540
23
157,080
"Correct Solution: ``` import sys, random def f(b): global a a = [[0] * n for o in range(n)] for i in range(n): for j in range(n): a[i][j] = b[i * n + j] rez = 0 for i in range(n): ns = 0 for j in range(n): ns += a[i][j] rez += abs(su - ns)...
output
1
78,540
23
157,081
Provide a correct Python 3 solution for this coding contest problem. The Smart Beaver from ABBYY loves puzzles. One of his favorite puzzles is the magic square. He has recently had an idea to automate the solution of this puzzle. The Beaver decided to offer this challenge to the ABBYY Cup contestants. The magic squar...
instruction
0
78,541
23
157,082
"Correct Solution: ``` from itertools import permutations def check(a, n): arr = [[0 for j in range(n)] for i in range(n)] p = 0 for i in range(n): for j in range(n): arr[i][j] = a[p] p += 1 s = sum(arr[0]) for i in range(1, n): if s != sum(arr[i]): ...
output
1
78,541
23
157,083
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The Smart Beaver from ABBYY loves puzzles. One of his favorite puzzles is the magic square. He has recently had an idea to automate the solution of this puzzle. The Beaver decided to offer this ...
instruction
0
78,542
23
157,084
No
output
1
78,542
23
157,085
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The Smart Beaver from ABBYY loves puzzles. One of his favorite puzzles is the magic square. He has recently had an idea to automate the solution of this puzzle. The Beaver decided to offer this ...
instruction
0
78,543
23
157,086
No
output
1
78,543
23
157,087
Provide a correct Python 3 solution for this coding contest problem. A: Hokkaido University Easy Note Please note that the problem settings are the same as problem B, except for the constraints. story Homura-chan, who passed Hokkaido University and is excited about the beginning of a new life. But in front of her,...
instruction
0
79,087
23
158,174
"Correct Solution: ``` #!/usr/bin/python3 # -*- coding: utf-8 -*- H,W = map(int, input().split()) builds = [] for h in range(H): l = str(input()) for w in range(W): if l[w] == "B": builds.append([h,w]) ans = 0 for i,hw1 in enumerate(builds): for hw2 in builds[i+1:]: ans = max(ans,abs(hw1[0]-hw2[...
output
1
79,087
23
158,175
Provide a correct Python 3 solution for this coding contest problem. A: Hokkaido University Easy Note Please note that the problem settings are the same as problem B, except for the constraints. story Homura-chan, who passed Hokkaido University and is excited about the beginning of a new life. But in front of her,...
instruction
0
79,088
23
158,176
"Correct Solution: ``` H, W = map(int,input().split()) s = [] for k in range(H): s.append(input()) B = [] for k in range(H): for l in range(W): if s[k][l] == "B": B.append([k,l]) ans = 0 for e in B: for f in B: ans = max(ans,abs(e[0]-f[0])+abs(e[1]-f[1])) print(ans) ```
output
1
79,088
23
158,177
Provide a correct Python 3 solution for this coding contest problem. A: Hokkaido University Easy Note Please note that the problem settings are the same as problem B, except for the constraints. story Homura-chan, who passed Hokkaido University and is excited about the beginning of a new life. But in front of her,...
instruction
0
79,089
23
158,178
"Correct Solution: ``` H, W = map(int, input().split()) lst = [list(input()) for _ in range(H)] ans = 0 for ia in range(H): for ja in range(W): for ib in range(H): for jb in range(W): if lst[ia][ja] == 'B' and lst[ib][jb] == 'B': tmp = abs(ia-ib) + abs(ja-jb)...
output
1
79,089
23
158,179
Provide a correct Python 3 solution for this coding contest problem. A: Hokkaido University Easy Note Please note that the problem settings are the same as problem B, except for the constraints. story Homura-chan, who passed Hokkaido University and is excited about the beginning of a new life. But in front of her,...
instruction
0
79,090
23
158,180
"Correct Solution: ``` def inpl(): return list(map(int, input().split())) H, W = inpl() ans = 0 C = [input() for _ in range(H)] for i in range(2): L = [0]*H R = [0]*H Lk = [] Rk = [] for h in range(H): L[h] = C[h].find("B") R[h] = C[h].rfind("B") if L[h] >= 0: L...
output
1
79,090
23
158,181
Provide a correct Python 3 solution for this coding contest problem. A: Hokkaido University Easy Note Please note that the problem settings are the same as problem B, except for the constraints. story Homura-chan, who passed Hokkaido University and is excited about the beginning of a new life. But in front of her,...
instruction
0
79,091
23
158,182
"Correct Solution: ``` # -*- coding: utf-8 -*- import sys from operator import itemgetter # gcd from fractions import gcd # 切り上げ,切り捨て from math import ceil, floor # リストの真のコピー(変更が伝播しない) from copy import deepcopy # 累積和。list(accumulate(A))としてAの累積和 from itertools import accumulate # l = ['a', 'b', 'b', 'c', 'b', 'a', 'c', ...
output
1
79,091
23
158,183
Provide a correct Python 3 solution for this coding contest problem. A: Hokkaido University Easy Note Please note that the problem settings are the same as problem B, except for the constraints. story Homura-chan, who passed Hokkaido University and is excited about the beginning of a new life. But in front of her,...
instruction
0
79,092
23
158,184
"Correct Solution: ``` H,W=map(int,input().split()) MAP=[list(input()) for i in range(H)] BLIST=[] for i in range(H): for j in range(W): if MAP[i][j]=="B": BLIST.append([i,j]) BLIST.sort(key=lambda x:x[0]+x[1]) ANS=abs(BLIST[0][0]-BLIST[-1][0])+abs(BLIST[0][1]-BLIST[-1][1]) BLIST.sort(key=la...
output
1
79,092
23
158,185
Provide a correct Python 3 solution for this coding contest problem. A: Hokkaido University Easy Note Please note that the problem settings are the same as problem B, except for the constraints. story Homura-chan, who passed Hokkaido University and is excited about the beginning of a new life. But in front of her,...
instruction
0
79,093
23
158,186
"Correct Solution: ``` # from sys import exit H, W = [int(n) for n in input().split()] c = [[0 for _ in range(W)] for __ in range(H)] Bs = [] for i in range(H): c[i] = list(str(input())) for j in range(W): if c[i][j] == "B": Bs.append((i, j)) ans = 0 for e0 in Bs: for e1 in Bs: ...
output
1
79,093
23
158,187
Provide tags and a correct Python 3 solution for this coding contest problem. Little Petya very much likes rectangles and especially squares. Recently he has received 8 points on the plane as a gift from his mother. The points are pairwise distinct. Petya decided to split them into two sets each containing 4 points so...
instruction
0
79,310
23
158,620
Tags: brute force, geometry, math Correct Solution: ``` from sys import stdin, stdout from itertools import permutations as p from itertools import combinations as com def sqr_or_rec(a, b, c, d): x = ((a[1] - b[1])**2 + (a[0] - b[0]) **2) y = ((c[1] - b[1])**2 + (c[0] - b[0]) **2) w = ((c[1] - d[1])**2 + ...
output
1
79,310
23
158,621
Provide tags and a correct Python 3 solution for this coding contest problem. Little Petya very much likes rectangles and especially squares. Recently he has received 8 points on the plane as a gift from his mother. The points are pairwise distinct. Petya decided to split them into two sets each containing 4 points so...
instruction
0
79,311
23
158,622
Tags: brute force, geometry, math Correct Solution: ``` from itertools import combinations, permutations from math import sqrt EPS = 1e-6 def sd(x, y): return ((x[0] - y[0])**2 + (x[1] - y[1])**2) def is_square(points): for perm in permutations(points): if sd(perm[0], perm[1]) == sd(perm[1], perm[2]...
output
1
79,311
23
158,623
Provide tags and a correct Python 3 solution for this coding contest problem. Little Petya very much likes rectangles and especially squares. Recently he has received 8 points on the plane as a gift from his mother. The points are pairwise distinct. Petya decided to split them into two sets each containing 4 points so...
instruction
0
79,312
23
158,624
Tags: brute force, geometry, math Correct Solution: ``` from sys import stdin, stdout from itertools import permutations as p from itertools import combinations as com def sqr_or_rec(a, b, c, d): x = ((a[1] - b[1])**2 + (a[0] - b[0]) **2) y = ((c[1] - b[1])**2 + (c[0] - b[0]) **2) w = ((c[1] - d[1])**2 + (c[0] -...
output
1
79,312
23
158,625
Provide tags and a correct Python 3 solution for this coding contest problem. Little Petya very much likes rectangles and especially squares. Recently he has received 8 points on the plane as a gift from his mother. The points are pairwise distinct. Petya decided to split them into two sets each containing 4 points so...
instruction
0
79,313
23
158,626
Tags: brute force, geometry, math Correct Solution: ``` import itertools import math import os import sys eps = 1e-8 coord = [[]] + [list(map(int, input().split())) for _ in range(8)] idx = list(range(1, 9)) def perpendicular(v1, v2): return sum([x * y for (x, y) in zip(v1, v2)]) < eps def all_perpendicular(vs...
output
1
79,313
23
158,627
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Little Petya very much likes rectangles and especially squares. Recently he has received 8 points on the plane as a gift from his mother. The points are pairwise distinct. Petya decided to split...
instruction
0
79,314
23
158,628
No
output
1
79,314
23
158,629
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Little Petya very much likes rectangles and especially squares. Recently he has received 8 points on the plane as a gift from his mother. The points are pairwise distinct. Petya decided to split...
instruction
0
79,315
23
158,630
No
output
1
79,315
23
158,631
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Little Petya very much likes rectangles and especially squares. Recently he has received 8 points on the plane as a gift from his mother. The points are pairwise distinct. Petya decided to split...
instruction
0
79,316
23
158,632
No
output
1
79,316
23
158,633
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Little Petya very much likes rectangles and especially squares. Recently he has received 8 points on the plane as a gift from his mother. The points are pairwise distinct. Petya decided to split...
instruction
0
79,317
23
158,634
No
output
1
79,317
23
158,635
Provide tags and a correct Python 3 solution for this coding contest problem. Convexity of a set of points on the plane is the size of the largest subset of points that form a convex polygon. Your task is to build a set of n points with the convexity of exactly m. Your set of points should not contain three points tha...
instruction
0
79,416
23
158,832
Tags: constructive algorithms, geometry Correct Solution: ``` def f(x): return int(x * x + 1e7) def g(x): return -f(x) n, m = map(int, input().split()) if(m == 3): if(n == 3): print('0 0') print('1 0') print('0 1') elif(n == 4): print('0 0') print('1 1'...
output
1
79,416
23
158,833
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Convexity of a set of points on the plane is the size of the largest subset of points that form a convex polygon. Your task is to build a set of n points with the convexity of exactly m. Your se...
instruction
0
79,417
23
158,834
No
output
1
79,417
23
158,835
Provide a correct Python 3 solution for this coding contest problem. We have N points in a two-dimensional plane. The coordinates of the i-th point (1 \leq i \leq N) are (x_i,y_i). Let us consider a rectangle whose sides are parallel to the coordinate axes that contains K or more of the N points in its interior. Here,...
instruction
0
79,781
23
159,562
"Correct Solution: ``` INF = float("inf") N, K, *XY = map(int, open(0).read().split()) X, Y = zip(*sorted(zip(*[iter(XY)] * 2))) ans = INF for k in range(K, N + 1): for i in range(N - k + 1): dx = X[i + k - 1] - X[i] YY = sorted(Y[i:i + k]) for j in range(k - K + 1): dy = YY[j...
output
1
79,781
23
159,563
Provide a correct Python 3 solution for this coding contest problem. We have N points in a two-dimensional plane. The coordinates of the i-th point (1 \leq i \leq N) are (x_i,y_i). Let us consider a rectangle whose sides are parallel to the coordinate axes that contains K or more of the N points in its interior. Here,...
instruction
0
79,782
23
159,564
"Correct Solution: ``` N,K=map(int,input().split()) point=[tuple(map(int,input().split())) for i in range(N)] point.sort(key=lambda x:x[0]) ans=float('inf') for i in range(1+N-K): for j in range(i+K,N+1): x=point[j-1][0]-point[i][0] now=point[i:j] now.sort(key=lambda x:x[1]) for k in...
output
1
79,782
23
159,565
Provide a correct Python 3 solution for this coding contest problem. We have N points in a two-dimensional plane. The coordinates of the i-th point (1 \leq i \leq N) are (x_i,y_i). Let us consider a rectangle whose sides are parallel to the coordinate axes that contains K or more of the N points in its interior. Here,...
instruction
0
79,783
23
159,566
"Correct Solution: ``` N, K, *XY = map(int, open(0).read().split()) X, Y = zip(*sorted(zip(*[iter(XY)] * 2))) cand = [] for k in range(K, N + 1): for i in range(N - k + 1): dx = X[i + k - 1] - X[i] YY = sorted(Y[i:i + k]) cand += [min(dx * (YY[j + K - 1] - YY[j]) for j in range(k - K + 1))...
output
1
79,783
23
159,567
Provide a correct Python 3 solution for this coding contest problem. We have N points in a two-dimensional plane. The coordinates of the i-th point (1 \leq i \leq N) are (x_i,y_i). Let us consider a rectangle whose sides are parallel to the coordinate axes that contains K or more of the N points in its interior. Here,...
instruction
0
79,784
23
159,568
"Correct Solution: ``` n,k = map(int,input().split()) X = [0]*n Y = [0]*n for i in range(n): X[i],Y[i] = map(int,input().split()) Xs = sorted(X) Ys = sorted(Y) XY = sorted(list(zip(X,Y))) ans = 1e100 for i in range(n-k+1): for j in range(i+k-1,n): w = Xs[j] - Xs[i] XYs = sorted(XY[i:j+1],key = ...
output
1
79,784
23
159,569
Provide a correct Python 3 solution for this coding contest problem. We have N points in a two-dimensional plane. The coordinates of the i-th point (1 \leq i \leq N) are (x_i,y_i). Let us consider a rectangle whose sides are parallel to the coordinate axes that contains K or more of the N points in its interior. Here,...
instruction
0
79,785
23
159,570
"Correct Solution: ``` N,K = map(int,input().split()) A = [list(map(int,input().split())) for _ in range(N)] s = 10**19 B = sorted(A,key=lambda x:x[0]) for i in range(N-K+1): for j in range(K,N-i+1): xmin = B[i][0] xmax = B[i+j-1][0] By = sorted(B[i:i+j],key=lambda x:x[1]) for k in r...
output
1
79,785
23
159,571
Provide a correct Python 3 solution for this coding contest problem. We have N points in a two-dimensional plane. The coordinates of the i-th point (1 \leq i \leq N) are (x_i,y_i). Let us consider a rectangle whose sides are parallel to the coordinate axes that contains K or more of the N points in its interior. Here,...
instruction
0
79,786
23
159,572
"Correct Solution: ``` import sys def LI(): return [int(x) for x in sys.stdin.readline().split()] N,K = LI() p = [] for i in range(N): a,b = LI() p.append((a,b)) sx = sorted(p) ans = 10**50 for x,y in sx: for x2,y2 in sx: if x2 <= x: continue points = sx.index((x2,y2)) - sx.ind...
output
1
79,786
23
159,573
Provide a correct Python 3 solution for this coding contest problem. We have N points in a two-dimensional plane. The coordinates of the i-th point (1 \leq i \leq N) are (x_i,y_i). Let us consider a rectangle whose sides are parallel to the coordinate axes that contains K or more of the N points in its interior. Here,...
instruction
0
79,787
23
159,574
"Correct Solution: ``` N,K=map(int,input().split()) p = sorted([[int(_) for _ in input().split()] for i in range(N)]) a=10**20 for xi in range(N-K+1): for xj in range(xi+K-1,N): q = sorted(y for x,y in p[xi:xj+1]) for yi in range(xj-(xi+K-1)+1): yj = yi+K-1 #Is the number always K? if q[yi]<=p[xi]...
output
1
79,787
23
159,575
Provide a correct Python 3 solution for this coding contest problem. We have N points in a two-dimensional plane. The coordinates of the i-th point (1 \leq i \leq N) are (x_i,y_i). Let us consider a rectangle whose sides are parallel to the coordinate axes that contains K or more of the N points in its interior. Here,...
instruction
0
79,788
23
159,576
"Correct Solution: ``` n, k = map(int, input().split()) p = sorted([tuple(map(int, input().split())) for i in range(n)]) ans = 4 * 10**18 for i in range(k, n + 1): for j in range(n - i + 1): # x座標に関して j から i + j まで含む x = p[i + j - 1][0] - p[j][0] s = sorted([p[a][1] for a in range(j, i + j)]) ...
output
1
79,788
23
159,577
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. We have N points in a two-dimensional plane. The coordinates of the i-th point (1 \leq i \leq N) are (x_i,y_i). Let us consider a rectangle whose sides are parallel to the coordinate axes that c...
instruction
0
79,789
23
159,578
Yes
output
1
79,789
23
159,579
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. We have N points in a two-dimensional plane. The coordinates of the i-th point (1 \leq i \leq N) are (x_i,y_i). Let us consider a rectangle whose sides are parallel to the coordinate axes that c...
instruction
0
79,790
23
159,580
Yes
output
1
79,790
23
159,581
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. We have N points in a two-dimensional plane. The coordinates of the i-th point (1 \leq i \leq N) are (x_i,y_i). Let us consider a rectangle whose sides are parallel to the coordinate axes that c...
instruction
0
79,791
23
159,582
Yes
output
1
79,791
23
159,583
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. We have N points in a two-dimensional plane. The coordinates of the i-th point (1 \leq i \leq N) are (x_i,y_i). Let us consider a rectangle whose sides are parallel to the coordinate axes that c...
instruction
0
79,792
23
159,584
Yes
output
1
79,792
23
159,585
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. We have N points in a two-dimensional plane. The coordinates of the i-th point (1 \leq i \leq N) are (x_i,y_i). Let us consider a rectangle whose sides are parallel to the coordinate axes that c...
instruction
0
79,793
23
159,586
No
output
1
79,793
23
159,587
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. We have N points in a two-dimensional plane. The coordinates of the i-th point (1 \leq i \leq N) are (x_i,y_i). Let us consider a rectangle whose sides are parallel to the coordinate axes that c...
instruction
0
79,794
23
159,588
No
output
1
79,794
23
159,589
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. We have N points in a two-dimensional plane. The coordinates of the i-th point (1 \leq i \leq N) are (x_i,y_i). Let us consider a rectangle whose sides are parallel to the coordinate axes that c...
instruction
0
79,795
23
159,590
No
output
1
79,795
23
159,591
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. We have N points in a two-dimensional plane. The coordinates of the i-th point (1 \leq i \leq N) are (x_i,y_i). Let us consider a rectangle whose sides are parallel to the coordinate axes that c...
instruction
0
79,796
23
159,592
No
output
1
79,796
23
159,593
Provide a correct Python 3 solution for this coding contest problem. Create a program that rotates the pattern of 8 characters x 8 lines clockwise by 90 degrees, 180 degrees, and 270 degrees and outputs it. Input A pattern consisting of 8 characters x 8 lines is given. Characters consist of alphanumeric characters...
instruction
0
79,835
23
159,670
"Correct Solution: ``` #写経させていただきました。 def spin(p): ret = [[None] * 8 for _ in range(8)] for i in range(8): for j in range(8): ret[i][j] = p[7 - j][i] return ret def print_p(p): for line in p: print("".join(line)) p = [input() for _ in range(8)] print(90) p = spin(p) print_...
output
1
79,835
23
159,671
Provide a correct Python 3 solution for this coding contest problem. Create a program that rotates the pattern of 8 characters x 8 lines clockwise by 90 degrees, 180 degrees, and 270 degrees and outputs it. Input A pattern consisting of 8 characters x 8 lines is given. Characters consist of alphanumeric characters...
instruction
0
79,836
23
159,672
"Correct Solution: ``` def spin(pazzule): pzl = [["" for i in range(8)] for j in range(8)] for i in range(8): for j in range(8): pzl[i][j] = pazzule[7-j][i] return pzl pazzule = [list(input()) for i in range(8)] pazzule = spin(pazzule) print("90") for i in range(8): print("".joi...
output
1
79,836
23
159,673
Provide a correct Python 3 solution for this coding contest problem. Create a program that rotates the pattern of 8 characters x 8 lines clockwise by 90 degrees, 180 degrees, and 270 degrees and outputs it. Input A pattern consisting of 8 characters x 8 lines is given. Characters consist of alphanumeric characters...
instruction
0
79,837
23
159,674
"Correct Solution: ``` mat = [] for _ in range(8): mat.append(list(input())) mat90 = [[0 for i in range(8)] for j in range(8)] print(90) for i in range(8): for j in range(8): mat90[i][j] = mat[7-j][i] for i in range(8): print(''.join(m for m in mat90[i])) mat180 = [[0 for i in range(8)] for j in ...
output
1
79,837
23
159,675
Provide a correct Python 3 solution for this coding contest problem. Create a program that rotates the pattern of 8 characters x 8 lines clockwise by 90 degrees, 180 degrees, and 270 degrees and outputs it. Input A pattern consisting of 8 characters x 8 lines is given. Characters consist of alphanumeric characters...
instruction
0
79,838
23
159,676
"Correct Solution: ``` # AOJ 0133 Rotation of a Pattern # Python3 2018.6.19 bal4u a = [[[0 for c in range(8)] for r in range(8)] for k in range(4)] title = ["0", "90", "180", "270"] for r in range(8): a[0][r] = list(input()) for k in range(1, 4): print(title[k]) for r in range(8): for c in range(8): a[k][c][7...
output
1
79,838
23
159,677