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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
s355929432 | p03911 | u350997995 | 1566592495 | Python | Python (3.4.3) | py | Runtime Error | 589 | 37764 | 354 | N,M = map(int,input().split())
R = [[] for _ in range(N+M)]
for i in range(N):
L = list(map(lambda x:int(x)-1+N,input().split()))[1:]
R[i]+=L
for l in L:
R[l].append(i)
A = [0]*(N+M)
def f(v):
global R,A
A[v] = 1
for c in R[v]:
if c<N and A[c]==1: continue
f(c)
f(0)
print... |
s981820060 | p03911 | u509368316 | 1565835769 | Python | Python (3.4.3) | py | Runtime Error | 399 | 25804 | 922 | N,M=map(int,input().split())
L=[list(map(int,input().split())) for i in range(N)]
import sys
sys.setrecursionlimit(10**5)
class UnionFind:
def __init__(self,N):
self.Parent=[-1]*N
def unite(self,m,n):
rm=self.root(m)
rn=self.root(n)
if rm==rn:
return False
els... |
s763220130 | p03911 | u509368316 | 1565835225 | Python | Python (3.4.3) | py | Runtime Error | 390 | 25828 | 887 | N,M=map(int,input().split())
L=[list(map(int,input().split())) for i in range(N)]
class UnionFind:
def __init__(self,N):
self.Parent=[-1]*N
def unite(self,m,n):
rm=self.root(m)
rn=self.root(n)
if rm==rn:
return False
else:
if self.size(rm)<self.siz... |
s919456798 | p03911 | u623819879 | 1561657182 | Python | Python (3.4.3) | py | Runtime Error | 638 | 37040 | 598 | n,m=map(int,input().split())
g=[[] for _ in range((n+m))]
for i in range(n):
a=[int(i)-1 for i in input().split()][1:]
for l in a:
g[i].append(n+l)
g[n+l].append(i)
par=[i for i in range(n+m)]
def root(x):
if x==par[x]:
return x
else:
par[x]=root(par[x])
return ... |
s772527701 | p03911 | u623819879 | 1561657088 | Python | Python (3.4.3) | py | Runtime Error | 634 | 37012 | 596 | n,m=map(int,input().split())
g=[[] for _ in range((n+m))]
for i in range(n):
a=[int(i)-1 for i in input().split()][1:]
for l in a:
g[i].append(l)
g[n+l].append(i)
par=[i for i in range(n+m)]
def root(x):
if x==par[x]:
return x
else:
par[x]=root(par[x])
return pa... |
s913650455 | p03911 | u692632484 | 1546320752 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 2502 | #include<iostream>
#include <vector>
#include <list>
#include<stack>
#include<queue>
#include<array>
#include <set>
#include<map>
#include<string>
#include<stdlib.h>
#include<memory>
#include<algorithm>
#include <functional>
#include<math.h>
#include<fstream>
#include<iomanip>
using namespace std;
using ll = long... |
s484369343 | p03911 | u690536347 | 1536247652 | Python | Python (3.4.3) | py | Runtime Error | 498 | 36880 | 527 | n,m=map(int,input().split())
f=lambda x:int(x)-1
langs=[[] for _ in range(m)]
speakers=[[] for _ in range(n)]
used_langs=[False]*m
used_speakers=[False]*n
for i in range(n):
*l,=map(f,input().split()[1:])
speakers[i].extend(l)
for j in l:
langs[j].append(i)
def dfs(n):
if used_speakers[n]:
return
u... |
s594067364 | p03911 | u569349339 | 1480211177 | Python | Python (3.4.3) | py | Runtime Error | 675 | 45284 | 657 | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import sys
N, M = map(int, input().split())
L = [list(map(int, input().split()))[1:] for _ in range(N)]
g = [[] for _ in ... |
s767151348 | p03911 | u569349339 | 1480211073 | Python | Python (3.4.3) | py | Runtime Error | 592 | 44516 | 656 | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import sys
N, M = map(int, input().split())
L = [list(map(int, input().split()))[1:] for _ in range(N)]
g = [[] for _ in ... |
s465494077 | p03911 | u569349339 | 1480211006 | Python | Python (3.4.3) | py | Runtime Error | 569 | 44548 | 655 | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import sys
N, M = map(int, input().split())
L = [list(map(int, input().split()))[1:] for _ in range(N)]
g = [[] for _ in ... |
s135204736 | p03911 | u569349339 | 1480210891 | Python | Python (3.4.3) | py | Runtime Error | 587 | 44548 | 657 | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import sys
N, M = map(int, input().split())
L = [list(map(int, input().split()))[1:] for _ in range(N)]
g = [[] for _ in ... |
s690851700 | p03911 | u569349339 | 1480206349 | Python | Python (3.4.3) | py | Runtime Error | 424 | 16916 | 760 | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import sys
N, M = map(int, input().split())
L = [list(map(int, input().split()))[1:] for _ in range(N)]
g = [[] for _ in ... |
s509930864 | p03911 | u569349339 | 1480206185 | Python | Python (3.4.3) | py | Runtime Error | 660 | 43780 | 764 | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import sys
N, M = map(int, input().split())
L = [list(map(int, input().split()))[1:] for _ in range(N)]
g = [[] for _ in ... |
s532984883 | p03911 | u569349339 | 1480205926 | Python | Python (3.4.3) | py | Runtime Error | 668 | 43780 | 861 | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import sys
N, M = map(int, input().split())
# if N > 1000 and M > 1000:
# print("YES")
# sys.exit()
L = [list(map... |
s143902208 | p03911 | u133038626 | 1480183245 | Python | Python (3.4.3) | py | Runtime Error | 718 | 30272 | 538 | # coding: utf-8
import collections
def dfs(i):
if visited[i] == 1:
return
visited[i] = 1
for j in speakers[i]:
for k in langs[j]:
dfs(k)
N, M = map(int, input().split())
langs = collections.defaultdict(list)
speakers = [[] for _ in range(N)]
for i in range(N):
ls = list... |
s133665905 | p03912 | u489959379 | 1601509374 | Python | Python (3.8.2) | py | Runtime Error | 26 | 8920 | 1137 | import sys
from collections import defaultdict(int)
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7
def resolve():
n, m = map(int, input().split())
X = list(map(int, input().split()))
MOD = [defaultdict(int) for _ in range(m + 1)]
cnt = defaultdict(in... |
s387572454 | p03912 | u707124227 | 1595614462 | Python | Python (3.8.2) | py | Runtime Error | 83 | 37568 | 770 | def main():
n,m=map(int,input().split())
x=list(map(int,input().split()))
xmod=[y%m for y in x]
from collections import Counter
cx=dict(Counter(x))
cxmod=dict(Counter(xmod))
ans1,ans2=0,0 # ams1:m倍になるペア、ans2:同数のペア。ans1からもとめる
for k in cxmod.keys():
if k==0:
ans1+=cxmod[k]//2
cxmod[k]-=2*(... |
s840434811 | p03912 | u190405389 | 1595300407 | Python | PyPy3 (7.3.0) | py | Runtime Error | 115 | 92724 | 818 | import sys
sys.setrecursionlimit(10**7)
readline = sys.stdin.buffer.readline
def readstr():return readline().rstrip().decode()
def readstrs():return list(readline().decode().split())
def readint():return int(readline())
def readints():return list(map(int,readline().split()))
def printrows(x):print('\n'.join(map(str,x)... |
s944420505 | p03912 | u145600939 | 1588565331 | Python | Python (3.4.3) | py | Runtime Error | 213 | 27248 | 822 | n,m = map(int,input().split())
X = list(map(int,input().split()))
mod = [[0,0] for _ in range(n)]
d = {}
for x in X:
if x not in d.keys():d[x] = 0
d[x] += 1
for k,v in d.items():
mod[k%m][0] += v//2
mod[k%m][1] += v%2
ans = 0
for i in range(m//2+1):
if i == 0 or i == m-i:
ans += mod[i][1]//2... |
s170818638 | p03912 | u814986259 | 1582084933 | Python | Python (3.4.3) | py | Runtime Error | 1107 | 61456 | 962 | import collections
N, M = map(int, input().split())
X = list(map(int, input().split()))
table = collections.defaultdict(list)
for x in X:
table[x % M].append(x)
Count = [None]*N
for i in range(M):
table[i].sort(key=lambda x: table[x].count(x), reverse=True)
Count[i] = collections.Counter(table[i]).values()... |
s319213127 | p03912 | u814986259 | 1582084610 | Python | Python (3.4.3) | py | Runtime Error | 1118 | 61456 | 827 | import collections
N, M = map(int, input().split())
X = list(map(int, input().split()))
table = collections.defaultdict(list)
for x in X:
table[x % M].append(x)
Count = [None]*N
for i in range(M):
table[i].sort(key=lambda x: table[x].count(x), reverse=True)
Count[i] = collections.Counter(table[i]).values()... |
s345287265 | p03912 | u325227960 | 1579288583 | Python | PyPy3 (2.4.0) | py | Runtime Error | 237 | 54416 | 558 | import sys
input = sys.stdin.readline
n, m = map(int,input().split())
Y = list(map(int,input().split()))
l = max(Y) + 1
X = [0] * l
for i in range(n):
X[Y[i]] += 1
# print(X)
U = [[0] * m for i in range(2)]
for i in range(l):
a = X[i] // 2
U[0][i % m] += a
A = [0] * m
for i in range(l):
A[i % m] += ... |
s311553900 | p03912 | u878326845 | 1577774825 | Python | Python (3.4.3) | py | Runtime Error | 201 | 14220 | 660 | from collections import Counter
n,m = map(int, input().split())
a = list(map(int, input().split()))
c = [0]*100001
b = [a[i]%m for i in range(n)]
rem = [0]*m
for i in range(n):
rem[b[i]] += 1
c[a[i]] += 1
ans = 0
for i in range(m//2+1):
if i == 0 or i*2 == m:
ans += rem[i]//2
rem[i] -= rem[i... |
s380051565 | p03912 | u201234972 | 1561065084 | Python | PyPy3 (2.4.0) | py | Runtime Error | 322 | 119660 | 863 | #import sys
#input = sys.stdin.readline
from collections import defaultdict, deque
def main():
N, M = map( int, input().split())
X = list( map( int, input().split()))
Y = [deque() for _ in range(M)]
modM = [0]*M
for i in range(N):
Y[X[i]%M].append(X[i])
modM[X[i]%M] += 1
ans = 0
... |
s642402484 | p03912 | u201234972 | 1561065072 | Python | Python (3.4.3) | py | Runtime Error | 172 | 71652 | 863 | #import sys
#input = sys.stdin.readline
from collections import defaultdict, deque
def main():
N, M = map( int, input().split())
X = list( map( int, input().split()))
Y = [deque() for _ in range(M)]
modM = [0]*M
for i in range(N):
Y[X[i]%M].append(X[i])
modM[X[i]%M] += 1
ans = 0
... |
s647563023 | p03912 | u506127000 | 1480188874 | Python | PyPy3 (2.4.0) | py | Runtime Error | 290 | 54380 | 749 | MAX_X = 10 ** 5
def main():
N, M = [int(i) for i in input().split()]
X = [0] * (MAX_X + 1)
for i in map(int, input().split()):
X[i] += 1
Y = [sum(X[i::M]) for i in range(min(M, N, MAX_X))]
# Mの倍数
ans = Y[0] // 2
Y[0] = 0
# M%2==0のM/2
if M % 2 == 0:
ans += Y[M//2] // ... |
s395261314 | p03913 | u488401358 | 1593841026 | Python | PyPy3 (7.3.0) | py | Runtime Error | 94 | 74748 | 245 | N,A=map(int,input().split())
ans=N
for n in range(1,41):
for i in range(2*n,N**(1/n)+100):
test=i+n*A
q=i//n
r=i%n
prod=pow(q,n-r)*pow(q+1,r)
test+=(N-1)//prod+1
ans=min(ans,test)
print(ans)
|
s807364060 | p03913 | u878326845 | 1591241575 | Python | PyPy3 (2.4.0) | py | Runtime Error | 179 | 38512 | 704 | n,a = map(int,input().split())
if n == 1:
print(1)
exit()
l = -1
r = 10**12+1
#n <= x**(k-i)*(x-1)**iのk-iを返す
def border(x,k):
if k >= 40:
return (n-1).bit_length()
else:
L = 0
R = k
while L+1 < R:
M = (L+R)//2
if x**(k-M)*(x-1)**(M) < n:
R = M
else:
L = M
re... |
s453416756 | p03913 | u686900515 | 1590066613 | Python | PyPy3 (2.4.0) | py | Runtime Error | 174 | 38736 | 748 | import sys
readline = sys.stdin.readline
def check(x):
if x - 50*A >= 100:
return N+1
right = x//A
left = 1
while abs(right - left) > 2:
med1 = (left*2+right)//3
med2 = (left+right*2)//3
if calc(med1, x-(med1-1)*A) < calc(med2, x-(med2-1)*A):
left = med1
... |
s988560145 | p03913 | u296290704 | 1528864613 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3064 | 446 | # seishin.py
N, A = map(int, input().split())
ans = N
for k in range(1, 41):
left = 0; right = N+1
while left+1 < right:
mid = (left + right) // 2
if mid**(k+1) < N:
left = mid
else:
right = mid
m = right
v = (m-1)**(k+1)
for i in range(k+1):
... |
s640011246 | p03913 | u506127000 | 1480290511 | Python | PyPy3 (2.4.0) | py | Runtime Error | 209 | 38384 | 367 | import sys
from math import ceil
N, A = [int(i) for i in input().split()]
if N > 10 ** 6 or A > 10 ** 6:
print(-1)
sys.exit()
dp = [float("inf")] * (N+1)
dp[1] = 0
for i in range(1, N//2+1):
for n, j in enumerate(range(i+i, N+1, i), start=2):
dp[j] = min(dp[j], dp[i]+n+A)
ans = min(dp[i]+ceil(N/i) f... |
s211710571 | p03913 | u506127000 | 1480194178 | Python | PyPy3 (2.4.0) | py | Runtime Error | 1965 | 142196 | 354 | import sys
from math import ceil
N, A = [int(i) for i in input().split()]
if N > 10 ** 6 or A > 10 ** 6:
raise
dp = [float("inf")] * (N+1)
dp[1] = 0
ans = float("inf")
for i in range(1, N//2+1):
for n, j in enumerate(range(i+i, N+1, i), start=2):
dp[j] = min(dp[j], dp[i]+n+A)
ans = min(dp[i]+ceil(N/i) f... |
s533524414 | p03913 | u506127000 | 1480191799 | Python | PyPy3 (2.4.0) | py | Runtime Error | 215 | 38640 | 365 | import sys
from math import ceil
if N > 10 ** 6 or A > 10 ** 6:
print(-1)
sys.exit()
N, A = [int(i) for i in input().split()]
dp = [float("inf")] * N
dp[1] = 0
for i in range(1, N//2+1):
for n, j in enumerate(range(i+i, N//2+1, i), start=2):
dp[j] = min(dp[j], dp[i]+n+A)
ans = min(dp[i]+ceil(N/i) fo... |
s344460356 | p03913 | u296290704 | 1480189572 | Python | PyPy2 (5.6.0) | py | Runtime Error | 373 | 23020 | 431 | # encoding: utf-8
n, a = map(int, raw_input().split())
if n>10**7 or a >= 10**7:
exit(1)
memo = [-1]*(n+1)
# 残りx個を貯めるために最小の時間を返す予定
def dfs(x):
if x == 0:
return 0
if memo[x] != -1:
return memo[x]
i = 0
res = x
for i in xrange(2, x+1):
# i-sec待つ
res = min(res, dfs... |
s595017081 | p03913 | u478870821 | 1480188605 | Python | Python (3.4.3) | py | Runtime Error | 619 | 43108 | 554 | from sys import exit, setrecursionlimit
from functools import reduce
from itertools import *
from collections import defaultdict
from bisect import bisect
def read():
return int(input())
def reads():
return [int(x) for x in input().split()]
(N, A) = reads()
assert(N <= 10**6 and A <= 10**6)
c = [0] * (N+3)
fo... |
s603109063 | p03913 | u478870821 | 1480188383 | Python | Python (3.4.3) | py | Runtime Error | 592 | 43104 | 580 | from sys import exit, setrecursionlimit
from functools import reduce
from itertools import *
from collections import defaultdict
from bisect import bisect
def read():
return int(input())
def reads():
return [int(x) for x in input().split()]
setrecursionlimit(1000000)
(N, A) = reads()
assert(N <= 10**6 and A <=... |
s087227460 | p03919 | u468972478 | 1598108296 | Python | Python (3.8.2) | py | Runtime Error | 30 | 9124 | 196 | h, w = map(int, input().split())
a = [input().split() for i in range(h)]
for i in range(h):
for j in range(w):
if a[i][w] == "snuke":
print(chr(ord("A") + j) + str(i + 1))
exit() |
s973692069 | p03919 | u468972478 | 1598108214 | Python | Python (3.8.2) | py | Runtime Error | 20 | 8988 | 193 | h, w = map(int, input().split())
a = [input().split() for i in range(h)]
for i in range(h):
for j in range(w):
a[i][j] == "snuke":
print(chr(ord("A") + j) + str(i + 1))
exit() |
s633834091 | p03919 | u468972478 | 1598108161 | Python | Python (3.8.2) | py | Runtime Error | 26 | 8948 | 193 | h, w = map(int, input().split())
a = [input().split() for i in range(h)]
for i in range(h):
for j in range(w):
a[i][w] == "snuke":
print(chr(ord("A") + j) + str(i + 1))
exit() |
s868159665 | p03919 | u088488125 | 1593614286 | Python | Python (3.8.2) | py | Runtime Error | 23 | 9080 | 211 | h,w=map(int, input().split())
s=[list(input().split()) for i in range(h)]
alp="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
for i in range(h):
for j in range(w):
if s[i][j]=="snuke":
print(alp[j+1]+(i+1))
break |
s392522825 | p03919 | u163320134 | 1587622330 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 229 | h,w=map(int,input().split())
board=[list(map(int,input().split())) for _ in range(h)]
pos="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
for i in range(h):
for j in range(w):
if board[i][j]=="snuke":
print(pos[j]+str(i+1))
exit() |
s213402630 | p03919 | u373047809 | 1586970086 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 110 | _, w, *s = open(0).read().split()
a, b = divmod(s.index("snuke"), int(w))
print("ABCDEFGHIJJ"[b], a+1, sep="") |
s670837696 | p03919 | u702786238 | 1584978995 | Python | PyPy3 (2.4.0) | py | Runtime Error | 165 | 38256 | 271 | H, W = map(int, input().split())
for i in range(H):
s = input().split()
if W != 1:
if len(set(s)) == 2:
row = i+1
col = 65+s.index('snuke')
break
else:
if s == ["snuke"]:
row = i+1
col = 65
print("{}{}".format(chr(col), row))
|
s189602841 | p03919 | u702786238 | 1584978837 | Python | PyPy3 (2.4.0) | py | Runtime Error | 187 | 38256 | 187 | H, W = map(int, input().split())
for i in range(H):
s = input().split()
if len(set(s)) == 2:
row = i+1
col = 65+s.index('snuke')
break
print("{}{}".format(chr(col), row)) |
s588187247 | p03919 | u298297089 | 1581459321 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 167 | h,w = map(int , input().split())
alf = 'ABCDEFGHIJKLMN'
for i in range(h):
for j,s in enumerate(input().split()):
if s == 'snuke':
print(alf[j] + str(i+1)) |
s595688796 | p03919 | u995062424 | 1578884702 | Python | Python (3.4.3) | py | Runtime Error | 25 | 3768 | 347 | from string import *
h,w=map(int,input().split())
s =[None] * h
for i in range(h):
s[i] = [None] * w
for j in range(w):
s[i][j] = input()
for i in range(h):
for j in range(w):
if(s[i][j]=='snuke'):
idx1=ascii_lowercase[i].swapcase()
idx2=str(j+1)
print(i... |
s188281925 | p03919 | u181215519 | 1576786496 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 269 | H, W = map( int, input().split() )
s = [ [ map( str, input().split() ) ] for i in range(H) ]
for i in range(H) :
for j in range(W) :
if s[i][j] == "snuke" :
w = chr( i + ord( "A" ) )
h = i + 1
exit()
print( w + str( h ) ) |
s898757034 | p03919 | u181215519 | 1576786440 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 269 | H, W = map( int, input().split() )
s = [ [ map( str, input().split() ) ] for i in range(H) ]
for i in range(H) :
for j in range(W) :
if "snuke" in s[i][j] :
w = chr( i + ord( "A" ) )
h = i + 1
exit()
print( w + str( h ) ) |
s377856995 | p03919 | u181215519 | 1576785447 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 259 | H, W = map( int, input().split() )
abc = [ chr(i) for i in range( 65, 65+26 ) ]
for i in range(H) :
s = list( map( str, input().split() ) )
if "snuke" in s :
w = abc[ s.index[ "snuke" ] ]
h = i + 1
break
print( w + str( h ) ) |
s381381638 | p03919 | u181215519 | 1576785324 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 297 | H, W = map( int, input().split() )
abc = [ chr(i) for i in range( 65, 65+26 ) ]
for i in range(H) :
s = list( map( str, input().split() ) )
for j in range(W) :
if "snuke" in s :
w = abc[ s.index[ "snuke" ] ]
h = i + 1
exit()
print( w + str( h ) ) |
s606426437 | p03919 | u181215519 | 1576785250 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 296 | H, W = map( int, input().split() )
abc = [ chr(i) for i in range( 65, 65+26 ) ]
for i in range(H) :
s = list( map( str, input().split() ) )
for j in range(W) :
if "snuke" in s :
w = abc[ s.index[ "snuke" ] ]
h = i + 1
break
print( w + str( h ) ) |
s908126362 | p03919 | u102960641 | 1574783869 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3056 | 241 | h,w = map(int, input().split())
s = [list(map(int, input().split())) for i in range(h)]
for key_i,i in enumerate(s):
key_i += 1
for key_j,j in enumerate(i):
if j == "snuke":
print(chr(ord("A")+key_j)+str(key_i))
exit()
|
s078349426 | p03919 | u303039933 | 1569164071 | Python | PyPy3 (2.4.0) | py | Runtime Error | 181 | 38512 | 410 | from sys import stdin
def readString() :
return stdin.readline().rstrip()
def solve() :
H,W = [int(x) for x in stdin.readline().rstrip().split()]
table = [stdin.readline().rstrip().split() for _ in range(H)]
l = [x for x in "ABCDEFGHIJK"]
for h in range(0,H) :
for w in range(0,W) :
... |
s885869788 | p03919 | u259334183 | 1566688123 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 193 | h,w=map(int,input().split())
b=['A','B','C','D','E','F','G','H']
for k in range(h):
a=list(input().split())
for l in range(w):
if a[l]=='snuke':
print(b[l]+str(k+1)) |
s988363523 | p03919 | u977193988 | 1561681452 | Python | Python (3.4.3) | py | Runtime Error | 20 | 3188 | 311 | import sys
h,w=map(int,input().split())
A=['A','B','C','D','E','F','G','H','I','J']
s=[]
for i in range(h):
s.append(list(map(str,input().split())))
for i in range(h):
for j in range(w):
if s[i][j]=='snuke':
a=A[j]
b=str(i+1)
print(a+b)
sys.exit() |
s500444308 | p03919 | u497046426 | 1561613394 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 220 | from itertools import product
H, W = map(int, input().split())
table = [input().split() for _ in range(H)]
for i, j in product(range(H), range(W)):
if table[i][j] == 'snuke': print('ABCDEFGHIJ'[j] + str(i+1)); break |
s936823793 | p03919 | u371409687 | 1561148143 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 181 | h,w=map(int,input().split())
s=[input().split() for _ in range(w)]
for i in range(w):
for j in range(h):
if s[i][j]=="snuke":
print(chr(ord("A")+j)+str(i+1)) |
s757872717 | p03919 | u371409687 | 1561148036 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 181 | h,w=map(int,input().split())
s=[input().split() for _ in range(w)]
for i in range(w):
for j in range(h):
if s[i][j]=="snuke":
print(chr(ord("A")+j)+str(i+1)) |
s505647863 | p03919 | u507116804 | 1557023942 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 6 | あ」 |
s869071348 | p03919 | u331464808 | 1556567190 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 145 | h,w = map(int,input(),split())
for i in range(h):
a = input().split()
if "snuke" in a:
ans = chr(ord('A') + j)+str(i)
print(ans) |
s202029301 | p03919 | u331464808 | 1556567120 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 179 | h,w = map(int,input(),split())
for i in range(h):
a = input().split()
for j in range(w):
if a[j] == "snuke":
ans = chr(ord('A') + j)+str(i)
print(ans) |
s482880472 | p03919 | u331464808 | 1556567044 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 186 | h,w = map(int,input(),split())
for i in range(h):
a = input().split()
for j in range(w):
if a[j] == "snuke":
print(chr(ord('A') + j)+str(i))
break |
s828289262 | p03919 | u619819312 | 1556023786 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 377 | import sys
sys.setrecursionlimit(10**6)
n,m=map(int,input().split())
a=[[]for i in range(n+m)]
for i in range(n):
s=list(map(int,input().split()))
for j in s[1:]:
a[i].append(j)
a[n+j-1].append(i)
t=[False]*n
def g(x):
t[x]=True
for i in a[x]:
if not t[x]:
g(j... |
s882642945 | p03919 | u280512618 | 1553957181 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 157 | h,w=map(int, input().split())
for i in range(h):
t=input().split().index('snuke')
if t<0:
continue
print('%s%d' % (chr(t+ord('A')), i+1))
quit(0) |
s612474683 | p03919 | u280512618 | 1553957084 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 156 | h,w=map(int, input().split())
for i in range(h):
t=input().split().find('snuke')
if t<0:
continue
print('%s%d' % (chr(t+ord('A')), i+1))
quit(0) |
s012446781 | p03919 | u859897687 | 1553862023 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 142 | h,w=map(int,input().split())
for i in range(h):
a=input()
if 'snuke' in a:
b=a.find('snuke')
break
print(chr(ord('A')+b)+str(a+1)) |
s336754693 | p03919 | u379692329 | 1553318397 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 277 | from itertools import product
H, W = map(int, input().split())
L = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
S = [[str(_) for _ in input().split()] for _ in range(W)]
for i, j in product(range(H), range(W)):
if S[i][j] == "snuke":
break
res = L[i] + str(j+1)
print(res) |
s764592316 | p03919 | u782654209 | 1553086534 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 214 | H,W=map(int,input().split(' '))
S=[input().split(' ') for i in range(H)]
row=i+1 if 'snuke' in S[i] else continue for i in range(H)
col='ABCDEFGHIJKLMNOPQRSTUVWXYZ'[S[row-1].index('snuke')]
print(str(col)+str(row)) |
s491023419 | p03919 | u782654209 | 1553086490 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 200 | H,W=map(int,input().split(' '))
S=[input().split(' ') for i in range(H)]
row=i+1 if 'snuke' in S[i] for i in range(H)
col='ABCDEFGHIJKLMNOPQRSTUVWXYZ'[S[row-1].index('snuke')]
print(str(col)+str(row)) |
s194677217 | p03919 | u118642796 | 1552622561 | Python | PyPy3 (2.4.0) | py | Runtime Error | 165 | 38256 | 194 | H,W = map(int,input().split())
S = [[i for i in input().split()] for_ in range(H)]
for h in range(H):
for w in range(W):
if S[h][w] == "snuke":
break
print(chr(ord(A)-1+w) + str(h)) |
s401302882 | p03919 | u887207211 | 1552444666 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 223 | H, W = map(int,input().split())
S = [input().split() for _ in range(H)]
w = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J"]
for i in range(H):
for j in range(W):
if(S[i][j] == "snuke"):
print(w[j]+str(i+1)) |
s039207905 | p03919 | u543954314 | 1552227574 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 245 | h, w = map(int, input().split())
s = [input().split() for _ in range(h)]
al = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
for i in range(h):
for j in range(w):
if s[i][j] = "snuke":
print("{}{}".format(al[i], j+1))
exit()
else:
pass |
s217452227 | p03919 | u785578220 | 1551243004 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 214 | N, M = map(int, input().split())
k = []
for i in range(N):
t = list(map(str, input().split()))
for j in range(W):
if t[j] == "snuke":p = [i,j]
abc = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
print(abc[p[1]]+str(p[0]+1)) |
s978274078 | p03919 | u785578220 | 1551242957 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 215 | N, M = map(int, input().split())
k = []
for i in range(N):
t = list(map(int, input().split()))
for j in range(W):
if t[j] == "snuke":p = [i,j]
abc = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
print(abc[p[1]]+str(p[0]))
|
s151507750 | p03919 | u367130284 | 1551172509 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 119 | h,w,*a=open(0).read().split();b=a.index("snuke");print([chr(i)for i in range(65,65+int(h))][b%int(w)]+str(b//int(w)+1)) |
s566584108 | p03919 | u375616706 | 1548990458 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 279 | def sigma(N):
return N*(N-1)//2
def find_max(N):
for i in range(N+1):
if sigma(i) > N:
return i
def solve(N):
Y = find_max(N)
rem = sigma(Y)-N
for i in range(1, Y):
if i != rem:
print(i)
N = int(input())
solve(N)
|
s055279006 | p03919 | u620084012 | 1527097962 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3060 | 225 | H, W = map(int, input().split())
S = [input().split() for k in range(H)]
A = "ABCDEFGHIJ"
for k in range(H):
for l in range(W):
if S[k][l]=="snuke":
print("".join([A[l],str(k+1)]))
exit(0) |
s986907285 | p03919 | u766407523 | 1525404515 | Python | Python (3.4.3) | py | Runtime Error | 30 | 3900 | 271 | import string
def inpl(): return list(map(int, input().split()))
H, W = inpl()
a = []
for i in range(H):
a.append(inpl())
for i in range(H):
for j in range(W):
if a[i][j] == 'snuke':
print(string.ascii_lowercase[j]+str(i+1))
break |
s408535853 | p03919 | u978494963 | 1523228966 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 287 | import sys
h,w = map(int, input().split(" "))
xnames = [chr(x) for x in range(ord("A"),ord("A")+w+1)]
ynames = [x for x in range(1,h+1)]
for y in range(h):
for x in range(w):
s = input()
if s == "snuke":
print(xnames[x]+ynames[y])
sys.exit(0) |
s556209568 | p03919 | u978494963 | 1523228940 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 286 | import sys
h,w = map(int, input().split(" "))
xnames = [chr(x) for x in range(ord("A"),ord("A")+w+1)]
ynames = [x for x in range(1,h+1)]
for y in range(h):
for x in range(w):
s = input()
if s == "snuke":
print(xnames[x]+ynames[y])
sys.exit() |
s753418242 | p03919 | u030726788 | 1521574154 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 183 | h,w=map(int,input().split())
alh="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
for i in h:
s=list(input().split())
if("snuke" in s):
ind=s.index("snuke")
print(alh[ind]+str(i+1))
break |
s119191501 | p03919 | u651925006 | 1514923588 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 141 | h,w=map(int,input())
for i in range(h):
s=list(input().split())
for j in range(w):
if s[j]=='snuke':
print(chr(65+j)+str(i+1))
|
s699231882 | p03919 | u651925006 | 1514923491 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 141 | h,w=map(int,input())
for i in range(h):
s=list(input().split())
for j in range(w):
if s[j]=='snuke':
print(chr(97+j)+str(i+1))
|
s034442272 | p03919 | u651925006 | 1514923456 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 141 | n,m=map(int,input())
for i in range(h):
s=list(input().split())
for j in range(w):
if s[j]=='snuke':
print(chr(97+j)+str(i+1))
|
s689964271 | p03919 | u692050063 | 1491279320 | Python | Python (2.7.6) | py | Runtime Error | 13 | 2692 | 165 | [H, W] = raw_input().split(' ')
for i in range(H):
for index, string in enumerate(raw_input.split(' ')):
if string == 'snuke':
print i, index |
s130298496 | p03919 | u123756661 | 1480189981 | Python | PyPy2 (5.6.0) | py | Runtime Error | 73 | 11376 | 301 | l=[]
for i in range(1,5001):
if i%2==0:
l.append((1+i)*(i/2))
else:
l.append((1+i)*(i/2)+(i+1)/2)
n=int(raw_input())
if n in l:
for i in range(1,l.index(n)+2):
print i
chk=bisect.bisect_right(l,n)
tmp=l[chk]
for i in range(1,chk+2):
if i!=tmp-n:
print i |
s554943246 | p03919 | u174620969 | 1480185691 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3064 | 292 | import sys
#f = open('input.txt')
# f = input()
N = int(f)
out = []
sum = 0
for i in range(0, N+1):
sum = sum + i
out.append(i)
if sum > N:
r = sum - N
out.remove(r)
break
out.remove(0)
for n in out:
print(n)
# print(' '.join(map(str, out))) |
s163863541 | p03919 | u174620969 | 1480185118 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3064 | 273 | import sys
#f = open('input.txt')
f = input()
N = int(f)
out = []
sum = 0
for i in range(1, N):
sum = sum + i
out.append(i)
if sum > N:
r = sum - N
out.remove(r)
break
for n in out:
print(n)
# print(' '.join(map(str, out))) |
s867180935 | p03919 | u174620969 | 1480184919 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3064 | 291 | #!/bin/python3
import sys
# f = open('input.txt')
f = input()
N = int(f)
out = []
sum = 0
for i in range(1, N):
sum = sum + i
out.append(i)
if sum > N:
r = sum - N
out.remove(r)
break
for n in out:
print(n)
# print(' '.join(map(str, out))) |
s408546263 | p03919 | u237168895 | 1480183781 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3064 | 223 | a_,b_ = map(int, (raw_input().strip().split(" ")))
foo = []
for i,a in enumerate(range(a_)):
foo = raw_input().strip().split(" ")
for j in range(b_):
if foo[j] == 'snuke':
print('A'+ str(i + 1)) |
s039419346 | p03919 | u237168895 | 1480183568 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3064 | 231 | a_,b_ = map(int, (raw_input().strip().split(" ")))
foo = []
for i,a in enumerate(range(a_)):
foo = raw_input().strip().split(" ")
for j in range(b_):
if foo[j] == 'snuke':
print(chr(65 + j) + str(i + 1)) |
s257972213 | p03919 | u237168895 | 1480182228 | Python | Python (3.4.3) | py | Runtime Error | 21 | 3064 | 237 | a_,b_ = map(int, (raw_input().strip().split(" ")))
foo = []
for i,a in enumerate(range(a_)):
foo = raw_input().strip().split(" ")
for j in range(b_):
if foo[j] == 'snuke':
print(chr(65 + j) + str(i + 1))
|
s471793761 | p03919 | u471797506 | 1480181884 | Python | Python (2.7.6) | py | Runtime Error | 16 | 2572 | 265 | alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
H, W = map(int, raw_input().split())
S = [raw_input().split() for i in xrange(H)]
for h in xrange(H):
for w in xrange(W):
if S[h][w] == "snuke":
print alpha[w] + str(h + 1)
exit()
torii@xps45:~/roiti46/procon/Contest/2 |
s449829203 | p03920 | u668785999 | 1587083448 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3572 | 163 | N = int(input())
vec = []
k = 0
sum = 0
while(k**2 + k < 2*N):
k += 1
sum += k
vec.append(k)
vec.remove(sum - N)
for i in range(len(vec)):
print(vec[i]) |
s978072819 | p03920 | u404290207 | 1585195198 | Python | PyPy3 (2.4.0) | py | Runtime Error | 293 | 67412 | 1438 | import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect... |
s834075229 | p03920 | u303039933 | 1583983496 | Python | PyPy3 (2.4.0) | py | Runtime Error | 172 | 38384 | 2671 | cv# -*- coding: utf-8 -*-
import sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from functools import lru_cache
import bisect
import re
import queue
class Scanner():
@staticmethod
def int():
... |
s616952688 | p03920 | u227082700 | 1563309222 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 64 | n=int(input());print(int(round(int(input()))*2)+1if n!=1else"1") |
s312552574 | p03920 | u543954314 | 1553545386 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 150 | n = int(input())
k = int((n*2)**.5)
while k*(k+1)//2 < n:
k += 1
l = [range(1,k+1)]
if k*(k+1)//2-n:
l.remove(k*(k+1)//2-n)
for i in l:
print(l) |
s728202191 | p03920 | u375616706 | 1548990469 | Python | Python (3.4.3) | py | Runtime Error | 21 | 3316 | 279 | def sigma(N):
return N*(N-1)//2
def find_max(N):
for i in range(N+1):
if sigma(i) > N:
return i
def solve(N):
Y = find_max(N)
rem = sigma(Y)-N
for i in range(1, Y):
if i != rem:
print(i)
N = int(input())
solve(N)
|
s763589559 | p03920 | u375616706 | 1548990324 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3408 | 279 | def sigma(N):
return N*(N-1)//2
def find_max(N):
for i in range(N):
if sigma(i) > N:
return i
def solve(N):
Y = find_max(N)
rem = sigma(Y)-N
for i in range(1, Y+1):
if i != rem:
print(i)
N = int(input())
solve(N)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.