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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
s153731490 | p03856 | u375616706 | 1548713570 | Python | Python (3.4.3) | py | Runtime Error | 93 | 4072 | 464 | s1 = "maerd"
s2 = "remaerd"
s3 = "esare"
s4 = "resare"
i = input()
s = ''
for c in reversed(i):
s += c
l = len(s)
i = 0
def dfs(i):
if i == l:
print("YES")
exit()
if i+5 <= l and s[i:i+5] == s1:
dfs(i+5)
elif i+7 <= l and s[i:i+7] == s2:
dfs(i+7)
elif i+5 <= l an... |
s645470992 | p03856 | u375616706 | 1548712383 | Python | Python (3.4.3) | py | Runtime Error | 77 | 4064 | 353 | s = input()
l = len(s)
def dfs(i):
# print("->", s[i:])
if i == l:
print("YES")
exit()
if s[i:i+5] == "dream":
if i+7 < l and s[i+5:i+7] == "er":
dfs(i+7)
dfs(i+5)
elif s[i:i+5] == "erase":
if i+5 < l and s[i+5] == "r":
dfs(i+6)
... |
s942806938 | p03856 | u375616706 | 1548712223 | Python | Python (3.4.3) | py | Runtime Error | 80 | 4060 | 313 | s = input()
l = len(s)
def dfs(i):
if i == l:
print("YES")
exit()
if s[i:i+5] == "dream":
if i+7 < l and s[i+5:i+7] == "er":
dfs(i+7)
dfs(i+5)
elif s[i:i+5] == "erase":
if i+6 < l and s[i+5] == "r":
dfs(i+6)
dfs(i+5)
dfs(0)
|
s279803105 | p03856 | u375616706 | 1548710556 | Python | Python (3.4.3) | py | Runtime Error | 130 | 98584 | 318 | ans = "NO"
s = input()
def dfs(s):
ret = 0
if len(s) == 0:
return 1
if s[:5] == 'dream' or s[:5] == 'erase':
ret += dfs(s[5:])
if s[:7] == 'dreamer':
ret += dfs(s[7:])
if s[:6] == 'eraser':
ret += dfs(s[6:])
return ret
if dfs(s):
ans = "YES"
print(ans)
|
s894227964 | p03856 | u284854859 | 1544817214 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 11 | dreameraser |
s168734391 | p03856 | u620868411 | 1534617728 | Python | Python (3.4.3) | py | Runtime Error | 126 | 98548 | 306 | # -*- coding: utf-8 -*-
def f(s):
# print(s)
if s.startswith("dream"):
return f(s[5:]) or f(s[7:])
elif s.startswith("erase"):
return f(s[5:]) or f(s[6:])
elif s=="":
return True
else:
return False
if f(input()):
print("YES")
else:
print("NO")
|
s817371347 | p03856 | u765237551 | 1532804646 | Python | Python (3.4.3) | py | Runtime Error | 28 | 3188 | 504 | s = input()
def solve(s):
i = 0
n = len(s)
while i < n:
if s[i:i+5] == 'dream':
if s[i+5:i+7] != 'er':
i += 5
elif i+7 < n and s[i+7] == 'a':
i += 5
else:
i += 7
elif s[i:i+5] == 'erase':
if s[i... |
s801639497 | p03856 | u341855122 | 1506906807 | Python | Python (2.7.6) | py | Runtime Error | 11 | 2692 | 249 | S = raw_input()
t = ['dreamer','dream','eraser','erase']
while len(S) > 0:
for i in t:
if S[S.rfind(i):]==i:
S = S[:S.rfind(t)]
break
elif i == t[-1]:
print "NO"
exit()
print "YES"
|
s348912913 | p03856 | u341855122 | 1506906633 | Python | Python (2.7.6) | py | Runtime Error | 11 | 2692 | 251 | S = raw_input()
t = ['dreamer','dream','eraser','erase']
while len(S) > 0:
for i in t:
if S[S.rfind(i):]==i:
S = S[:S.rfind(t)]
continue
elif i == t[-1]:
print "NO"
exit()
print "YES" |
s828867647 | p03856 | u844771757 | 1500593131 | Python | PyPy3 (2.4.0) | py | Runtime Error | 310 | 45936 | 354 | s=input()
n=len(s)
f=[-1]*(n+1)
def check(x):
if(f[x]!=-1):return f[x]
if(x==n):return 1
if(n-x>6 and s[x:x+7]=='dreamer'and check(x+7)):f[x]=1;return 1
if(n-x>5 and s[x:x+6]=='eraser'and check(x+6)):f[x]=1;return 1
if(n-x>4 and s[x:x+5]in ['erase','dream']and check(x+5)):f[x]=1;return 1
f[x]=0
return 0
if(check... |
s895218987 | p03856 | u471797506 | 1491600287 | Python | Python (2.7.6) | py | Runtime Error | 12 | 2936 | 1125 | from collections import defaultdict
class UnionFind:
def __init__(self, size):
self.rank = [0] * size
self.par = range(size)
def find(self, x):
if x == self.par[x]: return x
self.par[x] = self.find(self.par[x])
return self.par[x]
def same(self, x, y):
return... |
s913768548 | p03856 | u332385682 | 1489360924 | Python | PyPy3 (2.4.0) | py | Runtime Error | 175 | 42352 | 1230 | import sys
from collections import Counter
class UnionFind:
def __init__(self, n):
self.p = list(range(n))
self.rank = [0] * n
def find_root(self, x):
if x != self.p[x]:
self.p[x] = self.find_root(self.p[x])
return self.p[x]
def is_same(self, x, y):
r... |
s072498758 | p03856 | u136231568 | 1481949246 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3064 | 403 | s = input().strip()
strings = "eraser erase dreamer dream".split()
exceptions = "dreameraser dreamerase".split()
while 1:
for string in strings:
if s.startswith(string):
if string == "dreamer":
for exception in exceptions:
if startswith(exception):
s = s[len(exception):]
... |
s583082420 | p03856 | u297228366 | 1481762533 | Python | Python (2.7.6) | py | Runtime Error | 16 | 2568 | 1224 | #include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> ii;
const int MAXN = 200005;
int N, K, L, u, v, visited[2][MAXN], cnt[2] = {1, 2};
vector<int> adjList[2][MAXN];
map<ii,int> m;
void dfs(int id, int node) {
if (visited[id][node]) {
return;
} else {
visited[id][node] = cnt[... |
s993300189 | p03856 | u594903131 | 1481554238 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3068 | 3 | no
|
s475454272 | p03856 | u966695411 | 1481437177 | Python | Python (3.4.3) | py | Runtime Error | 25 | 3316 | 132 | S = input()
for i in ['eraser', 'erase', 'dreamer', 'dream']:
S=S.replace(i, 'R')
print(['NO', 'YES'][len(s) == 1 and 'R' in s]) |
s035123277 | p03856 | u123756661 | 1481435545 | Python | Python (2.7.6) | py | Runtime Error | 21 | 3068 | 2308 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
import sys
import re
import math
import itertools
import collections
import bisect
#sys.stdin=file('input.txt')
#sys.stdout=file('output.txt','w')
#10**9+7
mod=1000000007
#mod=1777777777
pi=3.141592653589
IS=float('inf')
xy=[(1,0),(-1,0),(0,1),(0,-1)]
bs=[(-1,-1),(-1,1),(1,... |
s459250952 | p03856 | u104282757 | 1481425858 | Python | Python (2.7.6) | py | Runtime Error | 71 | 2820 | 645 | S = raw_input()
def pick_greedy(S):
if S[0:5] == 'dream':
if S[5:7] == 'er':
if S[7] == 'a':
ret = 'dream'
else:
ret = 'dreamer'
else:
ret = 'dream'
elif S[0:5] == 'erase':
if S[5] == 'r':
ret = 'eraser'
... |
s084906263 | p03856 | u297228366 | 1481424543 | Python | Python (2.7.6) | py | Runtime Error | 147 | 98172 | 636 | T = ["maerd", "remaerd", "esare", "resare"]
def match(s):
if s == "":
return True
elif s[0] == "m" and len(s) >= len(T[0]) and s[:len(T[0])] == T[0]:
return match(s[len(T[0]):])
elif s[0] == "r" and len(s) > 2:
if s[2] == "m" and len(s) >= len(T[1]) and s[:len(T[1])] == T[1]:
return match(s[len(T[1]):])
... |
s406348487 | p03856 | u297228366 | 1481423859 | Python | Python (2.7.6) | py | Runtime Error | 168 | 98136 | 267 | T = ["dream", "dreamer", "erase", "eraser"]
def match(s):
if s == "":
return True
else:
ans = False
for i in T:
if len(i) <= len(s) and s[:len(i)] == i:
ans |= match(s[len(i):])
return ans
S = raw_input()
if match(S):
print "YES"
else:
print "NO" |
s648416376 | p03856 | u384094369 | 1481423366 | Python | Python (2.7.6) | py | Runtime Error | 16 | 2692 | 507 | s = raw_input()
def func(st):
head = st[:8]
if head[5:8] == 'dre' or head[5:8] == 'era':
return st[5:]
elif head[5:8] == 'erd' or head[5:8] == 'ere':
return st[7:]
elif head[5:8] == 'rdr' or head[5:8] == 'rer':
return st[6:]
else:
return ''
while True:
if len(t)... |
s760008554 | p03856 | u384094369 | 1481423098 | Python | Python (2.7.6) | py | Runtime Error | 16 | 2692 | 541 | s = raw_input()
def func(st):
head = st[:8]
if head[5:8] == 'dre' or head[5:8] == 'era':
return st[5:]
elif head[5:8] == 'erd' or head[5:8] == 'ere':
return st[7:]
elif head[5:8] == 'rdr' or head[5:8] == 'rer':
return st[6:]
else:
return ''
while True:
print t
... |
s009468810 | p03856 | u104282757 | 1481422320 | Python | Python (2.7.6) | py | Runtime Error | 67 | 2820 | 558 | S = raw_input()
def pick_greedy(S):
if S[0:5] == 'dream':
if S[5:7] == 'er':
if S[7] == 'a':
ret = 'dream'
else:
ret = 'dreamer'
else:
ret = 'dream'
elif S[0:5] == 'erase':
if S[5] == 'r':
ret = 'eraser'
... |
s803118482 | p03857 | u163907160 | 1585803329 | Python | PyPy3 (2.4.0) | py | Runtime Error | 170 | 38484 | 897 | from collections import *
from heapq import *
from itertools import *
import sys
import copy
from bisect import *
sys.setrecursionlimit(10000000)
sys.
N,K,L = map(int,input().split())
RoLists=[[] for i in range(N)]
RaLists=[[] for _ in range(N)]
for i in range(K):
p,q=map(int,input().split())
RoLists[p-1].appen... |
s131481297 | p03857 | u163907160 | 1585803175 | Python | PyPy3 (2.4.0) | py | Runtime Error | 1102 | 91468 | 862 | from collections import *
from heapq import *
from itertools import *
import sys
import copy
from bisect import *
N,K,L = map(int,input().split())
RoLists=[[] for i in range(N)]
RaLists=[[] for _ in range(N)]
for i in range(K):
p,q=map(int,input().split())
RoLists[p-1].append(q-1)
RoLists[q-1].append(p-1)... |
s786586225 | p03857 | u547167033 | 1584480770 | Python | Python (3.4.3) | py | Runtime Error | 2105 | 22356 | 1309 | class UnionFind():
def __init__(self,n):
self.n=n
self.parents=[-1]*n
def find(self,x):
if self.parents[x] < 0:
return x
else:
self.parents[x]=self.find(self.parents[x])
return self.parents[x]
def unite(self,x,y):
x = self.find(x)
... |
s298622164 | p03857 | u547167033 | 1584480744 | Python | PyPy3 (2.4.0) | py | Runtime Error | 2114 | 147052 | 1308 | class UnionFind():
def __init__(self,n):
self.n=n
self.parents=[-1]*n
def find(self,x):
if self.parents[x] < 0:
return x
else:
self.parents[x]=self.find(self.parents[x])
return self.parents[x]
def unite(self,x,y):
x = self.find(x)
... |
s991963021 | p03857 | u871980676 | 1584237719 | Python | PyPy3 (2.4.0) | py | Runtime Error | 1419 | 134176 | 1431 | from collections import Counter
import queue
N, K, L = map(int, input().split())
PQ = [tuple(map(int, input().split())) for _ in range(K)]
RS = [tuple(map(int, input().split())) for _ in range(L)]
road = [set() for _ in range(N)]
railroad = [set() for _ in range(N)]
for p, q in PQ:
road[p - 1].add(q - 1)
road... |
s040875941 | p03857 | u871980676 | 1584219513 | Python | PyPy3 (2.4.0) | py | Runtime Error | 1151 | 115360 | 1369 | from collections import defaultdict as dd
import queue
N, K, L = map(int,input().split())
PQ = [tuple(map(int,input().split())) for _ in range(K)]
RS = [tuple(map(int,input().split())) for _ in range(L)]
road = [[] for _ in range(N)]
railroad = [[] for _ in range(N)]
for p,q in PQ:
road[p-1].append(q-1)
road[q... |
s843748836 | p03857 | u511379665 | 1576359049 | Python | Python (3.4.3) | py | Runtime Error | 585 | 18504 | 1218 | #temp
class Uf:
def __init__(self, N):
self.p = list(range(N))
self.rank = [0] * N
self.size = [1] * N
def root(self, x):
if self.p[x] != x:
self.p[x] = self.root(self.p[x])
return self.p[x]
def same(self, x, y):
return self.root(x) == self.roo... |
s878615117 | p03857 | u614314290 | 1562774728 | Python | Python (3.4.3) | py | Runtime Error | 2114 | 171204 | 1464 | N, K, L = list(map(int, input().split()))
PQ = [list(map(int, input().split())) for _ in range(K)]
RS = [list(map(int, input().split())) for _ in range(L)]
def uft_root(g, a):
if g[a] < 0:
return a
g[a] = uft_root(g, g[a])
return g[a]
def uft_size(g, a):
return -g[uft_root(g, a)]
def uft_merge(g, a, b):
a, b ... |
s698142951 | p03857 | u620480037 | 1556590851 | Python | Python (3.4.3) | py | Runtime Error | 2108 | 45372 | 1351 | import collections
import bisect
N,K,L=map(int,input().split())
RP=[i for i in range(N+1)]
Rsize=[1 for i in range(N+1)]
TP=[i for i in range(N+1)]
Tsize=[1 for i in range(N+1)]
def findR(a):
if a==RP[a]:
return a
else:
return findR(RP[a])
def findT(a):
if a==TP[a]:
return... |
s387574317 | p03857 | u620480037 | 1556588203 | Python | Python (3.4.3) | py | Runtime Error | 2105 | 33860 | 1163 | import collections
N,K,L=map(int,input().split())
RP=[i for i in range(N+1)]
Rsize=[1 for i in range(N+1)]
TP=[i for i in range(N+1)]
Tsize=[1 for i in range(N+1)]
def findR(a):
if a==RP[a]:
return a
else:
return findR(RP[a])
def findT(a):
if a==TP[a]:
return a
else:
... |
s408572785 | p03857 | u623819879 | 1554958022 | Python | PyPy3 (2.4.0) | py | Runtime Error | 2035 | 175308 | 1233 | # coding: utf-8
# Your code here!
from collections import Counter
from collections import defaultdict
n,k,l=map(int,input().split())
p=[0]*(k+1)
q=[0]*(k+1)
rd=[[] for _ in range(n+1)]
r=[0]*(l+1)
s=[0]*(l+1)
rw=[[] for _ in range(n+1)]
for i in range(k):
a,b=map(int,input().split())
p[i],q[i]=a,b
rd[a].a... |
s423804468 | p03857 | u555962250 | 1553882839 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 1129 | #include "bits/stdc++.h"
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
typedef long long ll;
const int MAX_N = 200001;
int par[MAX_N];
int rnk[MAX_N];
void init(int n) {
rep(i,n) {
par[i] = i;
rnk[i] = 0;
}
}
int find(int x) {
if (par[x] == x) {
return x;
} else ... |
s201661126 | p03857 | u543954314 | 1553093911 | Python | Python (3.4.3) | py | Runtime Error | 2106 | 54692 | 605 | from collections import defaultdict as dd
road = dd(list)
train = dd(list)
def gr(tree,start):
island = set()
rest = [start,]
while rest:
node = rest.pop()
island.add(node)
for x in tree[node]:
if x not in island:
rest.append(x)
return(island)
n,k,l = ... |
s444582550 | p03857 | u572144347 | 1551637556 | Python | PyPy3 (2.4.0) | py | Runtime Error | 2860 | 141288 | 1383 | N,K,L = map(int, input().split())
class UFT:
def __init__(self, N):
self.UFdata = [-1] * (N+1)
self.rank = [0] * (N+1)
def find(self,x):
UFdata = self.UFdata
while UFdata[x] != -1:
x = UFdata[x]
return x
def unite(self,x,y):
UFdata = self.UF... |
s984511053 | p03857 | u572144347 | 1551637038 | Python | PyPy3 (2.4.0) | py | Runtime Error | 2545 | 149100 | 1320 | N,K,L = map(int, input().split())
class UFT:
def __init__(self, N):
self.UFdata = [-1] * (N+1)
self.rank = [0] * (N+1)
def find(self,x):
UFdata = self.UFdata
while UFdata[x] != -1:
x = UFdata[x]
return x
def unite(self,x,y):
UFdata = self.UF... |
s735206841 | p03857 | u572144347 | 1551637003 | Python | PyPy3 (2.4.0) | py | Runtime Error | 2321 | 127716 | 1318 | N,K,L = map(int, input().split())
class UFT:
def __init__(self, N):
self.UFdata = [-1] * (N+1)
self.rank = [0] * (N+1)
def find(self,x):
UFdata = self.UFdata
while UFdata[x] != -1:
x = UFdata[x]
return x
def unite(self,x,y):
UFdata = self.UF... |
s146534942 | p03857 | u572144347 | 1551635218 | Python | PyPy3 (2.4.0) | py | Runtime Error | 2474 | 149100 | 1290 | N,K,L = map(int, input().split())
class UFT:
def __init__(self, N):
self.UFdata = [-1] * (N+1)
self.rank = [0] * (N+1)
def find(self,x):
UFdata = self.UFdata
while UFdata[x] != -1:
x = UFdata[x]
return x
def unite(self,x,y):
UFdata = self.UF... |
s268348483 | p03857 | u368780724 | 1541763988 | Python | Python (3.4.3) | py | Runtime Error | 2111 | 144756 | 861 | def inpl(): return [int(i) for i in input().split()]
def root(x,par):
if par[x] == x:
return [x,[x]]
else:
return [root(par[x],par)[0],root(par[x],par)[1]+[x]]
N, K, L = inpl()
parK = list(range(N))
for i in range(K):
p, q = inpl()
rp = root(p-1,parK)
rq = root(q-1,parK)
if le... |
s258207166 | p03857 | u631277801 | 1541642946 | Python | Python (3.4.3) | py | Runtime Error | 2113 | 178360 | 2005 | import sys
stdin = sys.stdin
sys.setrecursionlimit(10**5)
def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
d... |
s827502756 | p03857 | u593005350 | 1538517460 | Python | Python (3.4.3) | py | Runtime Error | 2108 | 50180 | 762 |
N,K,L=map(int,input().split())
len = [[[] for s in range(N)] for t in range (2)]
i=1
j=1
while i <= K:
a,b=map(int,input().split())
len[0][a-1].append(b-1)
len[0][b-1].append(a-1)
i+=1
while j <= L:
a,b=map(int,input().split())
len[1][a-1].append(b-1)
len[1][b-1].append(a-1)
j+=1
def ... |
s755212214 | p03857 | u593005350 | 1538510398 | Python | Python (3.4.3) | py | Runtime Error | 2107 | 50180 | 754 |
N,K,L=map(int,input().split())
len = [[[] for s in range(N)] for t in range (2)]
i=1
j=1
while i <= K:
a,b=map(int,input().split())
len[0][a-1].append(b-1)
len[0][b-1].append(a-1)
i+=1
while j <= L:
a,b=map(int,input().split())
len[1][a-1].append(b-1)
len[1][b-1].append(a-1)
j+=1
def ... |
s402173539 | p03857 | u593005350 | 1538510367 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 757 |
N,K,L=map(int,input().split())
len = [[[] for s in range(N)] for t in range (2)]
i=1
j=1
while i <= K:
a,b=map(int,input().split())
len[0][a-1].append(b-1)
len[0][b-1].append(a-1)
i+=1
while j <= L:
a,b=map(int,input().split())
len[1][a-1].append(b-1)
len[1][b-1].append(a-1)
j+=1
def ... |
s967387062 | p03857 | u593005350 | 1538510276 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 754 |
N,K,L=map(int,input().split())
len = [[[] for s in range(N)] for t in range (2)]
i=1
j=1
while i <= K:
a,b=map(int,input().split())
len[0][a-1].append(b-1)
len[0][b-1].append(a-1)
i+=1
while j <= L:
a,b=map(int,input().split())
len[1][a-1].append(b-1)
len[1][b-1].append(a-1)
j+=1
def ... |
s975379205 | p03857 | u593005350 | 1538495563 | Python | Python (3.4.3) | py | Runtime Error | 1630 | 51244 | 728 |
N,K,L=map(int,input().split())
len = [[[] for s in range(N)] for t in range (2)]
i=1
j=1
while i <= K:
a,b=map(int,input().split())
len[0][a-1].append(b-1)
len[0][b-1].append(a-1)
i+=1
while j <= L:
a,b=map(int,input().split())
len[1][a-1].append(b-1)
len[1][b-1].append(a-1)
j+=1
def ... |
s583001799 | p03857 | u075012704 | 1531319374 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 1526 | v\from collections import defaultdict
N, K, L = map(int, input().split())
class UnionFind:
def __init__(self, n):
self.par = [i for i in range(n)]
self.rank = [0] * n
self.size = [1] * n
# 検索
def find(self, x):
if self.par[x] == x:
return x
else:
... |
s955279269 | p03857 | u098968285 | 1496162666 | Python | PyPy3 (2.4.0) | py | Runtime Error | 187 | 41328 | 1367 | # 頂点 v の所属するグループを調べる
def root(v):
if uni[v] < 0: # v が親の場合
return v
else: # v が子の場合
uni[v] = root(uni[v]) # 親のrootを調べる
return uni[v]
# 頂点 a と頂点 b をつなぐ。もともと同じグループのとき、False を返す
def connect(a, b):
# まずはそれぞれ根の番号に置き換える
ra = root(a)
rb = root(b)
if ra == rb: # a と b がそもそも同じグループに属しているなら即終... |
s692248673 | p03857 | u132291455 | 1481426980 | Python | PyPy2 (5.6.0) | py | Runtime Error | 706 | 111644 | 794 | n,k,l=map(int,raw_input().split())
e1=[[] for i in range(n)]
e2=[[] for i in range(n)]
for i in range(k):
p,q=map(int,raw_input().split())
e1[p-1].append(q-1)
e1[q-1].append(p-1)
for i in range(l):
p,q=map(int,raw_input().split())
e2[p-1].append(q-1)
e2[q-1].append(p-1)
num1=[0]*n
num2=[0]*n
def... |
s959125805 | p03857 | u123756661 | 1481426841 | Python | Python (2.7.6) | py | Runtime Error | 16 | 2824 | 2338 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
import sys
import re
import math
import itertools
import collections
import bisect
#sys.stdin=file('input.txt')
#sys.stdout=file('output.txt','w')
#10**9+7
mod=1000000007
#mod=1777777777
pi=3.141592653589
IS=float('inf')
xy=[(1,0),(-1,0),(0,1),(0,-1)]
bs=[(-1,-1),(-1,1),(1,... |
s519593761 | p03857 | u104282757 | 1481425290 | Python | Python (2.7.6) | py | Runtime Error | 18 | 2696 | 1685 | # N K L
# p1 q1
# :
# pK qK
# r1 s1
# :
# rL sL
import numpy as np
N, K, L = map(int, raw_input().split())
# graph
Gp = dict()
Gq = dict()
# conn. components
p_con_todo = []
q_con_todo = []
# init
for n in range(1, N+1):
p_con_todo.append(str(n))
q_con_todo.append(str(n))
Gp[str(n)] = []
Gq[str(n)] =... |
s199902618 | p03857 | u123756661 | 1481424934 | Python | Python (2.7.6) | py | Runtime Error | 974 | 23840 | 2998 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
import sys
import re
import math
import itertools
import collections
import bisect
#sys.stdin=file('input.txt')
#sys.stdout=file('output.txt','w')
#10**9+7
mod=1000000007
#mod=1777777777
pi=3.141592653589
IS=float('inf')
xy=[(1,0),(-1,0),(0,1),(0,-1)]
bs=[(-1,-1),(-1,1),(1,... |
s067297599 | p03858 | u340781749 | 1481430255 | Python | Python (3.4.3) | py | Runtime Error | 2720 | 37016 | 701 | import numpy as np
n, a, b = map(int, input().split())
holes = np.fromiter((complex(*map(int, input().split())) for _ in range(n)), dtype=complex)
ab = holes[a - 1] - holes[b - 1]
d = abs(ab.real) + abs(ab.imag)
links = [set() for _ in range(n)]
for i in range(0, n, 10000):
xy1, xy2 = np.meshgrid(holes, holes[i:... |
s395047383 | p03858 | u340781749 | 1481427511 | Python | Python (3.4.3) | py | Runtime Error | 655 | 14472 | 604 | import numpy as np
n, a, b = map(int, input().split())
holes = np.fromiter((complex(*map(int, input().split())) for _ in range(n)), dtype=complex)
xy1, xy2 = np.meshgrid(holes, holes)
diff = xy1 - xy2
dists = abs(diff.real) + abs(diff.imag)
d = dists[a - 1][b - 1]
w = np.where(dists == d)
links = [set() for _ in ra... |
s941355240 | p03859 | u231905444 | 1601025314 | Python | Python (3.8.2) | py | Runtime Error | 26 | 9016 | 1368 | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
using namespace std;
typedef long long ll;
const int MOD = (int)1e9 + 7;
int add(int x, int y)
{
x += y;
if (x >= MOD) return x - MOD;
return x;
}
int sub(int x, int y)
{
x -= y;
if (x < 0) return x + MOD;
return x;
}
int mult(int x, ... |
s190019081 | p03859 | u638456847 | 1563745429 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3188 | 1918 | class UnionFind:
def __init__(self, n):
self.par = [i for i in range(n+1)]
self.rank = [0] * (n+1)
self.size = [1] * (n+1)
# 譬ケ繧呈、懃エ「縺吶k髢「謨ー
def find(self, x):
if self.par[x] == x:
return x
else:
self.par[x] = self.find(self.par[x])
... |
s885538403 | p03860 | u961469795 | 1601527001 | Python | Python (3.8.2) | py | Runtime Error | 24 | 8884 | 71 | arr = list(input().split())
print(arr[0].[0] + arr[1].[0] + arr[2].[0]) |
s003133000 | p03860 | u401183062 | 1601230491 | Python | Python (3.8.2) | py | Runtime Error | 27 | 8900 | 73 | string = input()
Capital = string[0]
print("A" + Capital + "C")
|
s271428895 | p03860 | u485349322 | 1598750924 | Python | Python (3.8.2) | py | Runtime Error | 27 | 9128 | 55 | a,b,c=map(int,input().split())
print(len(set([a,b,c]))) |
s920519231 | p03860 | u642012866 | 1598630279 | Python | Python (3.8.2) | py | Runtime Error | 25 | 8952 | 44 | print("".join(s[0] for s in input()split())) |
s025249183 | p03860 | u546853743 | 1598371699 | Python | Python (3.8.2) | py | Runtime Error | 26 | 8872 | 56 | a,b,c=map(input.split())
print('A' + b.head+ 'C',sep="") |
s745887591 | p03860 | u310381103 | 1597728459 | Python | Python (3.8.2) | py | Runtime Error | 23 | 9024 | 50 | s=input()
ss=s[0]
sss=upper(ss)
print("A"+sss+"C") |
s493035513 | p03860 | u310381103 | 1597728407 | Python | Python (3.8.2) | py | Runtime Error | 24 | 9088 | 32 | print('A'+upper(input()[0])+'C') |
s100833902 | p03860 | u895918162 | 1597438148 | Python | Python (3.8.2) | py | Runtime Error | 28 | 8936 | 160 | sentence = input()
new_sent = sentence.split(" ")
acro = ""
for i in range(len(new_sent)):
for j in range(new_sent[i]):
acro += new_sent[i][0]
print(acro)
|
s403349432 | p03860 | u714104087 | 1596575881 | Python | PyPy3 (7.3.0) | py | Runtime Error | 234 | 73872 | 60 | x = map(int, input().split())
print(x[0][0]+x[1][0]+x[2][0]) |
s346983682 | p03860 | u714104087 | 1596574804 | Python | PyPy3 (7.3.0) | py | Runtime Error | 111 | 74668 | 51 | x = map(int, input().split())
print(x[0]+x[1]+x[2]) |
s999231235 | p03860 | u714104087 | 1596574744 | Python | PyPy3 (7.3.0) | py | Runtime Error | 91 | 74672 | 49 | x=map(int, input().split())
print(x[0]+x[1]+x[2]) |
s342286496 | p03860 | u207767041 | 1596492904 | Python | PyPy3 (7.3.0) | py | Runtime Error | 105 | 74752 | 90 | a,b,c = list(map(int,input().split()))
a1 = a//c if a%c else a//c-1
a2 = b//c
print(a2-a1) |
s253198114 | p03860 | u207767041 | 1596492848 | Python | PyPy3 (7.3.0) | py | Runtime Error | 111 | 74704 | 90 | a,b,c = list(map(int,input().split()))
a1 = a//c if a%x else a//c-1
a2 = b//c
print(a2-a1) |
s563212109 | p03860 | u207767041 | 1596492807 | Python | Python (3.8.2) | py | Runtime Error | 24 | 9080 | 90 | a,b,x = list(map(int,input().split()))
a1 = a//x if a%x else a//x-1
a2 = b//x
print(a2-a1) |
s367284191 | p03860 | u207767041 | 1596492406 | Python | Python (3.8.2) | py | Runtime Error | 26 | 8964 | 86 | a,b,c = list(map(int,input().split()))
a = a//c
b = b//c if b%x else b//c-1
print(a-b) |
s753029884 | p03860 | u207767041 | 1596492333 | Python | Python (3.8.2) | py | Runtime Error | 25 | 9156 | 88 | a,b,c = list(map(int,input().split()))
b = a//c
b = b//c if b%c else b//c-1
print(a1-a2) |
s334337290 | p03860 | u207767041 | 1596492257 | Python | Python (3.8.2) | py | Runtime Error | 25 | 8932 | 67 | a,b,c = list(map(str,input().split()))
a = a//c
b = b//c
print(b-a) |
s094947237 | p03860 | u388297793 | 1596406839 | Python | Python (3.8.2) | py | Runtime Error | 27 | 9052 | 41 | a,b,c=imput().split()
print('A'+b[0]+'C') |
s488581240 | p03860 | u642528832 | 1596321661 | Python | Python (3.8.2) | py | Runtime Error | 23 | 9080 | 44 | a,b,c = map(input().split())
print(a+b[0]+c) |
s229543603 | p03860 | u099212858 | 1596147191 | Python | Python (3.8.2) | py | Runtime Error | 25 | 9024 | 52 | a, b, c = str(input().split())
print(a[0]+b[0]+c[0]) |
s029674437 | p03860 | u684743124 | 1595739910 | Python | Python (3.8.2) | py | Runtime Error | 25 | 9080 | 51 | a,b,x=map(int,input().split())
print(b//x-(a-1)//x) |
s393069530 | p03860 | u684743124 | 1595739877 | Python | Python (3.8.2) | py | Runtime Error | 29 | 9072 | 51 | a,b,x=map(int,input().split())
print(b//x-(a-1)//x) |
s558983006 | p03860 | u487288850 | 1595635532 | Python | Python (3.8.2) | py | Runtime Error | 23 | 8860 | 44 | xs = inpt().split()
print("A"+xs[2][0]+"B") |
s018411395 | p03860 | u942280986 | 1595563280 | Python | Python (3.8.2) | py | Runtime Error | 21 | 9164 | 106 | a,b,x=map(int,input().split())
a_p=a//x
b_p=b//x
if a%x==0:
print(b_p-a_p+1)
else:
print(b_p-a_p) |
s884331714 | p03860 | u414920281 | 1595540958 | Python | PyPy3 (7.3.0) | py | Runtime Error | 89 | 74740 | 60 | a,b,c=map(int,input().split())
ans=a[0]+b[0]+c[0]
print(ans) |
s312123901 | p03860 | u898702162 | 1595380902 | Python | Python (3.8.2) | py | Runtime Error | 21 | 8956 | 42 | a = Ab
b = Cd
c = Ef
print(a[0]+b[0]+c[0]) |
s650752902 | p03860 | u185806788 | 1594863447 | Python | PyPy3 (7.3.0) | py | Runtime Error | 95 | 74728 | 53 | a,b,c=map(int,input().split())
print(a[0]+b[0]+c[0])
|
s709315328 | p03860 | u185806788 | 1594863413 | Python | PyPy3 (7.3.0) | py | Runtime Error | 89 | 74556 | 58 | a,b,c=map(int,input().split())
print("a[0]"+"b[0]"+"c[0]") |
s645388218 | p03860 | u456416458 | 1594568770 | Python | Python (3.8.2) | py | Runtime Error | 20 | 9136 | 232 | s = input().split()
a = int(s[0])
b = int(s[1])
x = int(s[2])
def bet_ween(p, q):
if p < 0:
return 0
else:
return (p // q) + 1
fa = bet_ween(a-1, x)
fb = bet_ween(b, x)
answer = fb - fa
print(int(answer)) |
s937750481 | p03860 | u534308356 | 1594180776 | Python | Python (3.8.2) | py | Runtime Error | 27 | 9032 | 62 | a, s, c = map(int, input().split())
print(a[0] + s[0] + c[0])
|
s240512653 | p03860 | u917558625 | 1594074955 | Python | Python (3.8.2) | py | Runtime Error | 23 | 9100 | 52 | a,b,c=map(int,input().split())
print(a[0]+b[0]+c[0]) |
s342829062 | p03860 | u773440446 | 1593460336 | Python | Python (3.8.2) | py | Runtime Error | 27 | 8728 | 53 | a,b,c = input().split()
print(a[0],upper(b[0]),c[0])
|
s470596869 | p03860 | u773440446 | 1593460274 | Python | PyPy3 (7.3.0) | py | Runtime Error | 291 | 74548 | 53 | a,b,c = input().split()
print(upper(a[0],b[0],c[0]))
|
s438664526 | p03860 | u710398282 | 1593023540 | Python | Python (3.8.2) | py | Runtime Error | 28 | 8988 | 53 | a, b, c = input().split()
print("A", b[1], "C")
|
s974877803 | p03860 | u078349616 | 1592881187 | Python | Python (3.8.2) | py | Runtime Error | 23 | 9124 | 52 | A, B, C = map(int, input().split())
print("A"+B+"C") |
s329941611 | p03860 | u492910842 | 1592684604 | Python | PyPy3 (7.3.0) | py | Runtime Error | 96 | 74552 | 93 | s = map(input().split())
print(s[1])s = list(map(str,input().split()))
print("A"+s[1][0]+"C") |
s567036946 | p03860 | u729119068 | 1592495269 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 70 | A = list(input().split)
B=''
for a in A:
B += a[0].upper()
print(B)
|
s576878756 | p03860 | u445509700 | 1592399149 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 35 | print(f"A{input().split()[1][0]}C") |
s804357120 | p03860 | u217303170 | 1592384547 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 96 | import re
s = input()
x = s[8:-8]
print('{}''{}''{}'.format('A', *re.findall('[A-Z]', x), 'C'))
|
s193553761 | p03860 | u875608890 | 1592112171 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 149 | a, b, x = map(int, input().split())
if 1 <= b // x - a // x or (a==b and a % x == 0):
res = b // x - a // x + 1
print(res)
else:
print(0) |
s822616101 | p03860 | u667694979 | 1591898744 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 42 | a,s,c=input().split()
print(a[0+s[0]+c[0]) |
s601853933 | p03860 | u685244071 | 1591630268 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 75 | a = input().split()
initial_middle = a[7]
print('A'+ initial_middle +'C') |
s924628565 | p03860 | u602972961 | 1590170149 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 29 | s=input()
ptint('A'+s[8]+'C') |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.