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
stringlengths
1
5
memory
stringlengths
1
7
code_size
stringlengths
1
6
code
stringlengths
1
539k
s776140926
p02385
u150984829
1513329617
Python
Python3
py
Runtime Error
20
5608
337
d,e=[list(map(int,input().split()))for _ in range(2)] m={0:'1234',1:'5230',2:'1504',3:'1054',4:'0235',5:'1324'}[d.index(e[0])] f=[str(e[i])for i in range(1,5)]+[str(e[1])] f[2],f[3]=f[3],f[2] g=[str(d[int(i)])for i in m] g[2],g[3]=g[3],g[2] g+=g for i in range(4): if g[g.index(f[i])+1]!=f[i+1]:print('No');break elif i==3:print('Yes')
s732972443
p02385
u150984829
1513329715
Python
Python3
py
Runtime Error
20
5608
376
d,e=[list(map(int,input().split()))for _ in range(2)] m={0:'1234',1:'5230',2:'1504',3:'1054',4:'0235',5:'1324'}[d.index(e[0])] #f=[str(e[i])for i in range(1,5)]+[str(e[1])] f=[str(e[i])for i in range(1,5)] f+=f f[2],f[3]=f[3],f[2] g=[str(d[int(i)])for i in m] g[2],g[3]=g[3],g[2] g+=g for i in range(4): if g[g.index(f[i])+1]!=f[i+1]:print('No');break elif i==3:print('Yes')
s035130637
p02385
u150984829
1513350662
Python
Python3
py
Runtime Error
0
0
318
d,e=[list(map(int,input().split()))for _ in range(2)] e[3],e[4]=e[4],e[3] t=0 for i in range(6): m={0:'012345',1:'152304',2:'215043',3:'310542',4:'402351',5:'513240'}[i] f=[d[int(j)]for j in m];f[3],f[4]=f[4],f[3] if f[0]==e[0]: for j in range(4): if f[1:5]*2[j:j+4]==e[1:5]:t=1;break print(('No','Yes')[t==1])
s519929578
p02385
u203261375
1514884162
Python
Python3
py
Runtime Error
0
0
1231
import random class Dice(object): def __init__(self): self.t = 1 self.s = 2 self.e = 3 self.w = 4 self.n = 5 self.b = 6 def __init__(self, faces): self.t = faces[0] self.s = faces[1] self.e = faces[2] self.w = faces[3] self.n = faces[4] self.b = faces[5] def roll(self, direct): if direct == 0: self.t, self.s, self.b, self.n = self.n, self.t, self.s, self.b elif direct == 1: self.t, self.w, self.b, self.e = self.e, self.t, self.w, self.b elif direct == 2: self.n, self.w, self.s, self.e = self.w, self.s, self.e, self.n def is_equal(dice): if self.t == dice.t and self.s == dice.s and self.e == dice.e and self.w == dice.w and self.n == dice.n and self.b == dice.b: return True else: return False faces1 = list(map(int, input().split())) dice1 = Dice(faces1) faces2 = list(map(int, input().split())) dice2 = Dice(faces2) flag = False for i in range(10000): dice2.roll(random.randint(0, 3)) if dice1.is_equal(dice2): flag = True break if flag: print('Yes') else: print('No')
s049289650
p02385
u150984829
1516372706
Python
Python3
py
Runtime Error
20
5608
338
d,e=[list(map(int,input().split()))for _ in range(2)] m={0:'1234',1:'5230',2:'1504',3:'1054',4:'0235',5:'1324'}[d.index(e[0])] f=[str(e[i])for i in range(1,5)]+[str(e[1])] f[2],f[3]=f[3],f[2] g=[str(d[int(i)])for i in m] g[2],g[3]=g[3],g[2] g+=g for i in range(4): if g[g.index(f[i])+1]!=f[i+1]:print('No');break elif i==3:print('Yes')
s810533509
p02385
u566311709
1522417679
Python
Python3
py
Runtime Error
20
5564
312
d = input().split() a = input().split() p = [(-1, 2, 4, 1, 3, -1), (3, -1, 0, 5, -1, 2), (1, 5, -1, -1, 0, 4), (4, 0, -1, -1, 5, 1), (2, -1, 5, 0, -1, 3), (-1, 3, 1, 4, 2, -1)] t, f = d.index(a[0]), d.index(a[1]) r = p[t][f] l = [d[t], d[f], d[r], d[5-r], d[5-f], d[5-t]] print("Yes") if a == l else print("No")
s164506660
p02385
u566311709
1522464331
Python
Python3
py
Runtime Error
20
5580
464
d = input().split() a = input().split() p = [(-1, 2, 4, 1, 3, -1), (3, -1, 0, 5, -1, 2), (1, 5, -1, -1, 0, 4), (4, 0, -1, -1, 5, 1), (2, -1, 5, 0, -1, 3), (-1, 3, 1, 4, 2, -1)] ts = [i for i, x in enumerate(d) if x == a[0]] fs = [i for i, x in enumerate(d) if x == a[1]] b = 0 for t in ts: for f in fs: if t == f: continue r = p[t][f] l = [d[t], d[f], d[r], d[5-r], d[5-f], d[5-t]] if a == l: b += 1; break print("Yes") if b > 0 else print("No")
s667357454
p02385
u777277984
1528081697
Python
Python3
py
Runtime Error
20
5832
3536
class Dice: def __init__(self): self.side = {"top": 0, "front": 0, "right": 0, "left": 0, "back": 0, "bottom": 0} # サイコロを東西南北、どちらか一方に転がした時、それぞれの面の変化 def roll(self, direction): self.direction = direction if self.direction == "N": w = self.side["top"] self.side["top"] = self.side["front"] self.side["front"] = self.side["bottom"] self.side["bottom"] = self.side["back"] self.side["back"] = w elif self.direction == "S": w = self.side["top"] self.side["top"] = self.side["back"] self.side["back"] = self.side["bottom"] self.side["bottom"] = self.side["front"] self.side["front"] = w elif self.direction == "E": w = self.side["top"] self.side["top"] = self.side["left"] self.side["left"] = self.side["bottom"] self.side["bottom"] = self.side["right"] self.side["right"] = w elif self.direction == "W": w = self.side["top"] self.side["top"] = self.side["right"] self.side["right"] = self.side["bottom"] self.side["bottom"] = self.side["left"] self.side["left"] = w # サイコロの面の位置関係 def position_relation(self, top, front): # 右面が"right"の場合 if top == "top" and front == "front"\ or top == "front" and front == "bottom"\ or top == "bottom" and front == "back"\ or top == "back" and front == "top": self.right = self.side["right"] # 右面が"left"の場合 if top == "top" and front == "back"\ or top == "back" and front == "bottom"\ or top == "bottom" and front == "front"\ or top == "front" and front == "top": self.right = self.side["left"] # 右面が"back"の場合 if top == "top" and front == "right"\ or top == "right" and front == "bottom"\ or top == "bottom" and front == "left"\ or top == "left" and front == "top": self.right = self.side["back"] # 右面が"front"の場合 if top == "top" and front == "left"\ or top == "left" and front == "bottom"\ or top == "bottom" and front == "right"\ or top == "right" and front == "top": self.right = self.side["front"] # 右面が"top"の場合 if top == "front" and front == "right"\ or top == "right" and front == "back"\ or top == "back" and front == "left"\ or top == "left" and front == "front": self.right = self.side["top"] # 右面が"bottom"の場合 if top == "front" and front == "left"\ or top == "left" and front == "back"\ or top == "back" and front == "right"\ or top == "right" and front == "front": self.right = self.side["bottom"] # 1つ目のサイコロの初期化 dice = Dice() for s, n in zip(dice.side, input().split()): dice.side[s] = int(n) # 1つ目のサイコロの"top","front"の面が2つ目のサイコロのどの面に移ったか調べ、位置関係から右面の値を求める。 a = [int(i) for i in input().split()] for k, v in dice.side.items(): if a[0] == v: top = k if a[1] == v: front = k dice.position_relation(top, front) if dice.right == a[2]: print("Yes") else: print("No")
s808949208
p02385
u777277984
1528081779
Python
Python3
py
Runtime Error
30
5824
3536
class Dice: def __init__(self): self.side = {"top": 0, "front": 0, "right": 0, "left": 0, "back": 0, "bottom": 0} # サイコロを東西南北、どちらか一方に転がした時、それぞれの面の変化 def roll(self, direction): self.direction = direction if self.direction == "N": w = self.side["top"] self.side["top"] = self.side["front"] self.side["front"] = self.side["bottom"] self.side["bottom"] = self.side["back"] self.side["back"] = w elif self.direction == "S": w = self.side["top"] self.side["top"] = self.side["back"] self.side["back"] = self.side["bottom"] self.side["bottom"] = self.side["front"] self.side["front"] = w elif self.direction == "E": w = self.side["top"] self.side["top"] = self.side["left"] self.side["left"] = self.side["bottom"] self.side["bottom"] = self.side["right"] self.side["right"] = w elif self.direction == "W": w = self.side["top"] self.side["top"] = self.side["right"] self.side["right"] = self.side["bottom"] self.side["bottom"] = self.side["left"] self.side["left"] = w # サイコロの面の位置関係 def position_relation(self, top, front): # 右面が"right"の場合 if top == "top" and front == "front"\ or top == "front" and front == "bottom"\ or top == "bottom" and front == "back"\ or top == "back" and front == "top": self.right = self.side["right"] # 右面が"left"の場合 if top == "top" and front == "back"\ or top == "back" and front == "bottom"\ or top == "bottom" and front == "front"\ or top == "front" and front == "top": self.right = self.side["left"] # 右面が"back"の場合 if top == "top" and front == "right"\ or top == "right" and front == "bottom"\ or top == "bottom" and front == "left"\ or top == "left" and front == "top": self.right = self.side["back"] # 右面が"front"の場合 if top == "top" and front == "left"\ or top == "left" and front == "bottom"\ or top == "bottom" and front == "right"\ or top == "right" and front == "top": self.right = self.side["front"] # 右面が"top"の場合 if top == "front" and front == "right"\ or top == "right" and front == "back"\ or top == "back" and front == "left"\ or top == "left" and front == "front": self.right = self.side["top"] # 右面が"bottom"の場合 if top == "front" and front == "left"\ or top == "left" and front == "back"\ or top == "back" and front == "right"\ or top == "right" and front == "front": self.right = self.side["bottom"] # 1つ目のサイコロの初期化 dice = Dice() for s, n in zip(dice.side, input().split()): dice.side[s] = int(n) # 1つ目のサイコロの"top","front"の面が2つ目のサイコロのどの面に移ったか調べ、位置関係から右面の値を求める。 a = [int(i) for i in input().split()] for k, v in dice.side.items(): if a[0] == v: top = k if a[1] == v: front = k dice.position_relation(top, front) if dice.right == a[2]: print("Yes") else: print("No")
s617317717
p02385
u777277984
1528081796
Python
Python3
py
Runtime Error
20
5832
3536
class Dice: def __init__(self): self.side = {"top": 0, "front": 0, "right": 0, "left": 0, "back": 0, "bottom": 0} # サイコロを東西南北、どちらか一方に転がした時、それぞれの面の変化 def roll(self, direction): self.direction = direction if self.direction == "N": w = self.side["top"] self.side["top"] = self.side["front"] self.side["front"] = self.side["bottom"] self.side["bottom"] = self.side["back"] self.side["back"] = w elif self.direction == "S": w = self.side["top"] self.side["top"] = self.side["back"] self.side["back"] = self.side["bottom"] self.side["bottom"] = self.side["front"] self.side["front"] = w elif self.direction == "E": w = self.side["top"] self.side["top"] = self.side["left"] self.side["left"] = self.side["bottom"] self.side["bottom"] = self.side["right"] self.side["right"] = w elif self.direction == "W": w = self.side["top"] self.side["top"] = self.side["right"] self.side["right"] = self.side["bottom"] self.side["bottom"] = self.side["left"] self.side["left"] = w # サイコロの面の位置関係 def position_relation(self, top, front): # 右面が"right"の場合 if top == "top" and front == "front"\ or top == "front" and front == "bottom"\ or top == "bottom" and front == "back"\ or top == "back" and front == "top": self.right = self.side["right"] # 右面が"left"の場合 if top == "top" and front == "back"\ or top == "back" and front == "bottom"\ or top == "bottom" and front == "front"\ or top == "front" and front == "top": self.right = self.side["left"] # 右面が"back"の場合 if top == "top" and front == "right"\ or top == "right" and front == "bottom"\ or top == "bottom" and front == "left"\ or top == "left" and front == "top": self.right = self.side["back"] # 右面が"front"の場合 if top == "top" and front == "left"\ or top == "left" and front == "bottom"\ or top == "bottom" and front == "right"\ or top == "right" and front == "top": self.right = self.side["front"] # 右面が"top"の場合 if top == "front" and front == "right"\ or top == "right" and front == "back"\ or top == "back" and front == "left"\ or top == "left" and front == "front": self.right = self.side["top"] # 右面が"bottom"の場合 if top == "front" and front == "left"\ or top == "left" and front == "back"\ or top == "back" and front == "right"\ or top == "right" and front == "front": self.right = self.side["bottom"] # 1つ目のサイコロの初期化 dice = Dice() for s, n in zip(dice.side, input().split()): dice.side[s] = int(n) # 1つ目のサイコロの"top","front"の面が2つ目のサイコロのどの面に移ったか調べ、位置関係から右面の値を求める。 a = [int(i) for i in input().split()] for k, v in dice.side.items(): if a[0] == v: top = k if a[1] == v: front = k dice.position_relation(top, front) if dice.right == a[2]: print("Yes") else: print("No")
s127691042
p02385
u918276501
1528712060
Python
Python3
py
Runtime Error
20
5608
717
set_first = [ [1,2,3,4,5,6], [5,1,3,4,6,2], [4,2,1,6,5,3], [3,2,6,1,5,4], [2,6,3,4,1,5], [6,5,3,4,2,1]] set_rotate = [ ['dummy'], [1,2,3,4,5,6], [1,4,2,5,3,6], [1,3,5,2,4,6], [1,5,4,3,2,6]] rotate = lambda dice, order: [dice[order[i]-1] for i in range(6)] def set_dice(dice): i = dice.index(1) ret = rotate(dice, set_first[i]) j = ret.index(2) if j == 5: j = ret.index(3) ret = rotate(ret, set_rotate[j]) return ''.join(map(str,ret)) dice_1 = list(map(int, input().split())) dice_1s = set_dice(dice_1) dice_2 = list(map(int, input().split())) dice_2s = set_dice(dice_2) if dice_1s == dice_2s: print('Yes') else: print('No')
s906188111
p02385
u918276501
1528712270
Python
Python3
py
Runtime Error
20
5616
749
set_first = [ [1,2,3,4,5,6], [5,1,3,4,6,2], [4,2,1,6,5,3], [3,2,6,1,5,4], [2,6,3,4,1,5], [6,5,3,4,2,1]] set_rotate = [ ['dummy'], [1,2,3,4,5,6], [1,4,2,5,3,6], [1,3,5,2,4,6], [1,5,4,3,2,6]] rotate = lambda dice, order: [dice[order[i]-1] for i in range(6)] def set_dice(dice): i = dice.index(min(dice)) ret = rotate(dice, set_first[i]) j = ret.index(min(ret[1:])) if j == 5: j = ret.index(min(ret[1:5])) ret = rotate(ret, set_rotate[j]) return '-'.join(map(str,ret)) dice_1 = list(map(int, input().split())) dice_1s = set_dice(dice_1) dice_2 = list(map(int, input().split())) dice_2s = set_dice(dice_2) if dice_1s == dice_2s: print('Yes') else: print('No')
s889746854
p02386
u869301406
1530965546
Python
Python3
py
Runtime Error
0
0
2158
class Dice(object): def __init__(self, d): self.rows = [d[0], d[4], d[5], d[1]] self.cols = [d[0], d[2], d[5], d[3]] def move_next_rows(self): temp = self.rows.pop(0) self.rows.append(temp) self.__update(self.cols, self.rows) def move_prev_rows(self): temp = self.rows.pop(3) self.rows.insert(0, temp) self.__update(self.cols, self.rows) def move_next_cols(self): temp = self.cols.pop(0) self.cols.append(temp) self.__update(self.rows, self.cols) def move_prev_cols(self): temp = self.cols.pop(3) self.cols.insert(0, temp) self.__update(self.rows, self.cols) def __update(self, x, y): x[0] = y[0] x[2] = y[2] class DiceChecker(object): def __init__(self, dice1, dice2): self.dice1 = dice1 self.dice2 = dice2 self.dice1_top = self.dice1.rows[0] self.dice1_front = self.dice1.rows[3] def check_same_dice(self): is_same = False for _ in range(4): for _ in range(4): for _ in range(4): is_same_element = self.dice1.rows == self.dice2.rows and self.dice1.cols == self.dice2.cols if is_same_element: is_same = True self.__rot(self.dice2) self.dice2.move_next_rows() self.dice2.move_next_cols() if is_same: return False else: return True def __rot(self, dice): temp = dice.rows[1] dice.rows[1] = dice.cols[3] dice.cols[3] = dice.rows[3] dice.rows[3] = dice.cols[1] dice.cols[1] = temp j = int(input()) dice_list = [] src = [] for _ in range(j): d = list(map(int, input().split(" "))) dice_list.append(Dice(d)) src.append(d) is_diff = False for dice1 in dice_list: src.pop(0) for dice in src: dice_checker = DiceChecker(dice1, dice) if(dice_checker.check_same_dice()): is_diff = True if is_diff: print("Yes") else: print("No")
s550465001
p02386
u869301406
1530965662
Python
Python3
py
Runtime Error
0
0
2163
class Dice(object): def __init__(self, d): self.rows = [d[0], d[4], d[5], d[1]] self.cols = [d[0], d[2], d[5], d[3]] def move_next_rows(self): temp = self.rows.pop(0) self.rows.append(temp) self.__update(self.cols, self.rows) def move_prev_rows(self): temp = self.rows.pop(3) self.rows.insert(0, temp) self.__update(self.cols, self.rows) def move_next_cols(self): temp = self.cols.pop(0) self.cols.append(temp) self.__update(self.rows, self.cols) def move_prev_cols(self): temp = self.cols.pop(3) self.cols.insert(0, temp) self.__update(self.rows, self.cols) def __update(self, x, y): x[0] = y[0] x[2] = y[2] class DiceChecker(object): def __init__(self, dice1, dice2): self.dice1 = dice1 self.dice2 = dice2 self.dice1_top = self.dice1.rows[0] self.dice1_front = self.dice1.rows[3] def check_same_dice(self): is_same = False for _ in range(4): for _ in range(4): for _ in range(4): is_same_element = self.dice1.rows == self.dice2.rows and self.dice1.cols == self.dice2.cols if is_same_element: is_same = True self.__rot(self.dice2) self.dice2.move_next_rows() self.dice2.move_next_cols() if is_same: return False else: return True def __rot(self, dice): temp = dice.rows[1] dice.rows[1] = dice.cols[3] dice.cols[3] = dice.rows[3] dice.rows[3] = dice.cols[1] dice.cols[1] = temp j = int(input()) dice_list = [] src = [] for _ in range(j): d = list(map(int, input().split(" "))) dice_list.append(Dice(d)) src.append(Dice(d) is_diff = False for dice1 in dice_list: src.pop(0) for dice in src: dice_checker = DiceChecker(dice1, dice) if(dice_checker.check_same_dice()): is_diff = True if is_diff: print("Yes") else: print("No")
s138686228
p02386
u662822413
1559051453
Python
Python3
py
Runtime Error
0
0
2413
from enum import Enum import sys import math #0:中央,1:南,2:東,3:西,4:北,5:裏側 class Dice(): def __init__(self): self.number = [i for i in range(6)] self.work = [i for i in range(6)] self.order = 'NNNNWNNNWNNNENNNENNNWNNN' def setNumber(self,n0,n1,n2,n3,n4,n5): self.number[0] = n0 self.number[1] = n1 self.number[2] = n2 self.number[3] = n3 self.number[4] = n4 self.number[5] = n5 def roll(self,loc): for i in range(6): self.work[i] = self.number[i] if loc == 'E': self.setNumber(self.work[3],self.work[1],self.work[0],self.work[5],self.work[4],self.work[2]) elif loc == 'N': self.setNumber(self.work[1],self.work[5],self.work[2],self.work[3],self.work[0],self.work[4]) elif loc == 'S': self.setNumber(self.work[4],self.work[0],self.work[2],self.work[3],self.work[5],self.work[1]) elif loc == 'W': self.setNumber(self.work[2],self.work[1],self.work[5],self.work[0],self.work[4],self.work[3]) def query(self,top_num,front_num): self.save_data = [i for i in range(6)] for i in range(len(self.number)): self.save_data[i] = self.number[i] ret =-1 for i in range(len(self.order)): self.roll(self.order[i]) if self.number[0] == top_num and self.number[1] == front_num: ret = self.number[2] break for i in range(len(self.number)): self.number[i] = self.save_data[i] def equal(self,another): ret = False; for i in range(len(self.order)): self.roll(self.order[i]) FLG=True for k in range(6): if self.number[k] != another.number[k]: FLG = False break if FLG == True: return True return ret; num_dice=int(input()) DICE=[] for i in range(num_dice): table = list(map(int,input().split())) tmp_dice=Dice() tmp_dice.setNumber(table[0],table[1],table[2],table[3],table[4],table[5]) DICE.append(tmp_dice) FLG = True for i in range(num_dice-1): for k in range(i+1,num_dice): if Dice[i].equal(Dice[k])==True: FLG = False break if FLG == True: print("Yes") else: print("No")
s502310336
p02386
u535719732
1559359876
Python
Python3
py
Runtime Error
20
5752
3343
class Dice(): def __init__(self): self.number = [_ for _ in range(6)] self.work = [_ for _ in range(6)] self.order = "NNNNWNNNWNNNENNNENNNWNNN" def setNumber(self,n0,n1,n2,n3,n4,n5): self.number[0] = n0 self.number[1] = n1 self.number[2] = n2 self.number[3] = n3 self.number[4] = n4 self.number[5] = n5 def roll(self,loc): for _ in range(6): self.work[_] = self.number[_] if loc == "E": self.setNumber(self.work[3],self.work[1],self.work[0],self.work[5],self.work[4],self.work[2]) elif loc == "N": self.setNumber(self.work[1],self.work[5],self.work[2],self.work[3],self.work[0],self.work[4]) elif loc == "S": self.setNumber(self.work[4],self.work[0],self.work[2],self.work[3],self.work[5],self.work[1]) elif loc == "W": self.setNumber(self.work[2],self.work[1],self.work[5],self.work[0],self.work[4],self.work[3]) def get_top(self): return self.number[0] def get_right(self,n1,n2): if(n1 == self.number[0]): if(n2 == self.number[1]): return(self.number[2]) elif(n2 == self.number[2]): return(self.number[4]) elif(n2 == self.number[3]): return(self.number[1]) elif(n2 == self.number[4]): return(self.number[3]) elif(n1 == self.number[1]): if(n2 == self.number[0]): return(self.number[3]) elif(n2 == self.number[2]): return(self.number[0]) elif(n2 == self.number[3]): return(self.number[5]) elif(n2 == self.number[5]): return(self.number[2]) elif(n1 == self.number[2]): if(n2 == self.number[0]): return(self.number[1]) elif(n2 == self.number[1]): return(self.number[5]) elif(n2 == self.number[4]): return(self.number[0]) elif(n2 == self.number[5]): return(self.number[4]) elif(n1 == self.number[3]): if(n2 == self.number[0]): return(self.number[4]) elif(n2 == self.number[1]): return(self.number[0]) elif(n2 == self.number[4]): return(self.number[5]) elif(n2 == self.number[5]): return(self.number[1]) elif(n1 == self.number[4]): if(n2 == self.number[0]): return(self.number[2]) elif(n2 == self.number[2]): return(self.number[5]) elif(n2 == self.number[3]): return(self.number[0]) elif(n2 == self.number[5]): return(self.number[3]) elif(n1 == self.number[5]): if(n2 == self.number[1]): return(self.number[3]) elif(n2 == self.number[2]): return(self.number[1]) elif(n2 == self.number[3]): return(self.number[4]) elif(n2 == self.number[4]): return(self.number[2]) def equals(self,another): ret = False for i in range(len(self.order)): self.roll(self.order[i]) flg = True for k in range(6): if self.number[k] != another.number[k]: flg = False break if flg == True: return True return ret n = int(input()) dice = [] for _ in range(n): data = list(map(int,input().split())) dice.append(Dice()) dice[_].setNumber(data[0],data[1],data[2],data[3],data[4],data[5]) if(dice[0].equals(dice[1]) == dice[0].equals(dice[2])): print("Yes") else: print("No")
s531918520
p02386
u535719732
1559360824
Python
Python3
py
Runtime Error
0
0
3397
class Dice(): def __init__(self): self.number = [_ for _ in range(6)] self.work = [_ for _ in range(6)] self.order = "NNNNWNNNWNNNENNNENNNWNNN" def setNumber(self,n0,n1,n2,n3,n4,n5): self.number[0] = n0 self.number[1] = n1 self.number[2] = n2 self.number[3] = n3 self.number[4] = n4 self.number[5] = n5 def roll(self,loc): for _ in range(6): self.work[_] = self.number[_] if loc == "E": self.setNumber(self.work[3],self.work[1],self.work[0],self.work[5],self.work[4],self.work[2]) elif loc == "N": self.setNumber(self.work[1],self.work[5],self.work[2],self.work[3],self.work[0],self.work[4]) elif loc == "S": self.setNumber(self.work[4],self.work[0],self.work[2],self.work[3],self.work[5],self.work[1]) elif loc == "W": self.setNumber(self.work[2],self.work[1],self.work[5],self.work[0],self.work[4],self.work[3]) def get_top(self): return self.number[0] def get_right(self,n1,n2): if(n1 == self.number[0]): if(n2 == self.number[1]): return(self.number[2]) elif(n2 == self.number[2]): return(self.number[4]) elif(n2 == self.number[3]): return(self.number[1]) elif(n2 == self.number[4]): return(self.number[3]) elif(n1 == self.number[1]): if(n2 == self.number[0]): return(self.number[3]) elif(n2 == self.number[2]): return(self.number[0]) elif(n2 == self.number[3]): return(self.number[5]) elif(n2 == self.number[5]): return(self.number[2]) elif(n1 == self.number[2]): if(n2 == self.number[0]): return(self.number[1]) elif(n2 == self.number[1]): return(self.number[5]) elif(n2 == self.number[4]): return(self.number[0]) elif(n2 == self.number[5]): return(self.number[4]) elif(n1 == self.number[3]): if(n2 == self.number[0]): return(self.number[4]) elif(n2 == self.number[1]): return(self.number[0]) elif(n2 == self.number[4]): return(self.number[5]) elif(n2 == self.number[5]): return(self.number[1]) elif(n1 == self.number[4]): if(n2 == self.number[0]): return(self.number[2]) elif(n2 == self.number[2]): return(self.number[5]) elif(n2 == self.number[3]): return(self.number[0]) elif(n2 == self.number[5]): return(self.number[3]) elif(n1 == self.number[5]): if(n2 == self.number[1]): return(self.number[3]) elif(n2 == self.number[2]): return(self.number[1]) elif(n2 == self.number[3]): return(self.number[4]) elif(n2 == self.number[4]): return(self.number[2]) def equals(self,another): ret = False for i in range(len(self.order)): self.roll(self.order[i]) flg = True for k in range(6): if self.number[k] != another.number[k]: flg = False break if flg == True: return True return ret n = int(input()) dice = [] for _ in range(n): data = list(map(int,input().split())) dice.append(Dice()) dice[_].setNumber(data[0],data[1],data[2],data[3],data[4],data[5]) flag = True for _ in range(n-1): for i in range(i+1,n): if(dice[_].equals(dice[_+1])): flag = False break print("Yes" if flag else "No")
s402005249
p02386
u535719732
1559360858
Python
Python3
py
Runtime Error
0
0
3407
class Dice(): def __init__(self): self.number = [_ for _ in range(6)] self.work = [_ for _ in range(6)] self.order = "NNNNWNNNWNNNENNNENNNWNNN" def setNumber(self,n0,n1,n2,n3,n4,n5): self.number[0] = n0 self.number[1] = n1 self.number[2] = n2 self.number[3] = n3 self.number[4] = n4 self.number[5] = n5 def roll(self,loc): for _ in range(6): self.work[_] = self.number[_] if loc == "E": self.setNumber(self.work[3],self.work[1],self.work[0],self.work[5],self.work[4],self.work[2]) elif loc == "N": self.setNumber(self.work[1],self.work[5],self.work[2],self.work[3],self.work[0],self.work[4]) elif loc == "S": self.setNumber(self.work[4],self.work[0],self.work[2],self.work[3],self.work[5],self.work[1]) elif loc == "W": self.setNumber(self.work[2],self.work[1],self.work[5],self.work[0],self.work[4],self.work[3]) def get_top(self): return self.number[0] def get_right(self,n1,n2): if(n1 == self.number[0]): if(n2 == self.number[1]): return(self.number[2]) elif(n2 == self.number[2]): return(self.number[4]) elif(n2 == self.number[3]): return(self.number[1]) elif(n2 == self.number[4]): return(self.number[3]) elif(n1 == self.number[1]): if(n2 == self.number[0]): return(self.number[3]) elif(n2 == self.number[2]): return(self.number[0]) elif(n2 == self.number[3]): return(self.number[5]) elif(n2 == self.number[5]): return(self.number[2]) elif(n1 == self.number[2]): if(n2 == self.number[0]): return(self.number[1]) elif(n2 == self.number[1]): return(self.number[5]) elif(n2 == self.number[4]): return(self.number[0]) elif(n2 == self.number[5]): return(self.number[4]) elif(n1 == self.number[3]): if(n2 == self.number[0]): return(self.number[4]) elif(n2 == self.number[1]): return(self.number[0]) elif(n2 == self.number[4]): return(self.number[5]) elif(n2 == self.number[5]): return(self.number[1]) elif(n1 == self.number[4]): if(n2 == self.number[0]): return(self.number[2]) elif(n2 == self.number[2]): return(self.number[5]) elif(n2 == self.number[3]): return(self.number[0]) elif(n2 == self.number[5]): return(self.number[3]) elif(n1 == self.number[5]): if(n2 == self.number[1]): return(self.number[3]) elif(n2 == self.number[2]): return(self.number[1]) elif(n2 == self.number[3]): return(self.number[4]) elif(n2 == self.number[4]): return(self.number[2]) def equals(self,another): ret = False for i in range(len(self.order)): self.roll(self.order[i]) flg = True for k in range(6): if self.number[k] != another.number[k]: flg = False break if flg == True: return True return ret n = int(input()) dice = [] for _ in range(n): data = list(map(int,input().split())) dice.append(Dice()) dice[_].setNumber(data[0],data[1],data[2],data[3],data[4],data[5]) flag = True for _ in range(n-1): for i in range(i+1,n): if(dice[_].equals(dice[i])): flag = False break print("Yes" if flag else "No")
s616746444
p02386
u535719732
1559360893
Python
Python3
py
Runtime Error
0
0
3398
class Dice(): def __init__(self): self.number = [_ for _ in range(6)] self.work = [_ for _ in range(6)] self.order = "NNNNWNNNWNNNENNNENNNWNNN" def setNumber(self,n0,n1,n2,n3,n4,n5): self.number[0] = n0 self.number[1] = n1 self.number[2] = n2 self.number[3] = n3 self.number[4] = n4 self.number[5] = n5 def roll(self,loc): for _ in range(6): self.work[_] = self.number[_] if loc == "E": self.setNumber(self.work[3],self.work[1],self.work[0],self.work[5],self.work[4],self.work[2]) elif loc == "N": self.setNumber(self.work[1],self.work[5],self.work[2],self.work[3],self.work[0],self.work[4]) elif loc == "S": self.setNumber(self.work[4],self.work[0],self.work[2],self.work[3],self.work[5],self.work[1]) elif loc == "W": self.setNumber(self.work[2],self.work[1],self.work[5],self.work[0],self.work[4],self.work[3]) def get_top(self): return self.number[0] def get_right(self,n1,n2): if(n1 == self.number[0]): if(n2 == self.number[1]): return(self.number[2]) elif(n2 == self.number[2]): return(self.number[4]) elif(n2 == self.number[3]): return(self.number[1]) elif(n2 == self.number[4]): return(self.number[3]) elif(n1 == self.number[1]): if(n2 == self.number[0]): return(self.number[3]) elif(n2 == self.number[2]): return(self.number[0]) elif(n2 == self.number[3]): return(self.number[5]) elif(n2 == self.number[5]): return(self.number[2]) elif(n1 == self.number[2]): if(n2 == self.number[0]): return(self.number[1]) elif(n2 == self.number[1]): return(self.number[5]) elif(n2 == self.number[4]): return(self.number[0]) elif(n2 == self.number[5]): return(self.number[4]) elif(n1 == self.number[3]): if(n2 == self.number[0]): return(self.number[4]) elif(n2 == self.number[1]): return(self.number[0]) elif(n2 == self.number[4]): return(self.number[5]) elif(n2 == self.number[5]): return(self.number[1]) elif(n1 == self.number[4]): if(n2 == self.number[0]): return(self.number[2]) elif(n2 == self.number[2]): return(self.number[5]) elif(n2 == self.number[3]): return(self.number[0]) elif(n2 == self.number[5]): return(self.number[3]) elif(n1 == self.number[5]): if(n2 == self.number[1]): return(self.number[3]) elif(n2 == self.number[2]): return(self.number[1]) elif(n2 == self.number[3]): return(self.number[4]) elif(n2 == self.number[4]): return(self.number[2]) def equals(self,another): ret = False for i in range(len(self.order)): self.roll(self.order[i]) flg = True for k in range(6): if self.number[k] != another.number[k]: flg = False break if flg == True: return True return ret n = int(input()) dice = [] for _ in range(n): data = list(map(int,input().split())) dice.append(Dice()) dice[_].setNumber(data[0],data[1],data[2],data[3],data[4],data[5]) flag = True for _ in range(n-1): for i in range(i+1,n): if(dice[_].equals(dice[i])): flag = False break print("Yes" if flag else "No")
s028904696
p02386
u567380442
1421237631
Python
Python3
py
Runtime Error
0
0
891
mask = [[i for i in range(6)], (1, 5, 2, 3, 0, 4), (2, 1, 5, 0, 4,3),(3, 1, 0, 5, 4, 2), (4, 0, 2, 3, 5, 1)] mask += [[mask[1][i] for i in mask[1]]] def set_top(dice, top): return [dice[i] for i in mask[top]] def twist(dice): return [dice[i] for i in (0, 3, 1, 4, 2, 5)] def equal(dice1, dice2): if sorted(dice1) != sorted(dice2): return False for i in range(6): if i:tmp_dice = set_top(dice2, i) for j in range(4): if j:tmp_dice = twist(tmp_dice) if dice1 == tmp_dice: return True return False def diff_check_all(dices, n): for i in range(n -1): for j in range(i + 1, n): if equal(dices[i], dices[j]): return False return True n = int(input()) dices = [input().split() for _ in range(n)] print('Yes' if diff_check_all(dices, n) else 'No')
s791463614
p02386
u813534019
1421339847
Python
Python3
py
Runtime Error
0
0
793
import sys IDX_TBL = {1:[2,3,5,4], 2:[3,1,4,6], 3:[1,2,6,5], 4:[1,5,6,2], 5:[1,3,6,4], 6:[2,4,5,3]} OPPSITE_TBL = {1:6, 2:5, 3:4, 4:3, 5:2, 6:1} def is_same(l1, l2): if l1[1] in l2: idx_list = [i for i,x in enumerate(l2) if x==l1[1]] for idx in idx_list: nstr1 = "".join([l1[i] for i in IDX_TBL[1]]) nstr2 = "".join([l2[i] for i in IDX_TBL[idx]]) if nstr2 in nstr1*2: if l1[6] == l2[7-l2.index(l1[1])]: return True return False n=input() nums_list = [] for _ in range(n): nums_list.append(["_"] + raw_input().split(" ")) for i in range(0, n): for j in range(i+1, n): if is_same(nums_list[i], nums_list[j]): print "No" sys.exit(0) print "Yes"
s050944434
p02386
u571345655
1435344568
Python
Python
py
Runtime Error
20
4580
3629
# coding=utf-8 from itertools import combinations class Dice(object): def __init__(self, list_): self.label = list_ def getLabel(self, i): return self.label[i - 1] def _rotateS(self): self.label = [self.getLabel(i) for i in [5, 1, 3, 4, 6, 2]] def _rotateN(self): self.label = [self.getLabel(i) for i in [2, 6, 3, 4, 1, 5]] def _rotateE(self): self.label = [self.getLabel(i) for i in [4, 2, 1, 6, 5, 3]] def _rotateW(self): self.label = [self.getLabel(i) for i in [3, 2, 6, 1, 5, 4]] def _spinPos(self): self.label = [self.getLabel(i) for i in [1, 4, 2, 5, 3, 6]] def _spinNeg(self): self.label = [self.getLabel(i) for i in [1, 3, 5, 2, 4, 6]] def rotate(self, rotates): for r in rotates: if r == 'S': self._rotateS() elif r == 'N': self._rotateN() elif r == 'E': self._rotateE() elif r == 'W': self._rotateW() elif r == 'T': self._spinPos() elif r == 'B': self._spinNeg() def matchTopFront(self, top, front): try: iTop = self.label.index(top) + 1 topRot = {1: '', 2: 'N', 3: 'W', 4: 'E', 5: 'S', 6: 'SS'} self.rotate(topRot[iTop]) iFront = self.label.index(front) + 1 frontRot = {2: '', 3: 'B', 4: 'T', 5: 'TT'} self.rotate(frontRot[iFront]) return True except KeyError: return False def copy(self): return Dice(self.label[:]) def _equalWithOverlap(self, other): # ?????¢???????????¢?????\????????§6???????????? for rs in ['', 'S', 'N', 'E', 'W', 'SS']: tmp = self.copy() for r in rs: tmp.rotate(r) # ?????¢????????¢????????§?????? top = tmp.getLabel(1) == other.getLabel(1) bottom = tmp.getLabel(6) == other.getLabel(6) # ??´??¢?????????????????????????????????????????¢??????????????????????????´??????????????°?????? # top and bottom ???False??????????????????????????????????????§?????¢??°????????? def _side(): result, n = False, 3 while not result and n > 0: if tmp.label[1:5] == other.label[1:5]: result = True else: tmp.rotate('T') n -= 1 return result if top and bottom and _side(): return True else: return False def __eq__(self, other): # ????????????????????????????????´?????????????????´??? if set(self.label) != set(other.label): return False # ???????????????????????´??? elif len(self.label) == len(set(self.label)): if other.matchTopFront(self.getLabel(1), self.getLabel(2)): return True if self.label == other.label else False else: return False # ???????????????????????´??? else: d1 = Dice(face1) d2 = Dice(face2) return True if d1._equalWithOverlap(d2) else False def main(): n = input() faces = [map(int, raw_input().split()) for _ in xrange(n)] for f1, f2 in combinations(faces, 2): if f1 == f2 or Dice(f1) == Dice(f2): print 'No' break else: print 'Yes' if __name__ == '__main__': main()
s447354027
p02386
u777299405
1435906829
Python
Python3
py
Runtime Error
0
0
1848
class Dice: def __init__(self, faces): self.faces = tuple(faces) def roll_north(self): self.faces = (self.faces[1], self.faces[5], self.faces[2], self.faces[3], self.faces[0], self.faces[4]) def roll_south(self): self.faces = (self.faces[4], self.faces[0], self.faces[2], self.faces[3], self.faces[5], self.faces[1]) def roll_west(self): self.faces = (self.faces[2], self.faces[1], self.faces[5], self.faces[0], self.faces[4], self.faces[3]) def roll_east(self): self.faces = (self.faces[3], self.faces[1], self.faces[0], self.faces[5], self.faces[4], self.faces[2]) def number(self, face_id): return self.faces[face_id - 1] def checksame(self, other_dice): self_opposite_face = dict(zip([self.number(i) for i in range(1, 7)], [self.number(i) for i in range(6, 0, -1)])) other_opposite_face = dict(zip([other_dice.number(i) for i in range(1, 7)], [other_dice.number(i) for i in range(6, 0, -1)])) if self_opposite_face != other_opposite_face: return False if self.number(2) in (other_dice.number(3), other_dice.number(4)): other_dice.roll_west() while self.number(2) != other_dice.number(2): other_dice.roll_north() while self.number(1) != other_dice.number(1): other_dice.roll_west() print(self.faces, other_dice.faces) return self.number(3) == other_dice.number(3) n = int(input()) dice_list = [input().split() for i in range(n)] for i in range(n): for j in range(i + 1, n): if dice_list[i].checksame(dice_list[j]): print("No") exit(0) print("Yes")
s569877184
p02386
u609407244
1436090476
Python
Python3
py
Runtime Error
0
0
618
import itertools def roll(dice, commands): for command in commands: if command == 'N': dice[0], dice[1], dice[5], dice[4] = dice[1], dice[5], dice[4], dice[0] elif command == 'W': dice[0], dice[3], dice[5], dice[2] = dice[2], dice[0], dice[3], dice[5] A = list(map(int, input().split())) B = list(map(int, input().split())) for i in range(4): for j in range(4): for commands in itertools.permutations('N' * i + 'W' * j): a = A[::] roll(a, commands) if B == a: print('Yes') exit() print('No')
s225606840
p02386
u938745275
1440937361
Python
Python
py
Runtime Error
20
10368
4146
import random class Dice: def __init__(self, list = map(str, range(1, 7))): self.top = list[0] self.front = list[1] self.right = list[2] self.left = list[3] self.back = list[4] self.bottom = list[5] self.dic = {} for i in xrange(6): if list[i] in self.dic: self.dic[list[i]] += 1 else: self.dic[list[i]] = 1 def print_all(self): print "top = " + self.top + ", front = " + self.front + ", right = " + self.right + ", left = " + self.left + ", back = " + self.back + ", bottom = " + self.bottom def roll_N(self): temp = self.top self.top = self.front self.front = self.bottom self.bottom = self.back self.back = temp def roll_S(self): temp = self.top self.top = self.back self.back = self.bottom self.bottom = self.front self.front = temp def roll_W(self): temp = self.top self.top = self.right self.right = self.bottom self.bottom = self.left self.left = temp def roll_E(self): temp = self.top self.top = self.left self.left = self.bottom self.bottom = self.right self.right = temp def roll_C(self): temp = self.front self.front = self.right self.right = self.back self.back = self.left self.left = temp def random_roll(self): ram = random.randint(1, 4) if ram == 1: self.roll_E() elif ram == 2: self.roll_N() elif ram == 3: self.roll_S() else: self.roll_W() def getDifference(self, dice): same_list = [] different_list = [] if self.top == dice.top: same_list.append("top") else: different_list.append("top") if self.front == dice.front: same_list.append("front") else: different_list.append("front") if self.left == dice.left: same_list.append("left") else: different_list.append("left") if self.back == dice.back: same_list.append("back") else: different_list.append("back") if self.right == dice.right: same_list.append("right") else: different_list.append("right") if self.bottom == dice.bottom: same_list.append("bottom") else: different_list.append("bottom") result_list = [same_list, different_list] return result_list def getList(self): list = [self.top, self.front, self.right, self.left, self.back, self.bottom] return list def print_dices(): print "first dice: " first_dice.print_all() print "second dice: " second_dice.print_all() print first_dice.dic line = "#######################################" def judgeDices(first_dice, second_dice): flag = False num = 0 debug = 0 while num < 4: # debug += 1 # if debug > 10: # break # print line dic1_keys = first_dice.dic.keys() for i in xrange(len(dic1_keys)): if first_dice.dic[dic1_keys[i]] != second_dice.dic[dic1_keys[i]]: num = 4 break for i in xrange(len(dic1_keys)): if first_dice.dic[dic1_keys[i]] == 6 or first_dice.dic[dic1_keys[i]] == 5: num = 4 flag = True break # print_dices() diferece = first_dice.getDifference(second_dice) # print diferece same_num = len(diferece[0]) if same_num == 6: break elif same_num == 5: num = 4 break if "front" in diferece[0] or "back" in diferece[0]: first_dice.roll_W() num += 1 elif "left" in diferece[0] or "right" in diferece[0]: first_dice.roll_S() num += 1 elif "top" in diferece[0] or "bottom" in diferece[0]: first_dice.roll_C() num += 1 else: first_dice.random_roll() if flag == True: return True elif num == 4: return False else: return True n = int(raw_input()) dices = [] for i in xrange(n): dices.append(Dice(raw_input().split(" "))) result = False for i in xrange(n - 1): for j in xrange(i + 1, n): first_dice = dices[i] second_dice = dices[j] result = judgeDices(first_dice, second_dice) # print result if result: break if result: break if result: print "No" else: print "Yes"
s611880139
p02386
u512342660
1450970196
Python
Python
py
Runtime Error
10
6540
2853
#-*- coding:utf-8 -*- import sys n = input() rolls =[] for x in xrange(n): rolls.append(raw_input().split()) #??????????????¨?????????????????????????????? #?????´????????????????????¨??????????????£???????????§?????? for l1 in xrange(n): for l2 in xrange(n): #?????????????????????????????? #?????????????????????????????´????????????????????????????????????????????£???????????????????????? if l1==l2: break rolls_copy = rolls testpare = (rolls_copy[l1][0],rolls_copy[l1][5]) testparerev = (rolls_copy[l1][5],rolls_copy[l1][0]) rolls2pare = [(rolls_copy[l2][0],rolls_copy[l2][5]),(rolls_copy[l2][2],rolls_copy[l2][3]),(rolls_copy[l2][1],rolls_copy[l2][4])] #??????????????¢????????¢??§?????´??????????????????????????????????¢???? #??¨??¨????????¢?????£????????????????????´???????????¢???3????????¨??????????¢???????????????????????????? if testpare in rolls2pare: pareps = rolls2pare.index(testpare) revflag = False elif testparerev in rolls2pare: pareps = rolls2pare.index(testparerev) revflag = True else: break #?¬???????????????¢??\????????¨????????????????????£??????????¢???? #?????????????????????????????? li1 = [rolls_copy[l1][1],rolls_copy[l1][2],rolls_copy[l1][4],rolls_copy[l1][3]] # print pareps if pareps==0: if revflag: tmp = rolls_copy[l2][2] rolls_copy[l2][2] = rolls_copy[l2][3] rolls_copy[l2][3] = tmp li2 = [rolls_copy[l2][1],rolls_copy[l2][2],rolls_copy[l2][4],rolls_copy[l2][3]] elif pareps==1: if revflag: tmp = rolls_copy[l2][1] rolls_copy[l2][1] = rolls_copy[l2][4] rolls_copy[l2][4] = tmp li2 = [rolls_copy[l2][0],rolls_copy[l2][1],rolls_copy[l2][5],rolls_copy[l2][4]] elif pareps==2: if revflag: tmp = rolls_copy[l2][0] rolls_copy[l2][0] = rolls_copy[l2][5] rolls_copy[l2][5] = tmp li2 = [rolls_copy[l2][0],rolls_copy[l2][3],rolls_copy[l2][5],rolls_copy[l2][2]] else: break #?????????????????´?¢???? # print li1 # print li2 i=0 j=li2.index(li1[0]) matchflag = True#else??\??£???????????´????????? for x in xrange(4): # print "%s : %s"%(li1[i],li2[j]) if li1[i]==li2[j]: j+=1 i+=1 else: matchflag =False break if i>3: i=0 if j>3: j=0 if matchflag: print "No" sys.exit(0) print "Yes"
s565546785
p02386
u797673668
1452322785
Python
Python3
py
Runtime Error
20
7824
850
def cache_dice(d): return dlist.append((d, {v: k for k, v in enumerate(d)})) n, d1 = int(input()), tuple(map(int, input().split())) dlist = [] cache_dice(d1) dms = ((1, 2, 4, 3), (0, 3, 5, 2), (0, 1, 5, 4), (0, 4, 5, 1), (0, 2, 5, 3), (1, 3, 4, 2)) for _ in range(n - 1): d2 = tuple(map(int, input().split())) for (dl, dd) in dlist: if d2[0] not in dd: cache_dice(d2) continue d0 = dd[d2[0]] dm = dms[d0] if dd[d2[1]] not in dm: cache_dice(d2) continue dmi = dm.index(dd[d2[1]]) if d2[2] == d1[dm[(dmi + 1) % 4]] \ and d2[3] == d1[dm[(dmi + 3) % 4]] \ and d2[4] == d1[dm[(dmi + 2) % 4]] \ and d2[5] == d1[5 - d0]: print('No') exit(0) cache_dice(d2) print('Yes')
s212671336
p02386
u569960318
1464753232
Python
Python3
py
Runtime Error
0
0
228
import math a,b,C = map(float,input().split()) C_rad=math.pi*C/180 print("{0:.8f}".format(math.sin(C_rad)*a*b/2)) print("{0:.8f}".format(a+b+math.sqrt(a**2+b**2-2*a*b*math.cos(C_rad)))) print("{0:.8f}".format(b*math.sin(C_rad)))
s672217138
p02386
u998435601
1474098117
Python
Python3
py
Runtime Error
0
0
2307
# coding: utf-8 # ?????????????????¨???????????? class Dice(object): def __init__(self, L=[1, 2, 3, 4, 5, 6]): # ????????¶??? self.dice = (L[1], L[4]), (L[2], L[3]), (L[0], L[5]) # x, y, z self.ax = [[0, False], [1, False], [2, False]] self.axmap = [0, 1, 2] self.mm = {"N": (0, 2), "S": (2, 0), "E": (1, 2), "W": (2, 1), "R": (0, 1), "L": (1, 0)} def rotate(self, dir): def rot(k, r): t = self.axmap[r] self.axmap[k], self.axmap[r] = t, self.axmap[k] self.ax[t][1] = not self.ax[t][1] rot(*self.mm[dir]) def reverse(self, ax): self.ax[ax][1] = not self.ax[ax][1] rev = [(1, 2), (2, 0), (0, 1)][ax] self.axmap[rev[1]], self.axmap[rev[0]] = self.axmap[rev[0]], self.axmap[rev[1]] def front(self): return self.value(0, True) def rear(self): return self.value(0, False) def right(self): return self.value(1, True) def left(self): return self.value(1, False) def top(self): return self.value(2, True) def bottom(self): return self.value(2, False) def value(self, ax, d): a = self.ax[self.axmap[ax]] return self.dice[a[0]][a[1] if d else not a[1]] def __eq__(self, dice): #???????????????????????????????¢?????????? # z???????????§????????????????????´??????????????????????????°?????????????????§NG # ????????\?????????z????????????????????¢??§?????´????????????????????§????????¢??????????????´??????????????°NG # z???????????´????????? idx = -1 for i, ax in enumerate(self.dice): if dice.top() in ax and dice.bottom() in ax: idx = i # i = 0 = x => 0, 2 ????????? # i = 1 = y => 1, 2 ????????? # i = 2 = z => ????????????????????±????????? if i != 2: self.reverse((i+1)%2) break if idx==-1: return False # z(2)?????????????¢???? if self.top()!=dice.top(): self.reverse(2) # x, y???????¢???? for _ in range(4): r = 0 for x in range(2): for b in (True, False): if self.value(x, b)!=dice.value(x, b): break else: r += 1 if r<2: break if r==4: return True else: self.rotate("R") return False if __name__=="__main__": n = input() dices = [Dice(raw_input().split())] for _ in range(1, n): dice = Dice(raw_input().split()) for d in dices: if dice==d: print("No") exit(0) dices.append(dice) print("Yes")
s896740412
p02386
u998435601
1474098155
Python
Python3
py
Runtime Error
0
0
2299
# coding: utf-8 # ?????????????????¨???????????? class Dice(object): def __init__(self, L=[1, 2, 3, 4, 5, 6]): # ????????¶??? self.dice = (L[1], L[4]), (L[2], L[3]), (L[0], L[5]) # x, y, z self.ax = [[0, False], [1, False], [2, False]] self.axmap = [0, 1, 2] self.mm = {"N": (0, 2), "S": (2, 0), "E": (1, 2), "W": (2, 1), "R": (0, 1), "L": (1, 0)} def rotate(self, dir): def rot(k, r): t = self.axmap[r] self.axmap[k], self.axmap[r] = t, self.axmap[k] self.ax[t][1] = not self.ax[t][1] rot(*self.mm[dir]) def reverse(self, ax): self.ax[ax][1] = not self.ax[ax][1] rev = [(1, 2), (2, 0), (0, 1)][ax] self.axmap[rev[1]], self.axmap[rev[0]] = self.axmap[rev[0]], self.axmap[rev[1]] def front(self): return self.value(0, True) def rear(self): return self.value(0, False) def right(self): return self.value(1, True) def left(self): return self.value(1, False) def top(self): return self.value(2, True) def bottom(self): return self.value(2, False) def value(self, ax, d): a = self.ax[self.axmap[ax]] return self.dice[a[0]][a[1] if d else not a[1]] def __eq__(self, dice): #???????????????????????????????¢?????????? # z???????????§????????????????????´??????????????????????????°?????????????????§NG # ????????\?????????z????????????????????¢??§?????´????????????????????§????????¢??????????????´??????????????°NG # z???????????´????????? idx = -1 for i, ax in enumerate(self.dice): if dice.top() in ax and dice.bottom() in ax: idx = i # i = 0 = x => 0, 2 ????????? # i = 1 = y => 1, 2 ????????? # i = 2 = z => ????????????????????±????????? if i != 2: self.reverse((i+1)%2) break if idx==-1: return False # z(2)?????????????¢???? if self.top()!=dice.top(): self.reverse(2) # x, y???????¢???? for _ in range(4): r = 0 for x in range(2): for b in (True, False): if self.value(x, b)!=dice.value(x, b): break else: r += 1 if r<2: break if r==4: return True else: self.rotate("R") return False if __name__=="__main__": n = input() dices = [Dice(input().split())] for _ in range(1, n): dice = Dice(input().split()) for d in dices: if dice==d: print("No") exit(0) dices.append(dice) print("Yes")
s471187332
p02386
u998435601
1474098460
Python
Python3
py
Runtime Error
0
0
2306
# coding: utf-8 class Dice(object): def __init__(self, L=[1, 2, 3, 4, 5, 6]): # ????????¶??? self.dice = (L[1], L[4]), (L[2], L[3]), (L[0], L[5]) # x, y, z self.ax = [[0, False], [1, False], [2, False]] self.axmap = [0, 1, 2] self.mm = {"N": (0, 2), "S": (2, 0), "E": (1, 2), "W": (2, 1), "R": (0, 1), "L": (1, 0)} def rotate(self, dir): def rot(k, r): t = self.axmap[r] self.axmap[k], self.axmap[r] = t, self.axmap[k] self.ax[t][1] = not self.ax[t][1] rot(*self.mm[dir]) def reverse(self, ax): self.ax[ax][1] = not self.ax[ax][1] rev = [(1, 2), (2, 0), (0, 1)][ax] self.axmap[rev[1]], self.axmap[rev[0]] = self.axmap[rev[0]], self.axmap[rev[1]] def front(self): return self.value(0, True) def rear(self): return self.value(0, False) def right(self): return self.value(1, True) def left(self): return self.value(1, False) def top(self): return self.value(2, True) def bottom(self): return self.value(2, False) def value(self, ax, d): a = self.ax[self.axmap[ax]] return self.dice[a[0]][a[1] if d else not a[1]] def __eq__(self, dice): #???????????????????????????????¢?????????? # z???????????§????????????????????´??????????????????????????°?????????????????§NG # ????????\?????????z????????????????????¢??§?????´????????????????????§????????¢??????????????´??????????????°NG # z???????????´????????? idx = -1 for i, ax in enumerate(self.dice): if dice.top() in ax and dice.bottom() in ax: idx = i # i = 0 = x => 0, 2 ????????? # i = 1 = y => 1, 2 ????????? # i = 2 = z => ????????????????????±????????? if i != 2: self.reverse((i+1)%2) break if idx==-1: return False # z(2)?????????????¢???? if self.top() != dice.top(): self.reverse(2) # x, y???????¢???? for _ in range(4): r = 0 for x in range(2): for b in (True, False): if self.value(x, b) != dice.value(x, b): break else: r += 1 if r<2: break if r==4: return True else: self.rotate("R") return False if __name__=="__main__": n = input() differed = True dices = [Dice(input().split())] for _ in range(1, n): dice = Dice(input().split()) for d in dices: if differed and dice==d: differed= False dices.append(dice) print("Yes" if g else "No")
s980857138
p02386
u193453446
1499837910
Python
Python3
py
Runtime Error
0
0
3121
#!/usr/bin/env python # -*- coding: utf-8 -*- """ ???????????? 4 ?¬?????±??????????????????????????????????????????¢??????????????\??¬????????§????????????????????°???????????????????????????????????? +--+ ???|???| +--+--+--+--+ |???|???|???|???| +--+--+--+--+ ???|???| +--+ """ class Dice: T = 0 S = 1 E = 2 W = 3 N = 4 B = 5 """ ????????????????????? """ def __init__(self): """ ????????????????????? """ self.side = [1, 2, 3, 4, 5, 6] self.top = 0 def setDice(self, arr): """ ??¢?????????????????? """ self.side = arr[0:6] def Turn(self, dir): """ ?????????????????¢?????? """ s = self.side if dir == "N": # ????????¢?????? # Top 0 South 1 East 2 West 3 North 4 Bottom 5 t = [s[Dice.S],s[Dice.B],s[Dice.E],s[Dice.W],s[Dice.T],s[Dice.N]] elif dir == "S": # ????????¢?????? t = [s[Dice.N],s[Dice.T],s[Dice.E],s[Dice.W],s[Dice.B],s[Dice.S]] elif dir == "E": # ??±?????¢?????? t = [s[Dice.W],s[Dice.S],s[Dice.T],s[Dice.B],s[Dice.N],s[Dice.E]] elif dir == "W": # ?\??????¢?????? t = [s[Dice.E],s[Dice.S],s[Dice.B],s[Dice.T],s[Dice.N],s[Dice.W]] elif dir == "L": # ???????????¢ t = [s[Dice.T],s[Dice.W],s[Dice.S],s[Dice.N],s[Dice.E],s[Dice.B]] elif dir == "R": # ???????????¢ t = [s[Dice.T],s[Dice.E],s[Dice.N],s[Dice.S],s[Dice.W],s[Dice.B]] self.side = t # print("{0} T0:{1} S1:{2} W2:{3} E3:{4} N4:{5} B5:{6} ".format(dir, self.side[0],self.side[1], self.side[2],self.side[3], self.side[4],self.side[5])) def Search(self, tval, sval, dir): """ ?????¢??¨?????¢???????????????????????????????????¢??????????????? """ # print("{0} T0:{1} S1:{2} W2:{3} E3:{4} N4:{5} B5:{6} ".format(dir, self.side[0],self.side[1], self.side[2],self.side[3], self.side[4],self.side[5])) if self.side[Dice.E] == tval: self.Turn("W") elif self.side[Dice.W] == tval: self.Turn("E") elif self.side[Dice.N] == tval: self.Turn("S") elif self.side[Dice.S] == tval: self.Turn("N") elif self.side[Dice.B] == tval: self.Turn("N") self.Turn("N") for i in range(3): # ?????¢?????????????????????????????§???????????? if self.side[Dice.S] == sval: break self.Turn("L") return self.side[dir] # ????????? d = [] num = int(input().strip()) for i in range(num): # ?????????????????? tmp = Dice() tmp.setDice(list(map(int,input().strip().split()))) d.append(tmp) ret = "Yes" for i in range(num-1): for j in range(i + 1,num): v1 = d[i].Search(d[i].side[Dice.T], d[i].side[Dice.S], Dice.E) v2 = d[j].Search(d[i].side[Dice.T], d[i].side[Dice.S], Dice.E) # print("{0}/{1} V1={2} V2={3}".format(i,j,v1,v2)) if v1 == v2: ret = "No" break if ret == "No": break print(ret)
s368317731
p02386
u283452598
1503212911
Python
Python3
py
Runtime Error
0
0
1775
class Dice(): def __init__(self,ary): self.top = ary[0] self.south = ary[1] self.east = ary[2] self.west = ary[3] self.north = ary[4] self.bottom = ary[5] def get_top(self): return self.top def rotate_north(self): self.top,self.south,self.north,self.bottom = self.south,self.bottom,self.top,self.north def rotate_south(self): self.top,self.south,self.north,self.bottom = self.north,self.top,self.bottom,self.south def rotate_west(self): self.top,self.west,self.bottom,self.east = self.east,self.top,self.west,self.bottom def rotate_east(self): self.top,self.west,self.bottom,self.east = self.west,self.bottom,self.east,self.top def rotate_horizon(self): self.south,self.east,self.north,self.west = self.west,self.south,self.east,self.north def get_east(self): return self.east q = int(input()) dice1 = Dice(list(map(int,input().split()))) for i in range(q-1): dice2 = Dice(list(map(int,input().split()))) h="" for i in range(4): dice2.rotate_west() if dice1.top == dice2.top: for _ in range(4): dice2.rotate_horizon() if dice1.south == dice2.south: if dice1.east == dice2.east and dice1.west == dice2.west: h = True for _ in range(4): dice2.rotate_north() if dice1.top == dice2.top: for m in range(4): dice2.rotate_horizon() if dice1.south == dice2.south: if dice1.east == dice2.east and dice1.west == dice2.west: h = True if h: continue else: h="No" break print(h="Yes")
s123453069
p02386
u972637506
1505790490
Python
Python3
py
Runtime Error
60
7940
1283
class Checker: d = { 1: { 2: (3,4,5,6), 3: (5,2,4,6), 4: (2,5,3,6), 5: (4,3,2,6) }, 2: { 1: (4,3,6,5), 3: (1,6,4,5), 4: (6,1,3,5), 6: (3,4,1,5) }, 3: { 1: (2,5,6,4), 2: (6,1,5,4), 5: (1,6,2,4), 6: (5,2,1,4) }, 4: { 1: (5,2,6,3), 2: (1,6,5,3), 5: (6,1,2,3), 6: (2,5,1,3) }, 5: { 1: (3,4,6,2), 3: (6,1,4,2), 4: (1,6,3,2), 6: (4,3,1,2) }, 6: { 2: (4,3,5,1), 3: (2,5,4,1), 4: (5,2,3,1), 5: (3,4,2,1) } } def __init__(self, s): l = s.split() self.tbl = {} for c,i in zip(l, range(1,7)): if c in self.tbl: self.tbl[c].append(i) else: self.tbl[c] = [i] self.pip = dict(zip(range(1,7), l)) def __call__(self, s): l = s.split() for i0 in self.tbl[l[0]]: for i1 in self.tbl[l[1]]: if i1 in self.d[i0]: for i,j in zip(self.d[i0][i1], range(2,6)): if self.pip[i] != l[j]: break else: return True return False def g(): n = int(input()) - 1 c = Checker(input()) for _ in range(n): yield c(input()) if any(g()): print("No") else: print("Yes")
s091380297
p02386
u203261375
1515054619
Python
Python3
py
Runtime Error
0
0
1407
import random class Dice(object): def __init__(self): self.t = 1 self.s = 2 self.e = 3 self.w = 4 self.n = 5 self.b = 6 def __init__(self, faces): self.t = faces[0] self.s = faces[1] self.e = faces[2] self.w = faces[3] self.n = faces[4] self.b = faces[5] def roll(self, direct): if direct == 0: self.t, self.s, self.b, self.n = self.n, self.t, self.s, self.b elif direct == 1: self.t, self.w, self.b, self.e = self.e, self.t, self.w, self.b elif direct == 2: self.n, self.w, self.s, self.e = self.w, self.s, self.e, self.n def is_equal(self, dice): if self.t == dice.t and self.s == dice.s and self.e == dice.e and self.w == dice.w and self.n == dice.n and self.b == dice.b: return True else: return False n = int(input()) dice_list = [] flag = True for _ in range(n): faces = list(map(int, input().split())) dice_list.append(Dice(faces1)) if n == 0: continue dice_a, dice_b = dice_list[0], dice_list[-1] for i in range(10000): dice_b.roll(random.randint(0, 3)) if dice_a.is_equal(dice_b): break if i + 1 == 10000: flag = False if not flag: break if flag: print('Yes') else: print('No')
s341964660
p02386
u150984829
1516429186
Python
Python3
py
Runtime Error
0
0
391
n=int(input()) a=[list(map(int,input().split()))for _ in range(n)] for k in range(n): b=a[k];b[3],b[4]=b[4],b[3] t=0 for i in range(n-1): d=a[i] for j in range(i+1,n): e=a[j] for p in('012345','152043','215304','302541','410352','514320'): f=[d[int(k)]for k in p] if f[0]==e[0]and f[5]==e[5]: f=f[1:5]*2 [t=1 for k in range(4)if f[k:k+4]==e[1:5]] print(('Yes','No')[t])
s453672272
p02386
u150984829
1516430121
Python
Python3
py
Runtime Error
0
0
459
n=int(input()) a=[list(map(int,input().split()))for _ in range(n)] for k in range(n): b=a[k];b[3],b[4]=b[4],b[3] t=0 while 1: try: for i in range(n-1): d=a[i] for j in range(i+1,n): e=a[j] for p in('012345','152043','215304','302541','410352','514320'): f=[d[int(k)]for k in p] if f[0]==e[0]and f[5]==e[5]: f=f[1:5]*2 for k in range(4): if f[k:k+4]==e[1:5]:t=1;raise Exception finally: print(('Yes','No')[t])
s669884824
p02386
u150984829
1516431999
Python
Python3
py
Runtime Error
0
0
420
n=int(input()) a=[list(map(int,input().split()))for _ in range(n)] for k in range(n): b=a[k];b[3],b[4]=b[4],b[3] def f(): for i in range(n-1): d=a[i] for j in range(i+1,n): e=a[j] for p in('012345','152043','215304','302541','410352','514320'): f=[d[int(k)]for k in p] if f[0]==e[0]and f[5]==e[5]: f=f[1:5]*2 for k in range(4): if f[k:k+4]==e[1:5]:return 'No' return 'Yes' print(f())
s116202767
p02386
u150984829
1524838429
Python
Python3
py
Runtime Error
0
0
395
def g(): from itertools import* n=int(input()) a=[input().split()for _ in[0]*n] for b in a: b[3:5]=b[4],b[3] for d,e in combinations(a,2): for p in([0,1,2,3,4,5],[1,5,2,0,4,3],[2,1,5,3,0,4],[3,0,2,5,4,1],[4,1,0,3,5,2],[5,1,4,3,2,0]): f=[d[i]for i in p] if f[0]==e[0]and f[5]==e[5]: f=f[1:5]*2 for k in range(4): if f[k:k+4]==e[1:5]:return'No' return'Yes' print(g())
s434893748
p02386
u908651435
1526754370
Python
Python3
py
Runtime Error
0
0
1092
class Dice: def __init__(self,t,f,r,l,b,u): self.a=[[t,f,r,l,b,u]] self.direction={'S':(4,0,2,3,5,1),'N':(1,5,2,3,0,4),'E':(3,1,0,5,4,2),'W':(2,1,5,0,4,3),'Y':(0,3,1,4,2,5)} def roll(self,d,n): self.a[n]=[self.a[n][i] for i in self.direction[d]] self.t = self.a[0] self.f = self.a[1] self.r = self.a[2] self.l = self.a[3] self.b = self.a[4] self.u = self.a[5] n=int(input()) for i in range(n): if i==0: t,f,r,l,b,u = map(int, input().split()) dice = Dice(t, f, r, l, b, u) else: a = list(map(int, input().split())) dice.a.append(a) s='SSSWEEE' w='YYYY' ans='Yes' for u in range(n-1): for t in range(u+1,n): for j in s: for r in w: if dice.a[t]==dice.a[u]: ans='No' break dice.roll(r,t) else: dice.roll(j,t) continue break else: continue break else: continue break print(ans)
s950256033
p02386
u908651435
1526754386
Python
Python3
py
Runtime Error
0
0
1092
class Dice: def __init__(self,t,f,r,l,b,u): self.a=[[t,f,r,l,b,u]] self.direction={'S':(4,0,2,3,5,1),'N':(1,5,2,3,0,4),'E':(3,1,0,5,4,2),'W':(2,1,5,0,4,3),'Y':(0,3,1,4,2,5)} def roll(self,d,n): self.a[n]=[self.a[n][i] for i in self.direction[d]] self.t = self.a[0] self.f = self.a[1] self.r = self.a[2] self.l = self.a[3] self.b = self.a[4] self.u = self.a[5] n=int(input()) for i in range(n): if i==0: t,f,r,l,b,u = map(int, input().split()) dice = Dice(t, f, r, l, b, u) else: a = list(map(int, input().split())) dice.a.append(a) s='SSSWEEE' w='YYYY' ans='Yes' for u in range(n-1): for t in range(u+1,n): for j in s: for r in w: if dice.a[t]==dice.a[u]: ans='No' break dice.roll(r,t) else: dice.roll(j,t) continue break else: continue break else: continue break print(ans)
s472598785
p02386
u592529978
1527483391
Python
Python
py
Runtime Error
0
0
693
ans=chk=0 a=[0,2,5,3] b=[0,1,5,4] c=[1,2,4,3] def sortdice(dice1,dice2,p,q,r): for i in range(4): dice1[p[0]],dice1[p[1]],dice1[p[2]],dice1[p[3]]=dice1[p[1]],dice1[p[2]],dice1[p[3]],dice1[p[0]] for j in range(4): dice1[q[0]],dice1[q[1]],dice1[q[2]],dice1[q[3]]=dice1[q[1]],dice1[q[2]],dice1[q[3]],dice1[q[0]] for k in range(4): dice1[r[0]],dice1[r[1]],dice1[r[2]],dice1[r[3]]=dice1[r[1]],dice1[r[2]],dice1[r[3]],dice1[r[0]] if dice1==dice2: print 'Yes' exit() return 0 l1=map(int,raw_input().split()) l2=map(int,raw_input().split()) sortdice(l1,l2,a,b,c) print 'No'
s856406329
p02386
u922112509
1529537771
Python
Python3
py
Runtime Error
0
0
2321
class Dice: def __init__(self, a1, a2, a3, a4, a5, a6): # サイコロを縦横にたどると書いてある数字(index1は真上、index3は真下の数字) self.face = [a1, a2, a3, a4, a5, a6] self.v = [a5, a1, a2, a6] # 縦方向 self.h = [a4, a1, a3, a6] # 横方向 self.det = 1 # print(self.v, self.h) # サイコロの上面の数字を表示 def top(self): return self.v[1] # サイコロを北方向に倒す def north(self): newV = [self.v[1], self.v[2], self.v[3], self.v[0]] self.v = newV self.h[1] = self.v[1] self.h[3] = self.v[3] return self.v, self.h # サイコロを南方向に倒す def south(self): newV = [self.v[3], self.v[0], self.v[1], self.v[2]] self.v = newV self.h[1] = self.v[1] self.h[3] = self.v[3] return self.v, self.h # サイコロを東方向に倒す def east(self): newH = [self.h[3], self.h[0], self.h[1], self.h[2]] self.h = newH self.v[1] = self.h[1] self.v[3] = self.h[3] return self.v, self.h # サイコロを西方向に倒す def west(self): newH = [self.h[1], self.h[2], self.h[3], self.h[0]] self.h = newH self.v[1] = self.h[1] self.v[3] = self.h[3] return self.v, self.h diceAmount = int(input()) dices = [] for i in range(diceAmount): d = [int(j) for j in input().rstrip().split()] dice = Dice(d[0], d[1], d[2], d[3], d[4], d[5]) dices.append(dice) Dice IV import random match = 0 diceCount = 1 while match == 0 and diceCount < diceAmount: for d2 in range(1, diceAmount): # print(d2) i = 0 while match == 0 and i < 24: j = random.randint(0, 3) if j == 0: dices[d2].north() elif j == 1: dices[d2].south() elif j == 2: dices[d2].east() elif j == 3: dices[d2].west() for d1 in range(d2): if (dices[d1].v == dices[d2].v and dices[d1].h == dices[d2].h): match += 1 # print('一致') i += 1 diceCount += 1 if match >= 1: print('No') else: print('Yes')
s091971013
p02388
u985078506
1530895993
Python
Python3
py
Runtime Error
0
0
21
x = x*x*x print("x")
s869961717
p02388
u452254177
1530972570
Python
Python3
py
Runtime Error
0
0
22
x=input() print(x**3)
s645472377
p02388
u452254177
1530972614
Python
Python3
py
Runtime Error
0
0
24
N = input() print(N**3)
s790292686
p02388
u500386459
1531120044
Python
Python3
py
Runtime Error
0
0
34
num = int(imput()) print(num**3)
s907772474
p02388
u303952184
1531837666
Python
Python3
py
Runtime Error
0
0
29
x = raw_input() print x ** 3
s734037944
p02388
u303952184
1531837755
Python
Python3
py
Runtime Error
0
0
31
x = raw_input() print (x ** 3)
s266372314
p02388
u303952184
1531837965
Python
Python3
py
Runtime Error
0
0
7
x ** 3
s001576004
p02388
u260169299
1534867711
Python
Python3
py
Runtime Error
0
0
249
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int v = scanner.nextInt(); scanner.close(); System.out.println(v * v * v); } }
s584185058
p02388
u260169299
1534867943
Python
Python3
py
Runtime Error
0
0
483
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); int it = 3; int total = 0; scanner.close(); System.out.println(helper(n,it,total)); } public static int helper(int n, int it, int total){ if(it == 0){ return total; } else { return helper(n, it - 1, total * n); } } }
s429589819
p02388
u260169299
1534868021
Python
Python3
py
Runtime Error
0
0
245
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); scanner.close(); System.out.println(n * n * n); } }
s505100829
p02388
u260169299
1534868055
Python
Python3
py
Runtime Error
0
0
249
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); scanner.close(); System.out.println(n * n * n); } }
s343933462
p02388
u219202227
1534895382
Python
Python3
py
Runtime Error
0
0
4
aaa
s338035832
p02388
u655879321
1534904512
Python
Python3
py
Runtime Error
0
0
13
print(x*x*x)
s287665664
p02388
u655879321
1534905495
Python
Python3
py
Runtime Error
0
0
52
A, B = map(int, input().sprit()) print(A*B,2*(A+B))
s578567192
p02388
u404682284
1534950982
Python
Python3
py
Runtime Error
0
0
88
package main import "fmt" func main(){ var i int fmt.Scan(&i) fmt.Println(i*i*i) }
s861945434
p02388
u525366883
1535069869
Python
Python
py
Runtime Error
0
0
42
x = int(raw_input()) print Math.pow(x, 3)
s333167540
p02388
u580227385
1535442160
Python
Python3
py
Runtime Error
0
0
50
if __name__ == '__main__': print(int(x) ** 3)
s462974732
p02388
u580227385
1535442253
Python
Python3
py
Runtime Error
0
0
45
if __name__ == '__main__': print(x ** 3)
s550015206
p02388
u578074046
1535531136
Python
Python3
py
Runtime Error
0
0
67
import sys args = sys.argv num = int(args[1]) print(str(num**3))
s988297784
p02388
u640181155
1535625718
Python
Python3
py
Runtime Error
0
0
61
print("文字を入力して下さい") x=input() print(x^3)
s903999982
p02388
u640181155
1535625804
Python
Python3
py
Runtime Error
0
0
63
print("文字を入力して下さい") x=input() print(x*x*x)
s290818966
p02388
u640181155
1535625861
Python
Python3
py
Runtime Error
0
0
64
print("文字を入力して下さい") x=input() print(x*x*x)
s606470183
p02388
u640181155
1535626175
Python
Python3
py
Runtime Error
0
0
25
x=input() print(x*x*x)
s852242792
p02388
u640181155
1535626184
Python
Python3
py
Runtime Error
0
0
26
x=input() print(x*x*x)
s524468282
p02388
u640181155
1535626190
Python
Python3
py
Runtime Error
0
0
26
x=input() print(x*x*x)
s326922542
p02388
u637765482
1535707356
Python
Python
py
Runtime Error
0
0
13
print(x*x*x)
s746381401
p02388
u637765482
1535707428
Python
Python
py
Runtime Error
0
0
14
x = x * x * x
s845160213
p02388
u637765482
1535707600
Python
Python3
py
Runtime Error
0
0
61
import numpy as np x = np.array([1, 2, 3]) print(np.cbrt(x))
s817152584
p02388
u589479013
1535884529
Python
Python3
py
Runtime Error
0
0
25
x=input a=x*x*x print(a)
s256984402
p02388
u589479013
1535884646
Python
Python3
py
Runtime Error
0
0
35
x=1 ≤ x ≤ 100 a=x*x*x print(a)
s871298835
p02388
u589479013
1535888177
Python
Python3
py
Runtime Error
0
0
103
#include<stdio.h> int main(){ int x; scanf("%d", &x); printf("%d\n",x*x*x); return 0; }
s305142939
p02388
u291439196
1535938494
Python
Python3
py
Runtime Error
0
0
20
x = 3 *** print(x)
s149047894
p02388
u650022417
1535968891
Python
Python
py
Runtime Error
0
0
181
#include <iostream> #include <vector> int main() { vector<vector<int>> vec(100, vector<int>(100, 0)); cin >> vec.at(100).at(99); cout << vec.at(100).at(100) << endl; }
s537688092
p02388
u650022417
1535968951
Python
Python
py
Runtime Error
0
0
202
#include <iostream> #include <vector> using namespace std; int main() { vector<vector<int>> vec(100, vector<int>(100, 0)); cin >> vec.at(100).at(99); cout << vec.at(100).at(100) << endl; }
s089797968
p02388
u650022417
1535969019
Python
Python
py
Runtime Error
0
0
201
#include <iostream> #include <vector> using namespace std; int main() { vector<vector<int>> vec(100, vector<int>(100, 0)); cin >> vec.at(99).at(99); cout << vec.at(100).at(100) << endl; }
s118941016
p02388
u650022417
1535969324
Python
Python
py
Runtime Error
0
0
253
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { vector<vector<int>> vec(100, vector<int>(100, 0)); cin >> vec.at(99).at(99); long long num = vec.at(99).at(99); cout << pow(num, 3) << endl; }
s283518480
p02388
u650022417
1535969361
Python
Python
py
Runtime Error
0
0
247
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { vector<vector<int>> vec(100, vector<int>(100, 0)); cin >> vec.at(99).at(99); num = vec.at(99).at(99); cout << num * num * num << endl; }
s327734801
p02388
u650022417
1535969431
Python
Python
py
Runtime Error
0
0
253
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { vector<vector<int>> vec(100, vector<int>(100, 0)); cin >> vec.at(99).at(99); int num = vec.at(99).at(99); cout << (int) pow(num, 3) << endl; }
s714103679
p02388
u344368371
1540544671
Python
Python
py
Runtime Error
0
0
33
x = Input() x = x*x*x print(x)
s244391688
p02388
u344368371
1540544940
Python
Python
py
Runtime Error
0
0
39
int x x = Input() x = x*x*x print(x)
s745256879
p02388
u344368371
1540544968
Python
Python
py
Runtime Error
0
0
35
x = getchar() x = x*x*x print(x)
s568945201
p02388
u394290028
1540617517
Python
Python3
py
Runtime Error
0
0
47
input(x) a = int(x) * int(x) * int(x) print(a)
s793357082
p02388
u394290028
1540617533
Python
Python3
py
Runtime Error
0
0
32
input(x) a = x * x * x print(a)
s783886796
p02388
u678690126
1540650846
Python
Python3
py
Runtime Error
0
0
48
x = input() if 1 <= x <= 100: print(x ** 2)
s534535505
p02388
u127984384
1540712509
Python
Python
py
Runtime Error
0
0
35
input(x) y=0 y=x*x*x print(y)
s974313233
p02388
u637765482
1540737791
Python
Python3
py
Runtime Error
0
0
19
x = x*x*x print(x)
s225084753
p02388
u637765482
1540737830
Python
Python3
py
Runtime Error
0
0
13
print(x*x*x)
s831800095
p02388
u637765482
1540738429
Python
Python3
py
Runtime Error
0
0
33
x = input() y = x**3 print(y)
s474934995
p02388
u637765482
1540738462
Python
Python3
py
Runtime Error
0
0
37
x = input() y = x**3 print int(y)
s899919494
p02388
u637765482
1540738480
Python
Python3
py
Runtime Error
0
0
38
x = input() y = x**3 print(int(y))
s254237813
p02388
u637765482
1540738599
Python
Python3
py
Runtime Error
0
0
37
x = input(int()) y = x**3 print(y)
s474299748
p02388
u637765482
1540738670
Python
Python3
py
Runtime Error
0
0
19
x = X**3 print(x)
s060219751
p02388
u637765482
1540739030
Python
Python3
py
Runtime Error
0
0
23
x = int(x**3) print(x)
s941694504
p02388
u978863922
1540826313
Python
Python3
py
Runtime Error
0
0
34
N = int(input()) print(pow(N,3))
s659347473
p02388
u393807324
1540894984
Python
Python3
py
Runtime Error
0
0
25
a = input() print(a*a*a)
s989938497
p02388
u393807324
1540895036
Python
Python3
py
Runtime Error
0
0
94
#include<iostream> using namespace std; int main(void){ int a; cin>>a; cout<<a*a*a<<endl; }
s809573538
p02388
u293957970
1541169953
Python
Python3
py
Runtime Error
0
0
30
number = 2^3: print("number")