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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
s996862213 | p02383 | u042885182 | 1493926876 | Python | Python3 | py | Runtime Error | 0 | 0 | 12 | import numpy |
s079062111 | p02383 | u440180827 | 1496473104 | Python | Python | py | Runtime Error | 0 | 0 | 308 | u, s, e, w, n, d = list(map(int, input().split()))
insts = input()
for inst in insts:
if inst == 'N':
u, s, n, d = s, d, u, n
elif inst == 'E':
u, e, w, d = w, u, d, e
elif inst == 'S':
u, s, n, d = n, u, d, s
elif inst == 'W':
u, e, w, d = e, d, u, w
print(u) |
s494583682 | p02383 | u659034691 | 1502759343 | Python | Python3 | py | Runtime Error | 0 | 0 | 523 | #dice
D=[int(i) for i in input().split()]
Os=input()
for i in range(len(Os)):
if Os[i]=="N":
t=D[0]
D[0]=D[1]
D[1]=D[5]
D[5]=D[4]
D[4]=t
elif Os[i]=="S":
t=D[0]
D[0]=D[4]
D[4]=D[5]
D[5]=D[1]
D[1]=t
elif Os[i]=="E":
t... |
s294647842 | p02383 | u954858867 | 1504168264 | Python | Python | py | Runtime Error | 0 | 0 | 825 | class Dice:
current = 1
num = {}
map = {
1:{'N':2, 'S':5, 'E':4, 'W':3},
2:{'N':6, 'S':1, 'E':4, 'W':3},
3:{'N':6, 'S':1, 'E':2, 'W':5},
4:{'N':6, 'S':1, 'E':5, 'W':2},
5:{'N':6, 'S':1, 'E':4, 'W':3},
6:{'N':5, 'S':2, 'E':4, 'W':3},
}
def __init__(... |
s559311361 | p02383 | u954858867 | 1504168307 | Python | Python | py | Runtime Error | 0 | 0 | 825 | class Dice:
current = 1
num = {}
map = {
1:{'N':2, 'S':5, 'E':4, 'W':3},
2:{'N':6, 'S':1, 'E':4, 'W':3},
3:{'N':6, 'S':1, 'E':2, 'W':5},
4:{'N':6, 'S':1, 'E':5, 'W':2},
5:{'N':6, 'S':1, 'E':4, 'W':3},
6:{'N':5, 'S':2, 'E':4, 'W':3},
}
def __init__(... |
s040068443 | p02383 | u748921161 | 1507976440 | Python | Python | py | Runtime Error | 0 | 0 | 1088 | #N E S W
def move_func(dice_list, dir):
new_dice = []
if dir=="N":
new_dice.append(dice_list[1])
new_dice.append(dice_list[5])
new_dice.append(dice_list[2])
new_dice.append(dice_list[3])
new_dice.append(dice_list[0])
new_dice.append(dice_list[4])
elif dir=="E":
new_dice.append(dice_list[3])
new_dice.... |
s979075731 | p02383 | u748921161 | 1507976465 | Python | Python | py | Runtime Error | 0 | 0 | 1079 | def move_func(dice_list, dir):
new_dice = []
if dir=="N":
new_dice.append(dice_list[1])
new_dice.append(dice_list[5])
new_dice.append(dice_list[2])
new_dice.append(dice_list[3])
new_dice.append(dice_list[0])
new_dice.append(dice_list[4])
elif dir=="E":
new_dice.append(dice_list[3])
new_dice.append(di... |
s537040723 | p02383 | u518939641 | 1510580654 | Python | Python3 | py | Runtime Error | 0 | 0 | 721 | class Dice:
def __init__(self):
self.dice=[1,2,3,4,5,6] # up,front,right,left,back,front
def set(self,l):
self.dice=l
def roll(self, s):
import copy
mat=((1,4,3,2),(5,0,1,1),(2,2,0,5),(3,3,5,0),(0,5,4,4),(4,1,2,3))
l=copy.deepcopy(self.dice)
if s == 'N': c = 0... |
s604320794 | p02383 | u379645513 | 1513223297 | Python | Python | py | Runtime Error | 0 | 0 | 1080 | class dice{
public:
explicit dice(int in[6]){
for(int i=0;i<6;i++){
v[i]=in[i];
}
}
void mov(const char c){
int buf;
switch(c){
case 'N':{
buf = v[0];
v[0] = v[1];
v[1] = v[5];
v[5] = v[4]... |
s706809488 | p02383 | u379645513 | 1513223302 | Python | Python3 | py | Runtime Error | 0 | 0 | 1080 | class dice{
public:
explicit dice(int in[6]){
for(int i=0;i<6;i++){
v[i]=in[i];
}
}
void mov(const char c){
int buf;
switch(c){
case 'N':{
buf = v[0];
v[0] = v[1];
v[1] = v[5];
v[5] = v[4]... |
s920852481 | p02383 | u585035894 | 1514479067 | Python | Python3 | py | Runtime Error | 0 | 0 | 1411 | import random
class Dice():
def __init__(self, *n):
self.rolls = n
def spin(self, order):
if order == "N":
self.rolls = [
self.rolls[1],
self.rolls[5],
self.rolls[2],
self.rolls[3],
self.rolls[0],
... |
s604986331 | p02383 | u017523606 | 1516528456 | Python | Python3 | py | Runtime Error | 0 | 0 | 623 | dice = input().split()
direction = list(input())
dice2 = []
for i in range(len(direction)):
dice2 = dice
print(dice2)
if direction[i] == 'E':
dice = [dice2[3],dice2[1],dice2[0],dice2[5],dice2[4],dice2[2]]
print(dice)
elif direction[i] == 'N':
dice = [dice2[1],dice2[5],dice2[2],di... |
s983234188 | p02383 | u267728784 | 1516758801 | Python | Python3 | py | Runtime Error | 0 | 0 | 499 | l=map(int,raw_input().split())
n=raw_input()
ans=chk=0
def rolling(word,dice):
if word=='S':
dice[0],dice[1],dice[5],dice[4]=dice[4],dice[0],dice[1],dice[5]
elif word=='N':
dice[0],dice[1],dice[5],dice[4]=dice[1],dice[5],dice[4],dice[0]
elif word=='W':
dice[0],dice[2],dice[5],dic... |
s174631924 | p02383 | u294922877 | 1518757687 | Python | Python3 | py | Runtime Error | 30 | 5996 | 1023 | from collections import deque
class Dice:
def __init__(self, top, down, right, left, up, bottom):
self.top = top
self.bottom = bottom
self.up = up
self.down = down
self.left = left
self.right = right
def roll(self, command):
for c in list(command):
... |
s892758239 | p02383 | u328199937 | 1524315434 | Python | Python3 | py | Runtime Error | 0 | 0 | 1113 | ef north(list):
List = []
List.append(list[1])
List.append(list[5])
List.append(list[2])
List.append(list[3])
List.append(list[0])
List.append(list[4])
return List
def west(list):
List = []
List.append(list[2])
List.append(list[1])
List.append(list[5])
List.append(li... |
s311376493 | p02383 | u327546577 | 1528148254 | Python | Python3 | py | Runtime Error | 0 | 0 | 1171 | class Dice():
def __init__(self, numbers):
self.top = numbers[0]
self.s = numbers[1]
self.e = numbers[2]
self.w = numbers[3]
self.n = numbers[4]
self.bot = numbers[5]
def rot(self, dir):
top, s, e, w, n, bot = (self.top, self.s, self.e, self.w, self.b, sel... |
s601938599 | p02383 | u327546577 | 1528148272 | Python | Python3 | py | Runtime Error | 0 | 0 | 1177 | class Dice():
def __init__(self, numbers):
self.top = numbers[0]
self.s = numbers[1]
self.e = numbers[2]
self.w = numbers[3]
self.n = numbers[4]
self.bot = numbers[5]
def rot(self, dir):
top, s, e, w, n, bot = (self.top, self.s, self.e, self.w, self.b, sel... |
s134058467 | p02383 | u940150266 | 1528937016 | Python | Python3 | py | Runtime Error | 0 | 0 | 204 | num = (int, input().split())
dice = {'N':(2, 6, 3, 4, 1, 5),'E':(4, 2, 1, 6, 5, 3),'W':(3, 2, 6, 1, 5, 4),'S':(5, 1, 3, 4, 6, 2)}
for alf in input():
num = [num[i]for i in dice[alf-1]]
print(num[0])
|
s369609605 | p02384 | u869301406 | 1530950416 | Python | Python3 | py | Runtime Error | 0 | 0 | 1300 | 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(self, x, y):
temp = y.pop(0)
y.append(temp)
x[0] = y[0]
x[2] = y[2]
def __move_prev(self, x, y):
temp = y.pop(3)... |
s448065322 | p02384 | u874395007 | 1546332921 | Python | Python3 | py | Runtime Error | 0 | 0 | 1895 | from typing import List
class Dice:
sur = [i for i in range(6)]
def __init__(self, s: List[int]):
self.s = s # surfaceリスト
# indexが面の番号。リストの値は、それに接する面の番号。
self.sur[0] = [1, 2, 4, 3]
self.sur[1] = [0, 3, 5, 2]
self.sur[2] = [1, 5, 4, 0]
self.sur[3] = [1, 0, 4,... |
s124314372 | p02384 | u482227082 | 1558925170 | Python | Python3 | py | Runtime Error | 0 | 0 | 1235 | import random
class Cube:
def __init__(self, u, s, e, w, n, d):
self.u = u
self.s = s
self.e = e
self.w = w
self.n = n
self.d = d
def rotate(self, dic):
if dic == "N":
tmp = self.u
self.u = self.s
self.s = self.d
... |
s833420454 | p02384 | u218784088 | 1559540883 | Python | Python3 | py | Runtime Error | 0 | 0 | 2187 | #include<iostream>
using namespace std;
int main(){
int n, a, b;
int c[6]={};
for (int i=0; i<6; i++) {
cin >> c[i];
}
cin >> n;
for (int i=0; i<n; i++) {
cin >> a >> b;
if (a==c[0]) {
if (b==c[1]) {
cout << c[2] << endl;
} else if... |
s139376594 | p02384 | u567380442 | 1421233786 | Python | Python3 | py | Runtime Error | 0 | 0 | 612 | mask = [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]]
TOP, FRONT, RIGHT, LEFT, BACK, BOTTOM = mask[0]
def set_top(dice, top):
return [dice[i] for i in mask[top]]
def set_front(dice, front):
twist = (0, 3, 1, 4, 2, 5)
while di... |
s846383401 | p02384 | u297342993 | 1423729841 | Python | Python3 | py | Runtime Error | 0 | 0 | 274 | from Dice import Dice
dice = Dice(input().split())
count = int(input())
result = []
for i in range(count):
(top, front) = [i for i in input().split()]
dice.moveTopTo(top)
dice.moveFrontTo(front)
result.append(dice.getRight())
for s in result:
print(s) |
s141041371 | p02384 | u571345655 | 1435308627 | Python | Python | py | Runtime Error | 10 | 4364 | 2030 | # coding=utf-8
class Dice(object):
def __init__(self, label):
self.label = label
def _rotateS(self):
s1, s2, s3, s4, s5, s6 = self.label
self.label = [s5, s1, s3, s4, s6, s2]
def _rotateN(self):
s1, s2, s3, s4, s5, s6 = self.label
self.label = [s2, s6, s3, s4, s1... |
s327425384 | p02384 | u072053884 | 1447301062 | Python | Python3 | py | Runtime Error | 20 | 7836 | 2594 | class Dice:
def __init__(self, face_vals):
self.faces = dict(zip(['top', 'front', 'right',
'left', 'back', 'bottom'], face_vals.split()))
def roll(self, direction):
if direction == 'N':
self.faces['top'], self.faces['front'], self.faces['bottom'], \
... |
s020846342 | p02384 | u811841526 | 1449504302 | Python | Python3 | py | Runtime Error | 0 | 0 | 2019 | class Dice(object):
def __init__(self, top, south, east, west, north, bottom):
self.top = top
self.south = south
self.east = east
self.west = west
self.north = north
self.bottom = bottom
def get_face(self, face):
if face == 'top':
return self.... |
s692974784 | p02384 | u811841526 | 1449504523 | Python | Python3 | py | Runtime Error | 0 | 0 | 2076 | class Dice(object):
def __init__(self, top, south, east, west, north, bottom):
self.top = top
self.south = south
self.east = east
self.west = west
self.north = north
self.bottom = bottom
def get_face(self, face):
if face == 'top':
return self.... |
s488048212 | p02384 | u580607517 | 1452520254 | Python | Python | py | Runtime Error | 0 | 0 | 1477 | import copy
class Dice(object):
def __init__(self, List):
self.face = List
def n_spin(self, a_List):
List = copy.copy(a_List)
temp = List[0]
List[0] = List[1]
List[1] = List[5]
List[5] = List[4]
List[4] = temp
def s_spin(self, a_List):
List = copy.copy(a_List)
temp = List[0]
... |
s323207457 | p02384 | u580607517 | 1452520270 | Python | Python | py | Runtime Error | 0 | 0 | 1237 | import copy
class Dice(object):
def __init__(self, List):
self.face = List
def n_spin(self, a_List):
List = copy.copy(a_List)
temp = List[0]
List[0] = List[1]
List[1] = List[5]
List[5] = List[4]
List[4] = temp
def s_spin(self, a_List):
List = copy.copy(a_List)
temp = List[0]
... |
s653962215 | p02384 | u580607517 | 1452520349 | Python | Python | py | Runtime Error | 0 | 0 | 1322 | import copy
class Dice(object):
def __init__(self, List):
self.face = List
def n_spin(self, a_List):
List = copy.copy(a_List)
temp = List[0]
List[0] = List[1]
List[1] = List[5]
List[5] = List[4]
List[4] =
return List
def s_spin(self, a_List):
List = copy.copy(a_List)
tem... |
s635124767 | p02384 | u998435601 | 1473940813 | Python | Python3 | py | Runtime Error | 0 | 0 | 1292 | # coding: utf-8
# ?????????????????¨????????????
class Dice(object):
def __init__(self):
# ???????????????????????°
# ????????¶???
self.dice = (2, 5), (3, 4), (1, 6) # 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)... |
s440669688 | p02384 | u998435601 | 1473943478 | Python | Python3 | py | Runtime Error | 0 | 0 | 1257 | # coding: utf-8
# ?????????????????¨????????????
class Dice(object):
def __init__(self):
# ????????¶???
self.dice = (2, 5), (3, 4), (1, 6) # 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)}
... |
s312616313 | p02384 | u831244171 | 1478322760 | Python | Python3 | py | Runtime Error | 0 | 0 | 1475 | def whatIsRight(u,f):
r = 0
if u == 1:
if f == 2:
r = 3
elif f == 3:
r = 5
elif f == 4:
r = 2
elif f == 5:
r = 4
return r
if u == 2:
if f == 6:
r = 3
elif f == 3:
r = 1
... |
s788227405 | p02384 | u546285759 | 1480844129 | Python | Python3 | py | Runtime Error | 40 | 7752 | 363 | dice = {v: k for k, v in enumerate(list(map(int, input().split())))}
adjacent = {k: v for k, v in enumerate(sorted(dice.keys()))}
q = int(input())
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)]
for _ in range(q):
top, front = map(int, input().split())
x = d... |
s791172405 | p02384 | u546285759 | 1480844351 | Python | Python3 | py | Runtime Error | 0 | 0 | 378 | dice = {v: k for k, v in enumerate(list(map(int, input().split())))}
adjacent = {k: v for k, v in enumerate(sorted(dice.keys()))}
q = int(input())
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)]
for _ in range(q):
top, front = map(int, input().split())
x = d... |
s365285359 | p02384 | u918276501 | 1484505423 | Python | Python3 | py | Runtime Error | 0 | 0 | 365 | f = input().split()
input()
while True:
t, s = map(f.index, input().split())
if t in A and s in A:
print(f[2]) if A.index(t) - A.index(s) in D else print(f[3])
if t in B and s in B:
print(f[0]) if B.index(t) - B.index(s) in D else print(f[5])
if t in C and s in C:
print(f[1]) if ... |
s178199508 | p02384 | u918276501 | 1484505457 | Python | Python3 | py | Runtime Error | 0 | 0 | 415 | A,B,C = (0,1,5,4),(1,2,4,3),(2,0,3,5)
D = (-1,3)
f = input().split()
input()
while True:
t, s = map(f.index, input().split())
if t in A and s in A:
print(f[2]) if A.index(t) - A.index(s) in D else print(f[3])
if t in B and s in B:
print(f[0]) if B.index(t) - B.index(s) in D else print(f[5])... |
s736738274 | p02384 | u918276501 | 1484508487 | Python | Python3 | py | Runtime Error | 0 | 0 | 309 | rot = ((1,2,4,3),(2,0,3,5),(0,1,5,4))
f = input().split()
for i in range(int(input())):
t, s = map(f.index, input().split())
for j in rot:
if (t in j)*(s in j):
continue
d = rot.index(j)
if (j.index(t) - j.index(s)) %4 == 1:
d -= 5
print(f[abs(d)]) |
s173921004 | p02384 | u513411598 | 1485676499 | Python | Python3 | py | Runtime Error | 20 | 7848 | 3155 | class Dice:
__top = 0
__front = 1
__right = 2
__left = 3
__back = 4
__bottom = 5
def __init__(self, a, b, c, d, e, f):
self.__dice = [a,b,c,d,e,f]
def S(self):
dice_before = self.__dice[:]
self.__dice[Dice.__top] = dice_before[Dice.__back]
self.__dic... |
s405002704 | p02384 | u104171359 | 1487211787 | Python | Python3 | py | Runtime Error | 0 | 0 | 2299 | #!usr/bin/env python3
import sys
class Die:
def __init__(self, pips):
self.pips = pips
def move_die(self, direction):
if direction == 'N':
tmp = self.pips[0]
self.pips[0] = self.pips[1]
self.pips[1] = self.pips[5]
self.pips[5] = self.pips[4]
... |
s165909303 | p02384 | u104171359 | 1487309955 | Python | Python3 | py | Runtime Error | 0 | 0 | 2361 | #!usr/bin/env python3
import sys
class Die:
def __init__(self, pips):
self.pips = pips
def move_die(self, direction):
if direction == 'N':
tmp = self.pips[0]
self.pips[0] = self.pips[1]
self.pips[1] = self.pips[5]
self.pips[5] = self.pips[4]
... |
s700517143 | p02384 | u548155360 | 1487349473 | Python | Python3 | py | Runtime Error | 30 | 7700 | 1043 | class Dice():
def __init__(self, label):
self.d = label
def roll(self, drt):
if drt == 'N':
self.d[1], self.d[2], self.d[6], self.d[5] = self.d[2], self.d[6], self.d[5], self.d[1]
elif drt == 'E':
self.d[1], self.d[3], self.d[6], self.d[4] = self.d[4], self.d[1], self.d[3], self.d[6]
elif drt == 'S':
... |
s516021491 | p02384 | u024715419 | 1488511045 | Python | Python3 | py | Runtime Error | 0 | 0 | 938 | class dice:
def __init__(self, pip):
self.pip = pip
def move(self,dir):
if str(dir) == "E":
self.pip[0],self.pip[2],self.pip[3],self.pip[5] = self.pip[3],self.pip[0],self.pip[5],self.pip[2]
elif str(dir) == "W":
self.pip[0],self.pip[2],self.pip[3],self.pi... |
s825325884 | p02384 | u756958775 | 1490540459 | Python | Python3 | py | Runtime Error | 30 | 8044 | 617 | import copy
class Dice2:
def __init__(self, nums):
self.nums = nums
self.dic = \
{(1,2):3, (1,3):5, (1,4):2, (1,5):4, (2,3):1, (2,4):6, (2,6):3, (3,5):1, (3,6):5, (4,5):6, (4,6):2, (5,6):4}
def output_right(self, x):
nums = self.nums
y = copy.deepcopy(x)
x... |
s901104875 | p02384 | u782850499 | 1491669415 | Python | Python3 | py | Runtime Error | 20 | 7480 | 803 | class dice_2:
def __init__(self,label):
self.spots = label
def result(self,top,front):
if top == 1:
self.order=[2,3,5,4,2]
elif top == 2:
self.order=[6,3,1,4,6]
elif top == 3:
self.order=[2,6,5,1,2]
elif top == 4:
self.orde... |
s473243282 | p02384 | u042885182 | 1493983682 | Python | Python3 | py | Runtime Error | 0 | 0 | 8316 | # coding: utf-8
# Here your code !
from sys import exit
from collections import Iterable
from unittest import TestCase
import random
import numpy as np
def top_face_after_rolling_dice():
try:
faces = [int(num) for num in input().rstrip().split()]
rollings = input().rstrip()
excep... |
s142109870 | p02384 | u279605379 | 1495094475 | Python | Python3 | py | Runtime Error | 20 | 7600 | 330 | #ITP1_11-B Dice 2
rep=[
[0,0,0,0,0],
[2,3,5,4,2],
[3,1,4,6,3],
[1,2,6,5,1],
[1,5,6,2,1],
[1,3,6,4,1],
[2,4,5,3,2]
]
d = input().split(" ")
q = int(input())
for i in range(q):
a,b = [int(x) for x in input().split(" ")]
for j in range(4):
if(rep[a][j]==b):
print(re... |
s092945818 | p02384 | u279605379 | 1495094490 | Python | Python3 | py | Runtime Error | 20 | 7628 | 330 | #ITP1_11-B Dice 2
rep=[
[0,0,0,0,0],
[2,3,5,4,2],
[3,1,4,6,3],
[1,2,6,5,1],
[1,5,6,2,1],
[1,3,6,4,1],
[2,4,5,3,2]
]
d = input().split(" ")
q = int(input())
for i in range(q):
a,b = [int(x) for x in input().split(" ")]
for j in range(4):
if(rep[a][j]==b):
print(re... |
s386898034 | p02384 | u821624310 | 1497868196 | Python | Python3 | py | Runtime Error | 30 | 7620 | 463 | class Dice:
def __init__(self):
self.face = {12:3, 13:5, 14:2, 15:4, 21:4, 23:1, 24:6, 26:3, 31:2, 32:6, 35:1, 36:5, 41:5, 42:1, 45:6, 46:2, 51:3, 53:6, 54:1, 56:4, 62:4, 63:2, 64:5, 65:3}
def right_face(self, face):
return self.face[face]
d = Dice()
dice = [dice for dice in input().split(... |
s506222403 | p02384 | u821624310 | 1497868329 | Python | Python3 | py | Runtime Error | 30 | 7628 | 463 | class Dice:
def __init__(self):
self.face = {12:3, 13:5, 14:2, 15:4, 21:4, 23:1, 24:6, 26:3, 31:2, 32:6, 35:1, 36:5, 41:5, 42:1, 45:6, 46:2, 51:3, 53:6, 54:1, 56:4, 62:4, 63:2, 64:5, 65:3}
def right_face(self, face):
return self.face[face]
d = Dice()
dice = [dice for dice in input().split(... |
s089439950 | p02384 | u821624310 | 1497868375 | Python | Python3 | py | Runtime Error | 20 | 7584 | 463 | class Dice:
def __init__(self):
self.face = {12:3, 13:5, 14:2, 15:4, 21:4, 23:1, 24:6, 26:3, 31:2, 32:6, 35:1, 36:5, 41:5, 42:1, 45:6, 46:2, 51:3, 53:6, 54:1, 56:4, 62:4, 63:2, 64:5, 65:3}
def right_face(self, face):
return self.face[face]
d = Dice()
dice = [dice for dice in input().split(... |
s175157289 | p02384 | u283452598 | 1503209827 | Python | Python3 | py | Runtime Error | 30 | 7824 | 2164 | 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.nor... |
s425334185 | p02384 | u283452598 | 1503209917 | Python | Python3 | py | Runtime Error | 30 | 7744 | 2164 | 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.nor... |
s472354311 | p02384 | u972637506 | 1505754389 | Python | Python3 | py | Runtime Error | 50 | 7648 | 665 | class Converter:
d = {
"1 2": 2,
"1 3": 4,
"1 4": 1,
"1 5": 3,
"2 1": 3,
"2 3": 0,
"2 4": 5,
"2 6": 2,
"3 1": 1,
"3 2": 5,
"3 5": 0,
"3 6": 4,
"4 1": 4,
"4 2": 0,
"4 5": 5,
"4 6": 1,
... |
s150540507 | p02384 | u480053997 | 1507874771 | Python | Python3 | py | Runtime Error | 0 | 0 | 461 | class Dice2(Dice1):
def __init__(self, v): # v [Top, Front, Right, Left, Back, Bottom ]
super().__init__(v)
self.dTFR = {}
for i, j, k in ((ii, (ii++2)%6, (ii+4)%6) for ii in range(6)):
self.dTFR[self.view[i]]=[self.view[v] for v in (j, k, 5-j, 5-k, j)]
d2, q = Dice2(list(ma... |
s535719816 | p02384 | u480053997 | 1507874889 | Python | Python3 | py | Runtime Error | 0 | 0 | 461 | class Dice2(Dice1):
def __init__(self, v): # v [Top, Front, Right, Left, Back, Bottom ]
super().__init__(v)
self.dTFR = {}
for i, j, k in ((ii, (ii++2)%6, (ii+4)%6) for ii in range(6)):
self.dTFR[self.view[i]]=[self.view[v] for v in (j, k, 5-j, 5-k, j)]
d2, q = Dice2(list(ma... |
s324885649 | p02384 | u379645513 | 1512956442 | Python | Python3 | py | Runtime Error | 0 | 0 | 3596 | #include <queue>
#include <vector>
#include <string>
#include <cassert>
#include <iostream>
#include <algorithm>
enum class Direction
{
North = 0,
East,
South,
West,
};
struct Number
{
Number(int t, int f, int r, int l, int b, int btm)
:top(t), front(f), right(r), left(l), back(b), botto... |
s113432104 | p02384 | u150984829 | 1516370767 | Python | Python3 | py | Runtime Error | 0 | 0 | 224 | d=input().split()
n={0:(1,2,4,3,1),1:(0,3,5,2,0),2:(0,1,5,4,0),3:(1,0,4,5,1),4:(0,2,5,3,0),5:(1,3,4,2,1)}
for _ in range(int(input())):
t,f=[d.index(s) for s in input().split()]
n=n[int(t)]
print(d[n[n.index(int(f))+1]])
|
s263632012 | p02384 | u267728784 | 1516758847 | Python | Python3 | py | Runtime Error | 0 | 0 | 881 | def face(x,y,dice):
if (x==dice[5] and y==dice[4])or(x==dice[4] and y==dice[0])or(x==dice[0] and y==dice[1])or(x==dice[1] and y==dice[5]):
return dice[2]
elif (x==dice[0] and y==dice[2])or(x==dice[2] and y==dice[5])or(x==dice[5] and y==dice[3])or(x==dice[3] and y==dice[0]):
return dice[4]
el... |
s521433426 | p02384 | u088372268 | 1517446928 | Python | Python3 | py | Runtime Error | 20 | 5608 | 1086 | class Dice:
def __init__(self, top, dside):
self.top = top
self.dside = dside
self.rside = None
self.num = [self.top, self.dside, 7-self.top, 7-self.dside]
def rside_num(self):
if 2 in self.num and 3 in self.num:
if(self.num.index(3)==self.num.index(2)+1 or
... |
s586698721 | p02384 | u886729200 | 1523029737 | Python | Python3 | py | Runtime Error | 0 | 0 | 1443 | class Dice2():
def front(self,up,front,dice):
#index == 5
if (up==dice[2] and front==dice[1])
or(up==dice[1] and front==dice[3])
or(up==dice[3] and front==dice[4])
or(up==dice[4] and front==dice[2]):
return dice[5]
#index == 4
elif (up==dice[0] and... |
s628488130 | p02384 | u908651435 | 1526752468 | Python | Python3 | py | Runtime Error | 0 | 0 | 883 | class Dice:
def __init__(self,t,f,r,l,b,u):
self.t = t
self.f = f
self.r = r
self.l = l
self.b = b
self.u = 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(s... |
s136830647 | p02384 | u657361950 | 1528472237 | Python | Python3 | py | Runtime Error | 0 | 0 | 1485 |
class Dice:
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, drct):
t_ = self.t
s_ = self.s
e_ = self.e
w_ = self.w
n_ = self.n
b_ = self.b
if drct == 'S':
self.t = def set_top(self, ... |
s256933961 | p02385 | u869301406 | 1530960566 | Python | Python3 | py | Runtime Error | 0 | 0 | 2640 | 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):
te... |
s417920723 | p02385 | u175224634 | 1556900596 | Python | Python3 | py | Runtime Error | 0 | 0 | 1242 | class Dice :
same_dice_index = ('123456' , '135246' , '142536' , '154326' ,
'214365' , '231645' , '246135' , '263415',
'312564' , '326154' , '351624' , '365214',
'415263' , '421653' , '456123' , '462513',
'513462' , '536... |
s157912331 | p02385 | u175224634 | 1556900634 | Python | Python3 | py | Runtime Error | 0 | 0 | 1693 | class Dice:
def __init__(self):
self.u=1
self.w=2
self.s=3
self.e=4
self.n=5
self.d=6
self.dic={"W":0,"S":1,"E":2,"N":3}
def __init__(self,u,w,s,e,n,d):
self.u=u
self.w=w
self.s=s
self.e=e
self.n=n
... |
s901826635 | p02385 | u764759179 | 1559020429 | Python | Python3 | py | Runtime Error | 0 | 0 | 1331 | #!/usr/bin/env python3
# coding: utf-8
class Dice() :
mask = {'N':(1,5,2,3,0,4), 'E':(3,1,0,5,4,2),
'W':(2,1,5,0,4,3), 'S':(4,0,2,3,5,1),'CW':(0,2,4,1,3,5)}
way = ("N","E","W","S","CW","Nop")
def __init__(self, data):
self.label = data
def move(self, data):
if data == "N... |
s195282038 | p02385 | u067975558 | 1423789336 | Python | Python3 | py | Runtime Error | 0 | 0 | 753 | class Dice:
def __init__(self, data):
self.data = data
def judge(self, dice):
if self.data[0] != dice[0]:
for i in range(4):
if self.data[0] == dice[0]:
break
self.move('E')
for i in range(4):
if self.da... |
s237872415 | p02385 | u067975558 | 1423790118 | Python | Python3 | py | Runtime Error | 0 | 0 | 1668 | class Dice:
def __init__(self, data):
self.data = data
def move(self, direction):
if direction == 'E':
self.data[0],self.data[3], self.data[5], self.data[2] = \
self.data[3],self.data[5], self.data[2], self.data[0]
elif direction == 'N':
self.data... |
s848465747 | p02385 | u067975558 | 1423790218 | Python | Python3 | py | Runtime Error | 0 | 0 | 1697 | class Dice:
def __init__(self, data):
self.data = data
def move(self, direction):
if direction == 'E':
self.data[0],self.data[3], self.data[5], self.data[2] = \
self.data[3],self.data[5], self.data[2], self.data[0]
elif direction == 'N':
self.dat... |
s369190051 | p02385 | u067975558 | 1423794080 | Python | Python3 | py | Runtime Error | 0 | 0 | 1955 | class Dice:
def __init__(self, data):
self.data = data
def __eq__(self, value):
for i in range(4):
if self.data[0] == value.data[0]:
for j in range(4):
if self.data == value.data:
return True
self.move('... |
s996669210 | p02385 | u131984977 | 1423795722 | Python | Python3 | py | Runtime Error | 0 | 0 | 2295 | class Dice:
def __init__(self, data):
self.data = data
def __eq__(self, value):
for a in range(0,6,5):
self.moveTopTo(self.getSortedList()[a])
value.moveTopTo(value.getSortedList()[a])
for b in range(4):
print(self.data, value.data)
... |
s451040921 | p02385 | u604774382 | 1432369157 | Python | Python | py | Runtime Error | 0 | 0 | 1764 | class Dice:
def __init__( self, nums ):
self.face = nums
def rolltoTopIndex( self, faceindex ):
if faceindex == 1:
self.roll( "N" )
elif faceindex == 2:
self.roll( "W" )
elif faceindex == 3:
self.roll( "E" )
elif faceindex == 4:
self.roll( "S" )
elif faceindex == 5:
self.roll( "NN" )
... |
s640480545 | p02385 | u633068244 | 1433166280 | Python | Python | py | Runtime Error | 0 | 0 | 1388 | import random
class Dice:
def __init__(self, top, front, right, left, back, bottom):
self.top, self.bottom = top, bottom
self.right, self.left = right, left
self.front, self.back = front, back
def rot(self, d):
if d == "N":
((self.top, self.back, self.bottom,... |
s832954422 | p02385 | u571345655 | 1435338160 | Python | Python | py | Runtime Error | 20 | 4360 | 1851 | # coding=utf-8
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 ... |
s089962440 | p02385 | u777299405 | 1435908172 | Python | Python3 | py | Runtime Error | 0 | 0 | 1387 | 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], se... |
s284357945 | p02385 | u512342660 | 1450968560 | Python | Python | py | Runtime Error | 10 | 6316 | 1715 | #-*- coding:utf-8 -*-
# for x in xrange(2):
rolls1 = raw_input().split()
rolls2 = raw_input().split()
testpare = (rolls1[0],rolls1[5])
testparerev = (rolls1[5],rolls1[0])
rolls2pare = [(rolls2[0],rolls2[5]),(rolls2[2],rolls2[3]),(rolls2[1],rolls2[4])]
#??????????????¢????????¢??§?????´??????????????????????????????????... |
s129652042 | p02385 | u512342660 | 1450968757 | Python | Python | py | Runtime Error | 10 | 6428 | 1728 | #-*- coding:utf-8 -*-
import sys
rolls1 = raw_input().split()
rolls2 = raw_input().split()
testpare = (rolls1[0],rolls1[5])
testparerev = (rolls1[5],rolls1[0])
rolls2pare = [(rolls2[0],rolls2[5]),(rolls2[2],rolls2[3]),(rolls2[1],rolls2[4])]
#??????????????¢????????¢??§?????´??????????????????????????????????¢????
#??¨?... |
s248653978 | p02385 | u512342660 | 1450969002 | Python | Python | py | Runtime Error | 10 | 6496 | 1728 | #-*- coding:utf-8 -*-
import sys
rolls1 = raw_input().split()
rolls2 = raw_input().split()
testpare = (rolls1[0],rolls1[5])
testparerev = (rolls1[5],rolls1[0])
rolls2pare = [(rolls2[0],rolls2[5]),(rolls2[2],rolls2[3]),(rolls2[1],rolls2[4])]
#??????????????¢????????¢??§?????´??????????????????????????????????¢????
#??¨?... |
s155073352 | p02385 | u896065593 | 1463705670 | Python | Python3 | py | Runtime Error | 0 | 0 | 2573 | # ?????¢??¨?????¢?????°?????????????????´?????¢?????°???????????????????????°??????
# ??????????????¢????????????????????????
class Dice:
def __init__(self):
self.top = 1
self.front = 2
self.right = 3
self.left = 4
self.back = 5
self.bottom = 6
# 2->1->5->6... |
s383031620 | p02385 | u896065593 | 1463706036 | Python | Python3 | py | Runtime Error | 0 | 0 | 2581 | # 2???????????????????????????????????????????????????????????°??????
# ??????????????¢????????????????????????
class Dice:
def __init__(self):
self.top = 1
self.front = 2
self.right = 3
self.left = 4
self.back = 5
self.bottom = 6
# 2->1->5->6
def turnS... |
s881848105 | p02385 | u589886885 | 1471873962 | Python | Python3 | py | Runtime Error | 0 | 0 | 1025 | class Dice():
def __init__(self, label):
self.label = label
def north(self):
self.change([2, 6, 3, 4, 1, 5])
def west(self):
self.change([3, 2, 6, 1, 5, 4])
def east(self):
self.change([4, 2, 1, 6, 5, 3])
def south(self):
self.change([5, 1, 3, 4, 6, 2])
... |
s168866061 | p02385 | u175111751 | 1477805122 | Python | Python3 | py | Runtime Error | 0 | 0 | 918 | import sys
class Dice:
def __init__(self, f):
self.f = f[:]
def to_top(self, index):
if index == 1:
self.roll('N')
elif index == 2:
self.roll('W')
elif index == 3:
self.roll('E')
elif index == 4:
self.roll('S')
elif... |
s068895229 | p02385 | u801346721 | 1479295769 | Python | Python3 | py | Runtime Error | 0 | 0 | 1644 | d = list(map(int, input().split()))
d2 = list(map(int, input().split()))
class Dice():
def __init__(self, d):
self.dice = d
def InsSN(self, one, two, five, six):
self.dice[0] = one
self.dice[1] = two
self.dice[4] = five
self.dice[5] = six
def InsWE(self, on... |
s693655843 | p02385 | u546285759 | 1481024555 | Python | Python3 | py | Runtime Error | 20 | 7740 | 1072 | 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)]
d1 = list(map(int, input().split()))
top, front, right = d1[0], d1[1], d1[2]
d2 = list(map(int, input().split()))
d1 = {v: k for k, v in enumerate(d1)}
d2 = {v: k for k, v in enumerate(d2... |
s165022350 | p02385 | u546285759 | 1481025217 | Python | Python3 | py | Runtime Error | 20 | 7900 | 1188 | 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)]
d1 = list(map(int, input().split()))
top, front, right = d1[0], d1[1], d1[2]
d2 = list(map(int, input().split()))
d1 = {v: k for k, v in enumerate(d1)}
d2 = {v: k for k, v in enumerate(d2... |
s374591764 | p02385 | u494314211 | 1481451102 | Python | Python3 | py | Runtime Error | 0 | 0 | 662 | d1=list(map(int,input().split()))
d2=list(map(int,input().split()))
class dice(object):
def __init__(self, d):
self.d = d
def roll(self,com):
a1,a2,a3,a4,a5,a6=self.d
if com=="E":
self.d = [a4,a2,a1,a6,a5,a3]
elif com=="W":
self.d = [a3,a2,a6,a1,a5,a4]
elif com=="S":
self.d = [a5,a1,a3,a4,a6,a2]
... |
s802986933 | p02385 | u771917453 | 1481474913 | Python | Python | py | Runtime Error | 10 | 6444 | 1824 | class Dice:
index_list_map = [[[-1],[2,3,4,5],[4,1,3,5],[1,4,2,5],[3,2,1,5],[-1]],
[[3,2,5,4],[-1],[0,5,3,4],[5,0,2,4],[-1],[2,3,0,4]],
[[1,4,5,3],[5,0,4,3],[-1],[-1],[0,5,1,3],[4,1,0,3]],
[[4,1,5,2],[0,5,4,2],[-1],[-1],[5,0,1,2],[1,4,0,2]],
... |
s889753614 | p02385 | u918276501 | 1484511069 | Python | Python3 | py | Runtime Error | 20 | 7512 | 323 | def ch3(t,s,e):
for j in R:
if e in j:
continue
return(0 if (e == R.index(j)) ^ ((j.index(t) - j.index(s)) %4 == 3) else 1)
break
R = ((1,2,4,3),(2,0,3,5),(0,1,5,4))
f,g = input().split(), input().split()
t,s,e,w,n,b = map(f.index, g)
print('Yes' if ch3(t,s,e)*ch3(w,n,b) else 'N... |
s062153169 | p02385 | u519227872 | 1486397831 | Python | Python3 | py | Runtime Error | 20 | 7732 | 1593 | class Dice:
def __init__(self,l1,l2,l3,l4,l5,l6):
self.l1 = l1
self.l2 = l2
self.l3 = l3
self.l4 = l4
self.l5 = l5
self.l6 = l6
self.top = 1
self.front = 2
self.right = 3
def get_top(self):
return eval("self." + 'l' + str(self.top)... |
s574096431 | p02385 | u782850499 | 1492330332 | Python | Python3 | py | Runtime Error | 20 | 7688 | 1377 | dice_a = list(map(int,input().split()))
dice_b = list(map(int,input().split()))
dice_a_roll = []
for i in range(6):
if dice_a[i] == dice_b[0]:
b_top = i + 1
if dice_a[i] == dice_b[1]:
b_front = i + 1
if b_top == 1:
order=[2,3,5,4,2,3,5]
for k in range(4):
if b_front == order[... |
s576503453 | p02385 | u395334793 | 1498719039 | Python | Python3 | py | Runtime Error | 0 | 0 | 265 | Dice1 = list(input().split())
Dice2 = list(input().split())
a = list
b = 1
for q in range(3):
if Dice1[q] == Dice2[q]:
a[q] = 1
else :
a[q] = -1
for q in range(3):
b = b*a[q]
if b == 1 :
print("Yes")
elif b == -1 :
print("No") |
s770885846 | p02385 | u299798926 | 1499572741 | Python | Python3 | py | Runtime Error | 20 | 7820 | 1121 | import sys
x1=[int(i)for i in input().split()]
x2=[int(i)for i in input().split()]
for i in range(6):
if x2[i]==x1[0]:
if x2[5-i]==x1[5]:
count=i
break
if x2[count]==x1[0] and x2[5-count]==x1[5]:
if count==0 or count==5:
if count==5:
for i in range(2):
... |
s121621224 | p02385 | u914146430 | 1500470595 | Python | Python3 | py | Runtime Error | 0 | 0 | 1028 | class dice2():
def __init__(self,men1,men2,men3,men4,men5,men6):
self.men=[men1,men2,men3,men4,men5,men6]
def find_num_rside(self,top,front):
t=self.men.index(top)+1
f=self.men.index(front)+1
if [t,f] in [[1,2],[2,6],[6,5],[5,1]]:
return self.men[3-1]#3
... |
s831648977 | p02385 | u150984829 | 1513326181 | Python | Python3 | py | Runtime Error | 20 | 5608 | 359 | d,e=[list(map(int,input().split()))for _ in range(2)]
m={0:'1234',1:'5230',2:'1504',3:'1054',4:'0245',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=list(''.join(g)*2)
for i in range(4):
if g[g.index(f[i])+1]!=f[i+1]:print('N... |
s711126795 | p02385 | u150984829 | 1513326882 | Python | Python3 | py | Runtime Error | 20 | 5604 | 353 | d,e=[list(map(int,input().split()))for _ in range(2)]
m={0:'1234',1:'5230',2:'1504',3:'1054',4:'0245',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=list(''.join(g)*2)
for i in range(4):
if g[g.index(f[i])+1]!=f[i+1]:print('N... |
s938636870 | p02385 | u150984829 | 1513327291 | 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:'0245',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 ... |
s524062250 | p02385 | u150984829 | 1513327678 | 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 ... |
s680972996 | p02385 | u150984829 | 1513329597 | Python | Python3 | py | Runtime Error | 0 | 0 | 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]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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.