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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
s750036003 | p03474 | u807772568 | 1552798849 | Python | PyPy3 (2.4.0) | py | Runtime Error | 168 | 38640 | 274 | a,b = map(int,input())
n = input()
co = 0
if len(n) == a+b+1:
for i in range(a+b+1):
if n[i] == "-":
if i != a:
print("No")
exit()
else:
co = 1
if co == 1:
print("Yes")
else:
print("No")
else:
print("No")
exit() |
s304050792 | p03474 | u492605584 | 1552204034 | Python | PyPy3 (2.4.0) | py | Runtime Error | 166 | 38384 | 139 | A, B = map(int, input().split())
S = input()
s1, s2 = S.split("-")
if len(s1) == A and len(s2) == B:
print("Yes")
else:
print("No") |
s847171590 | p03474 | u945418216 | 1550685779 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 157 | a,b=map(int,input().split())
s=input()
import re
r = '[0-9]{}-[0-9]{}'.format(a,b)
if re.match(r'%s' % r, s) <> None:
print('Yes')
else:
print('No')
|
s068050688 | p03474 | u945418216 | 1550685650 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 157 | a,b=map(int,input().split())
s=input()
import re
r = '[0-9]{}-[0-9]{}'.format(a,b)
if re.match(r'%s' % r, s) <> None:
print('Yes')
else:
print('No')
|
s273598648 | p03474 | u187205913 | 1550641804 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 274 | a,b = int(input())
s = input()
l = [str(i) for i in range(10)]
for i in range(a):
if not s[i] in l:
print('No')
exit()
for i in range(b):
if not s[a+i] in l:
print('No')
exit()
if not s[a]=='-':
print('No')
exit()
print('Yes') |
s104362438 | p03474 | u854093727 | 1550367090 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3316 | 217 | a = list(map(int,input().split()))
S = input()
b = list(S.split("-"))
a.sort()
b.sort()
if a[0] == len(b[0]) and a[1] == len(b[1]):
print("Yes")
elif sum(a) == len(b[1]):
print("Yes")
else:
print("No")
|
s677095229 | p03474 | u543954314 | 1550329438 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 126 | a, b = map(int, input().split())
s = input().split(-)
if len(s[0]) == a and len(s[1]) == b:
print("Yes")
else:
print("No") |
s792853227 | p03474 | u854093727 | 1549468599 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 609 | import re
import sys
A,B = map(int,input().split())
S = input()
if S.count("-") == 1:
s1,s2 = S.split("-")
result = re.match(f"^[0-9]", s1)
for x in range(2):
if x == 1:
result = re.match(f"^[0-9]", s2)
if result:
continue
else:
print("No")
... |
s171081983 | p03474 | u854093727 | 1549468442 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 598 | import re
A,B = map(int,input().split())
S = input()
if S.count("-") == 1:
s1,s2 = S.split("-")
result = re.match(f"^[0-9]", s1)
for x in range(2):
if x == 1:
result = re.match(f"^[0-9]", s2)
if result:
continue
else:
print("No")
sys... |
s156798963 | p03474 | u854093727 | 1549464636 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 431 | A,B = map(int,input().split())
S = input()
if S.count("-") == 1:
s1,s2 = S.split("-")
if len(s1) == A:
if len(s2) == B:
print("Yes")
else:
print("No")
sys.exit(0)
elif len(s2) == A:
if len(s1) == B:
print("Yes")
else:
... |
s696009943 | p03474 | u854093727 | 1549464560 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 383 | A,B = map(int,input().split())
S = input()
if S.count("-") == 1:
s1,s2 = S.split("-")
if len(s1) == A:
if len(s2) == B:
print("Yes")
else:
print("No")
elif len(s2) == A:
if len(s1) == B:
print("Yes")
else:
print("No")
else:... |
s121810542 | p03474 | u854093727 | 1549464395 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3060 | 307 | A,B = map(int,input().split())
S = input()
if S.count("-") == 1:
s1,s2 = S.split("-")
if len(s1) == A:
if len(s2) == B:
print("Yes")
elif len(s1) == A:
if len(s2) == B:
print("Yes")
else:
print("No")
sys.exit(0)
else:
print("No")
|
s434296457 | p03474 | u948986080 | 1546986083 | Python | PyPy3 (2.4.0) | py | Runtime Error | 191 | 38512 | 134 | a,b=map(int,input())
s=str(input())
if s[:a].isnumeric() and s[a]=="-" and s[a+1:].isnumeric():
print("Yes")
else:
print("No") |
s084264300 | p03474 | u948986080 | 1546985988 | Python | PyPy3 (2.4.0) | py | Runtime Error | 175 | 38256 | 135 | a,b=map(int,input())
s=list(input())
if s[:a].isnumeric() and s[a]=="-" and s[a+1:].isnumeric():
print("Yes")
else:
print("No") |
s670572505 | p03474 | u562016607 | 1546333255 | Python | Python (3.4.3) | py | Runtime Error | 21 | 2940 | 184 | A,B=map(int, input().split())
S=input()
if S[A]=="-":
n,m=S.split("-")
if n.isdigit() and m.isdigit():
print("Yes")
else:
print("No")
else:
print("No")
|
s756604146 | p03474 | u928784113 | 1544649652 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 190 | # -*- coding: utf-8 -*-
A,B = map(int,input().split())
S = str(input())
if S[A] == "-":
T = pop(S[A])
if T.isdigit() is True:
print("Yes")
else:
print("No")
else:
print("No") |
s370203279 | p03474 | u928784113 | 1544649449 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 189 | # -*- coding: utf-8 -*-
A,B = map(int,input().split())
S = str(input())
if S[A] == "-":
T = del S[A]
if T.isdigit() is True:
print("Yes")
else:
print("No")
else:
print("No") |
s178359682 | p03474 | u669770658 | 1542404060 | Python | Python (3.4.3) | py | Runtime Error | 19 | 2940 | 181 | def abc084_b():
import re
a, b = map(int, input().split())
return "Yes" if re.match("[0-9].*-[0-9].*", input()) else "No"
if __name__ == '__main__':
print(abc084_b()) |
s739077575 | p03474 | u669770658 | 1542404026 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 168 | import re
a, b = map(int, input().split())
return "Yes" if re.match("[0-9].*-[0-9].*", input()) else "No"
if __name__ == '__main__':
print(abc084_b()) |
s373399711 | p03474 | u090225501 | 1541275352 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 371 | def issigit(s):
return all(c in '0123456789' for c in s)
def check(s, a, b):
if len(s) != a + b + 1:
return False
if not isdigit(s[:a]):
return False
if s[a] != '-':
return False
if not isdigit(s[-b:]):
return False
return True
a, b = map(int, input().split())
s = input()
if ... |
s998105350 | p03474 | u518556834 | 1539831124 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 231 | a,b = map(int,input().split())
s = list(input())
if s[a] == "-" and len(s) == a+b+1:
s.remove(s[a])
for i in range(a+b):
if i.is_integer() == False:
print("No")
break
else:
print("Yes")
else:
print("No") |
s487924571 | p03474 | u518556834 | 1539830986 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 234 | a.b = map(int,input().split())
s = list(input())
if s[a] == "-" and len(s) == a+b+1:
s.remove(s[a])
for i in range(a+b):
if i.is_integer() == False:
print("No")
break()
else:
print("Yes")
else:
print("No")
|
s327369551 | p03474 | u940102677 | 1538379446 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 153 | a, b = map(int, input().split())
s = input()
if s[a] == "-":
s[a] = "0"
else:
print("No")
exit()
if s.isdigit():
print("Yes")
else:
print("No") |
s058531092 | p03474 | u232852711 | 1537582304 | Python | Python (3.4.3) | py | Runtime Error | 24 | 2940 | 174 | a, b = list(map(int, input().slpit()))
s = input().split('-')
if len(s) != 2:
print('No')
elif len(s[0]) == a and len(s[1]) == b:
print('Yes')
else:
print('No')
|
s073428621 | p03474 | u514067551 | 1536553743 | Python | Python (3.4.3) | py | Runtime Error | 20 | 3064 | 285 | A,B = map(int,input().split())
S = input()
L = list(range(10))
flag = True
for i in range(A+B+1):
if ( i == A ):
if (S[i] != "-"):
flag = False
else:
if (not (int(S[i]) in L)):
flag = False
if flag:
print("Yes")
else:
print("No") |
s577770177 | p03474 | u474270503 | 1534256887 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 12 | 3 4
269-6650 |
s975668516 | p03474 | u513081876 | 1533958914 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 205 | A, B = map(int, input().split())
S = input()
if S[A] == '-' and A+B+1 == len(S):
S = a[:A]+a[A+1:]
try:
S = int(S)
print('Yes')
except:
print('No')
else:
print('No') |
s663696151 | p03474 | u123756661 | 1533778689 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 211 | a,b=map(int,input().split())
s=input()
if '-' not in s or s.count('-')>1 or s[0]=='-' or s[-1]=='-':
print('No')
exit()
p=s.split('-')
print('No' if s[a]!='-' or len(p[0]!=a or len(p[1])!=b) else 'Yes') |
s867041049 | p03474 | u123756661 | 1533617513 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 121 | a,b=map(int,input().split())
s=input()
p=s.split('-')
print('No' if s[a]!='-' or len(p[0]!=a or len(p[1])!=b) else 'Yes') |
s118075066 | p03474 | u688055251 | 1531265924 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 669 | # 関数 solve は,もちろん,問題に応じて書き換える
imprt sys
def solve(a,b,c):
if a+b+1==len(c):
if c.count('-')==1:
return 'Yes'
if c.count('-')!=1:
return 'No'
else:
return 'No'
# ここから下は,入力・出力形式が同じであれば,変えなくて良い.
def readQuestion():
line1 = sys.stdin.readline().rstrip()
... |
s702175991 | p03474 | u688055251 | 1531264943 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 586 | import sys
# 関数 solve は,もちろん,問題に応じて書き換える
def solve(a,b,c):
a=0
b=0
if c.count('-')==1:
return 'Yes'
if c.count('-')!=1:
return 'No'
# ここから下は,入力・出力形式が同じであれば,変えなくて良い.
def readQuestion():
line = sys.stdin.readline().rstrip()
[str_a, str_b, str_c] = line.split(' ')
return (... |
s117154847 | p03474 | u983967747 | 1531264240 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 734 | import sys
# 関数 solve は,もちろん,問題に応じて書き換える
def solve( lst_a, lst_b,n):
if n.count("-")==1:
answer= "No"
else:
N,NN=n.split("-")
if lst_a == len(N) and lst_b == len(NN):
answer = "Yes"
else:
answer = "No"
return answer
# ここから下は,入力・出力形式が同じであれば,変えなくて良い.
d... |
s946712150 | p03474 | u983967747 | 1531264170 | Python | Python (3.4.3) | py | Runtime Error | 20 | 3064 | 734 | import sys
# 関数 solve は,もちろん,問題に応じて書き換える
def solve( lst_a, lst_b,n):
if n.count("-")>=2:
answer= "No"
else:
N,NN=n.split("-")
if lst_a == len(N) and lst_b == len(NN):
answer = "Yes"
else:
answer = "No"
return answer
# ここから下は,入力・出力形式が同じであれば,変えなくて良い.
d... |
s446629108 | p03474 | u515364861 | 1531264137 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 737 | import sys
# 関数 solve は,もちろん,問題に応じて書き換える
def solve( lst_a, lst_b,n):
if n.count("-")>=2:
return "No"
else:
N,NN=n.split("-")
if lst_a == len(N) and lst_b == len(NN):
answer = "Yes"
else:
answer = "No"
return answer
# ここから下は,入力・出力形式が同じであれば,変えなくて良い.
def... |
s799755021 | p03474 | u983967747 | 1531264100 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 734 | import sys
# 関数 solve は,もちろん,問題に応じて書き換える
def solve( lst_a, lst_b,n):
if n.count("-")>=2:
return "No"
else:
N,NN=n.split("-")
if lst_a == len(N) and lst_b == len(NN):
answer = "Yes"
else:
answer = "No"
return answerr
# ここから下は,入力・出力形式が同じであれば,変えなくて良い.
d... |
s904470020 | p03474 | u983967747 | 1531263652 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 703 | def solve( lst_a, lst_b,n):
if n.count("-")>=2:
return "No"
else:
N,NN=n.split("-")
if lst_a == len(N) and lst_b == len(NN):
answer = "Yes"
else:
answer = "No"
return answer
def readQuestion():
line1 = sys.stdin.readline().rstrip()
n = int(line... |
s526133770 | p03474 | u010437136 | 1531262757 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3064 | 650 | import sys
# 関数 solve は,もちろん,問題に応じて書き換える
def solve(s,a,b):
c = 0
for i in s:
if i=='-':
c+=1
if s[a]=='-' and c==1:
return 'yes'
else:
return 'No'
# ここから下は,入力・出力形式が同じであれば,変えなくて良い.
def readQuestion():
line1 = sys.stdin.readline().rstrip()
[str_n, str_i] = li... |
s976969992 | p03474 | u001024152 | 1530041407 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 223 | a,b = map(int, input().split())
s = input()
try:
if '-' not in s: raise
sa, sb = map(int, s.split('-'))
# print(sa, sb)
if len(sa)==a and len(sb)==b:
print('Yes')
except ValueError:
print('No') |
s531880722 | p03474 | u039623862 | 1529382823 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 168 | import
a,b = map(int, input().split())
s = input()
if len(s) == (a+b+1) and all([c != '-' for c in s[:a]+s[a+1:]]) and s[a] == '-':
print('Yes')
else:
print('No') |
s051561628 | p03474 | u205561862 | 1529183894 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 358 | def number(c):
c = str(c)
ans = 0
s = "0123456789"
for i in range(10):
if c == s[i]:ans = 1
return ans
A,B = map(int,input().split())
S = input()
flag = 1
for i in range(A):
if(number(S[i]) != 1):flag = 0
if S[A] != "-":flag = 0
for j in range(B):
if(number(S[A+1+i]) != 1):flag = 0
... |
s235818098 | p03474 | u724892495 | 1528834723 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 127 | A, B = map(int, input().split())
a, b = input().split("-")
if len(a)==A and len(b)==B:
print("Yes")
exit()
print("No")
|
s627565260 | p03474 | u455696302 | 1528164112 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 150 | A,B=[int(i) for i in input().split()]
S = input()
if S[0:A-1].isdisit() and S[A] == '-' and S[A+1:].isdisit():
print('Yes')
else:
print('No') |
s772497241 | p03474 | u957084285 | 1526147233 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 230 | A,B = map(int, input().split())
S = list(input())
if A+B+1-S != 0:
print("No")
exit()
for i in range(len(S)):
if (ord(S[i]) < ord("0") or ord(S[i]) > ord("9")) ^ i == A:
print("No")
exit()
print("Yes")
|
s065341531 | p03474 | u944209426 | 1524450231 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3060 | 121 | a, b = list(map(int, input().split()))
x, y = input().split('-')
print('Yes') if a==len(x) and b==len(y) else print('No') |
s741139910 | p03474 | u136952448 | 1522020968 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3060 | 350 | # --*-- encoding:utf-8 --*--
ab = list(map(int, input())).split(" ")
code = input()
notflag = False
for i in range(a):
if( code[i] not in "123456789" ):
notflag = True
if( code[a] != "-" ):
notflag = True
for i in range(a+1, b):
if( code[i] not in "123456789" ):
notflag = True
if(notflag == False):
p... |
s974160601 | p03474 | u321354941 | 1520101410 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 3316 | 271 | input_str = str(input()).split(" ")
a = int(input_str[0])
b = int(input_str[1])
s = str(input()).split("-")
if a==3 and b ==4:
for i in range(999):
for j in range(9999):
c = int(s[0])
d = int(s[1])
if i == c and j == d:
print("yes")
else:
print("no")
|
s767814737 | p03474 | u803647747 | 1519164722 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 189 | A, B= [int(input() )for _ in range(2)]
S = str(input())
if ((S[:A]+S[A+1:]).isdigit()) == True:
if S[A]=="-":
print("Yes")
else:
print("No")
else:
print("No") |
s836591809 | p03474 | u803647747 | 1519164348 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 142 | A, B= [int(input() )for _ in range(2)]
S = str(input())
if ((S[:A]+S[A+1:]).isdigit()) & (S[A]=="-"):
print("Yes")
else:
print("No") |
s190293509 | p03474 | u803647747 | 1519164101 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3056 | 148 | A, B= [int(input() )for _ in range(2)]
S = list(input())
if ("".join(S[0:A]+S[B:]).isdigit()) & (S[A]=="-"):
print("Yes")
else:
print("No") |
s142237306 | p03474 | u803647747 | 1519162457 | Python | Python (3.4.3) | py | Runtime Error | 20 | 3064 | 216 | A, B= [int(input() )for _ in range(2)]
S = str(input())
try:
if type(int(S[:A]+S[A+1:]))!= int:
print("No")
elif S[A]!="-":
print('No')
else:
print('Yes')
except:
print("No") |
s731449948 | p03474 | u803647747 | 1519162274 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 215 | A, B= [int(input() )for _ in range(2)]
S = str(input())
try:
if (type((int(S[:A])+int(S[A+1:])))== int):
if S[A]=="-":
print('Yes')
else:
print('No')
except:
print("No") |
s270699331 | p03474 | u803647747 | 1519162207 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 240 | A, B= [int(input() )for _ in range(2)]
S = str(input())
try:
if (type(int(S[:A]))== int):
if S[A]=="-":
if type(int(S[A+1:]))==int:
print('Yes')
else:
print('No')
except:
print("No") |
s729127861 | p03474 | u803647747 | 1519162069 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 211 | A, B= [int(input() )for _ in range(2)]
S = str(input())
try:
if (type(int(S[:A]))== int) & (S[A]=="-") & (type(int(S[A+1:]))==int):
print('Yes')
else:
print('No')
except:
print("No") |
s596041938 | p03474 | u222841610 | 1518841547 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 299 | a,b = map(int,input().split())
s = list(input())
ans = Yes
if len(s) != a+b+1:
ans = 'No'
else:
for i in range(a+b+1):
if i == a and s[i] != '-':
ans = 'No'
break
if (not s[i].isdigit()) and i != a:
ans ='No'
break
print (ans)
|
s183768779 | p03474 | u222841610 | 1518840347 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 324 | a,b = map(int,input().split())
s = list(input())
ans = True
for i in range(a+b+2):
if i == a and s[i] != '-':
ans = 'No'
if not s[i].isdigit() and i != a:
ans ='No'
break
if s[i].isdigit() and i != a:
if 0>int(s[i]) or int(s[i]) > 9:
ans ='No'
print (... |
s064261808 | p03474 | u730606460 | 1516753656 | Python | Python (2.7.6) | py | Runtime Error | 10 | 2568 | 127 | a,b = map(int,raw_input().split())
if s[a+1] == "-" and len(s.strip("-")) == len(s) - 1:
print "Yes"
else: print "No"
|
s497248680 | p03474 | u819688111 | 1515692775 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 296 | if __name__ == '__main__':
A, B = [int(x) for x in input().split(' ')]
S = input()
S = S.split('-')
if S.length < 2:
print('No')
a = S[0]
b = S[1]
if a.length == A:
if b.length == B:
print('YES')
exit()
print('No')
|
s962064085 | p03474 | u586577600 | 1515515005 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 338 | a, b = map(int, input().split())
s = input()
import sys
if len(s) != a + b + 1:
print('No')
else:
for i in range(a):
if !(s[i].isdigit()):
print('No')
sys.exit(0)
for i in range(b):
if !(s[len(a)+i+1].isdigit()):
print('No')
sys.exit(0)
if s[len(a)] != '-':
print('No')
else... |
s907848515 | p03474 | u569906225 | 1514983683 | Python | Python (2.7.6) | py | Runtime Error | 10 | 2568 | 134 | A ,B = map(int, raw_input().split())
S = raw_input().split("-")
print len(S) == 2 and len(S[0]) == A and len(S[1]) == B ? "Yes" : "No" |
s240086343 | p03474 | u782330257 | 1514799752 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 97 | a,b=map(int,input().split())
if s.count('-')==1 and s[a]=='_':
print("Yes")
else:
print("No") |
s367933039 | p03474 | u863684580 | 1514762096 | Python | Python (2.7.6) | py | Runtime Error | 11 | 2568 | 246 | l = map(int, raw_input().split())
k = raw_input()
listed = list(k)
if (len(k) == (l[0] + l[1] + 1)) and (listed[l[0]] == "-") and ((int(listed[l[0]+1]) in range(10)) and ((int(listed[l[0]-1])) in range(10))):
print "Yes"
else:
print "No"
|
s642562026 | p03474 | u140251125 | 1514755342 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 154 | a, b = map(int, input().split())
s = input()
first, second = s.split("-")
if len(first) == a and len(second) == b:
print("Yes")
else:
print("No")
|
s596883486 | p03474 | u467027051 | 1514749333 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 318 | # -*- coding: utf-8 -*-
import math
A,B = input().split(" ")
s = str(input())
s_sp = s.split("-")
if (len(s_sp) != 2):
print("No")
exit
if (len(s_sp[0]) != int(A)) | (len(s_sp[1]) != int(B)):
print("No")
exit
if ((s_sp[0].isdigit()) & (s_sp[1].isdigit())):
print("Yes")
else:
print("No")
|
s037034052 | p03474 | u331591074 | 1514693586 | Python | Python (2.7.6) | py | Runtime Error | 11 | 2568 | 348 | #coding:utf-8
A, B = map(int,raw_input().split())
S = raw_input()
if S[A] != '-':
print "No"
else:
Flag = 0
for i in range(A):
if S[i] >= '0' and S[i] <= '9':
Flag = 1
for i in range(A+1,len(S)):
if S[i] >= '0' and S[i] <= '9':
Flag = 1
if Flag == 1:
print... |
s084252080 | p03474 | u220345792 | 1514691387 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 146 | l = input().split()
a=input()
b=a.split("-")
if len(b[0]) == l[0] and len(b[1])==l[1] and and len(b)<3:
print('Yes')
else:
print('No')
|
s178822142 | p03474 | u499384645 | 1514690976 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 256 | s=input()
try:
s1,s2=s.split("-")
except Exception as e:
print('No')
sys.exit()
if(not s1.isdigit() or not s2.isdigit()):
print('No')
sys.exit()
if(len(s1)!=a or len(s2)!=b or len(s2)>5):
print('No')
sys.exit()
print('Yes') |
s376260466 | p03474 | u439333295 | 1514688533 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 441 | AB = input()
S = input()
A = int(AB.split(" ")[0])
B = int(AB.split(" ")[1])
ints = "0123456789"
flag = True
if len(S) != A + B + 1:
flag = False
if flag:
for i in range(len(S)):
if i != A:
if not(S[i] in ints):
flag = False
return
else:
... |
s528422628 | p03474 | u963492848 | 1514686892 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 280 | A= int(input())
B = int(input())
S = input()
s1 = S[:A]
s2 = S[A:A+1]
s3= S[len(S)-B:]
if s1.isdigit() == True:
if s2 == "-":
if s3.isdigit() == True:
print("Yes")
else :
print("No")
else:
print("No")
else :
print("No") |
s883756116 | p03474 | u294493401 | 1514686592 | Python | Python (2.7.6) | py | Runtime Error | 10 | 2568 | 274 | # -*- coding: utf-8 -*-
a, b = map(int, raw_input().split())
s = raw_input()
ok = False
if len(s) == (a+b+1):
n = s.count('-')
if n = 1:
x,y = map(str, s.split('-'))
if len(x) == a:
if len(y) == b:
ok = True
if ok:
print 'Yes'
else:
print 'No' |
s174403043 | p03474 | u294493401 | 1514686546 | Python | Python (2.7.6) | py | Runtime Error | 10 | 2692 | 275 | # -*- coding: utf-8 -*-
a, b = map(int, raw_input().split())
s = raw_input()
ok = False
if len(s) == (a+b+1):
n = s.count('-')
if n <= 1:
x,y = map(str, s.split('-'))
if len(x) == a:
if len(y) == b:
ok = True
if ok:
print 'Yes'
else:
print 'No' |
s208862069 | p03474 | u294493401 | 1514686275 | Python | Python (2.7.6) | py | Runtime Error | 10 | 2568 | 193 | # -*- coding: utf-8 -*-
a, b = map(int, raw_input().split())
s = raw_input()
ok = False
if len(s) == (a+b+1):
x,y = map(str, s.split('-'))
if len(x) == a:
if len(y) == b:
print ok |
s530854807 | p03474 | u128472075 | 1514685961 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 5391 |
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <i... |
s014669964 | p03474 | u997023236 | 1514685933 | Python | Python (3.4.3) | py | Runtime Error | 19 | 2940 | 114 | A,B= map(int, input().split(" "))
S=input()
if S[3]=="-" and len(S)==A+B+1:
print("Yes")
else:
print("No") |
s906303768 | p03475 | u516554284 | 1598922392 | Python | Python (3.8.2) | py | Runtime Error | 24 | 9124 | 449 | int(input())
yo=[]
for _ in range(n-1):
a=list(map(int,input().split()))
yo.append(a)
def ans(x):
if x==n-1:
return 0
else:
t=0
for i in range(x,n-1):
if t<=yo[i][1]:
t=yo[i][1]+yo[i][0]
else:
s=t-yo[i][1]
if s%yo[i][2]==0:
t=t+yo[i][0]
else:
... |
s234196534 | p03475 | u157232135 | 1597853202 | Python | Python (3.8.2) | py | Runtime Error | 24 | 9256 | 387 | def main():
n=int(input())
csf=[list(map(int,input().split())) for _ in range(n-1)]
for i in range(n):
if i == n-1:
print(0)
else:
t=0
for c,s,f in csf[i:]:
t = max(s,t)
t = math.ceil(t/f)*f+c
#print("start:"... |
s194558622 | p03475 | u157232135 | 1597852107 | Python | Python (3.8.2) | py | Runtime Error | 27 | 9172 | 422 | from itertools import product, combinations
def main():
n=int(input())
csf=[list(map(int,input().split())) for _ in range(n-1)]
for i in range(n):
if i == n-1:
print(0)
else:
t=0
for c,s,f in csf[i:]:
t = max(s,t)
t = lcm(t,... |
s118191291 | p03475 | u505830998 | 1596332683 | Python | Python (3.8.2) | py | Runtime Error | 52 | 9200 | 1029 | import sys
input_methods=['clipboard','file','key']
using_method=0
input_method=input_methods[using_method]
tin=lambda : map(int, input().split())
lin=lambda : list(tin())
mod=1000000007
#+++++
def cc(al):
ret = 0
for (c, s, f) in al:
if ret <= s:
ret = s+c
else:
st = ((ret + f-1)//f)*f
ret = st + c
... |
s051211369 | p03475 | u309141201 | 1596122683 | Python | Python (3.8.2) | py | Runtime Error | 28 | 9060 | 544 | import sys
sys.setrecursionlimit(10**10)
n = int(input())
info = []
for _ in range(n-1):
c, s, f = map(int, input().split())
info.append([c, s, f])
# print(info)
def func(i, low):
if i == low:
return info[i][1] + info[i][0]
return func2(func(i-1, low), info[i][2], info[i][1]) + info[i][0]
de... |
s230286974 | p03475 | u309141201 | 1596122476 | Python | Python (3.8.2) | py | Runtime Error | 584 | 619660 | 542 | import sys
sys.setrecursionlimit(10**6)
n = int(input())
info = []
for _ in range(n-1):
c, s, f = map(int, input().split())
info.append([c, s, f])
# print(info)
def func(i, low):
if i == low:
return info[i][1] + info[i][0]
return func2(func(i-1, low), info[i][2], info[i][1]) + info[i][0]
def... |
s081237892 | p03475 | u309141201 | 1596122391 | Python | Python (3.8.2) | py | Runtime Error | 528 | 619684 | 542 | import sys
sys.setrecursionlimit(10**7)
n = int(input())
info = []
for _ in range(n-1):
c, s, f = map(int, input().split())
info.append([c, s, f])
# print(info)
def func(i, low):
if i == low:
return info[i][1] + info[i][0]
return func2(func(i-1, low), info[i][2], info[i][1]) + info[i][0]
def... |
s780182241 | p03475 | u309141201 | 1596076111 | Python | Python (3.8.2) | py | Runtime Error | 530 | 619764 | 527 | import sys
sys.setrecursionlimit(10**7)
n = int(input())
info = []
for _ in range(n-1):
c, s, f = map(int, input().split())
info.append([c, s, f])
# print(info)
def func(i, low):
if i == low:
return info[i][1] + info[i][0]
return func2(func(i-1, low), info[i][2]) + info[i][0]
def func2(n, f)... |
s236357305 | p03475 | u309141201 | 1596076058 | Python | Python (3.8.2) | py | Runtime Error | 532 | 619560 | 527 | import sys
sys.setrecursionlimit(10**7)
n = int(input())
info = []
for _ in range(n-1):
c, s, f = map(int, input().split())
info.append([c, s, f])
# print(info)
def func(i, low):
if i == low:
return info[i][1] + info[i][0]
return func2(func(i-1, low), info[i][2]) + info[i][0]
def func2(n, f)... |
s595424635 | p03475 | u309141201 | 1596075340 | Python | Python (3.8.2) | py | Runtime Error | 527 | 619760 | 633 | import sys
sys.setrecursionlimit(10**7)
n = int(input())
info = []
for _ in range(n-1):
c, s, f = map(int, input().split())
info.append([c, s, f])
# print(info)
def func(i, low):
# print(i, low)
if i == low:
# print(info[i][1] + info[i][0])
return info[i][1] + info[i][0]
# print(fu... |
s930170633 | p03475 | u625729943 | 1592459024 | Python | PyPy3 (2.4.0) | py | Runtime Error | 2018 | 425244 | 884 | #import numpy as np
import sys, math
from itertools import permutations, combinations
from collections import defaultdict, Counter, deque
from math import factorial#, gcd
from bisect import bisect_left #bisect_left(list, value)
sys.setrecursionlimit(10**7)
enu = enumerate
MOD = 10**9+7
def input(): return sys.stdin.rea... |
s806993874 | p03475 | u625729943 | 1592458984 | Python | PyPy3 (2.4.0) | py | Runtime Error | 3149 | 1763592 | 884 | #import numpy as np
import sys, math
from itertools import permutations, combinations
from collections import defaultdict, Counter, deque
from math import factorial#, gcd
from bisect import bisect_left #bisect_left(list, value)
sys.setrecursionlimit(10**7)
enu = enumerate
MOD = 10**9+7
def input(): return sys.stdin.rea... |
s348441236 | p03475 | u591808161 | 1591588029 | Python | PyPy3 (2.4.0) | py | Runtime Error | 162 | 38256 | 537 | import sys
input = sys.stdin.readline
import numpy as np
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
n = I()
mylist = [list(MI()) for i in range(n-1)]
def main(j):
time = 0
for i in range(j,n-1):
c, s, f = mylist[i]
... |
s689608594 | p03475 | u860002137 | 1591054774 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 498 | n = int(input())
csf = []
for i in range(n - 1):
c, s, f = map(int, input().split())
csf.append([c, s, f])
ans = []
for i in range(n - 1):
tmp = csf[i][0] + csf[i][1]
for j in range(i + 1, n - 1):
if tmp < csf[j][1]:
tmp = csf[j][0] + csf[j][1]
elif (tmp - csf[j][1]) % csf... |
s075159655 | p03475 | u860002137 | 1591054712 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 499 | n = int(input())
csf = []
for i in range(n - 1):
c, s, f = map(int, input().split())
csf.append([c, s, f])
ans = []
for i in range(n - 1):
tmp = csf[i][0] + csf[i][1]
for j in range(i + 1, n - 1):
if tmp < csf[j][1]:
tmp = csf[j][0] + csf[j][1]
elif (tmp - csf[j][1]) % csf... |
s601126067 | p03475 | u941438707 | 1591053194 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 324 | (n,),*a=[[*map(int,i.split())]for i in open(0)]
ans=[]
for i in range(n-1):
now=a[i][0]+a[i][1]
for j in range(i+1,n-1):
c,s,f=a[j]
if s==now:
d=0
elif s>now:
d=s-now
else:
d=now%f
now+=c+d
ans+=[now]
ans+=[0]
print(*ans,sep="... |
s924855626 | p03475 | u373047809 | 1590731313 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 157 | (n,),*d=[list(map(int,c.split()))for c in open(0)]
for i in range(n-1):t=0;exec("for j in range(i,n-1):c,s,f=d[j];t=[t+(f-t%f)%f,s][t<s]+c")print(t)
print(0) |
s858147912 | p03475 | u344813796 | 1590089642 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3060 | 258 | n=int(input()) # a1
csf= [list(map(int, input().split())) for i in range(n-1)] #a1 a2 a3 // b1 b2 b3
print(n)
for i in n:
t=0
for j in n-1:
if t<csf[j][1]:
t=csf[j][1]
else:
t=t+csf[j][1]-(t%csf[j][2])
t+=csf[j][2]
print(t) |
s164294081 | p03475 | u781262926 | 1589479085 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3188 | 298 | n, *CSF = map(int, open(0).read().split())
A = []
for i in range(0, 3*(n-1), 3):
t = 0
for c, s, f in zip(CSF[i::3], CSF[i+1::3], CSF[i+2::3]):
if t <= s:
t = s + c
else:
t = ceil((t-s) / f) * f + s + c
A.append(t)
A.append(0)
print(*A, sep='\n') |
s239717554 | p03475 | u753386263 | 1588193695 | Python | PyPy3 (2.4.0) | py | Runtime Error | 175 | 38384 | 592 | N,Q=map(int,input().split())
S=input()
l_li=[]
r_li=[]
for i in range(Q):
l,r=map(int,input().split())
l_li.append(l)
r_li.append(r)
#lからrの区間でacが入っている個数を求める
#「'C' が右隣にあるような 'A' の個数」
#count[l]:最初からlまでの文字で含まれるacの累積和
#lからrまでの区間のacの数はcount[r]-count[l]
count=[0]*N
for i in range(N-1):#DPっぽく解いていく
if S[i]=="A" and ... |
s138369092 | p03475 | u440129511 | 1587563550 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 493 | n=int(input())
l=[list(map(int,input().split()))]
l1=[0]*n
for i in range(n-1):
l1[i]+=l[i][0]+l[i][1]
for j in range(1,n-i-1):
if l1[i]<l[i+j][1]:
l1[i]-=l1[i]
l1[i]+=l[i+j][1]
if l1[i]>=l[i+j][1] and (l1[i]-l[i+j][1])%l[i+j][2]!=0:
l1[i]+=((l[i+... |
s924916293 | p03475 | u379720557 | 1584706930 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3064 | 361 | N = int(input())
C = [0]*(N-1)
S = [0]*(N-1)
F = [0]*(N-1)
T = [0]*N
for i in range(N-1):
C[i], S[i], F[i] = map(int, input().split())
for j in range(N-1):
T[j] = C[j] + S[j]
for i in range(j, N-1):
if T[j] >= S[i+1] or S[i+1] == 0:
T[j] = T[j] + C[i+1]
elif T[j] < S[i+1]:
T[j] = S[i+1]
T[... |
s845907393 | p03475 | u379720557 | 1584706122 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 325 | N = int(input())
C = [0]*(N-1)
S = [0]*(N-1)
F = [0]*(N-1)
T = [0]*N
for i in range(N-1):
C[i], S[i], F[i] = map(int, input().split())
for j in range(N-1):
T[j] = C[j] + S[j]
for i in range(N-2):
if T[j] > S[i+1]:
T[j] = T[j] + C[i+1]
else:
T[j] = S[i+1]
T[N-1] = 0
for i in range(N):
print(... |
s891486700 | p03475 | u379720557 | 1584705874 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 298 | N = int(input())
C = []
S = []
F = []
T = [0]*N
for i in range(N-1):
C[i], S[i], F[i] = map(int, input().split())
for j in len(T):
T[j] = C[j] + S[j]
for i in range(N-1):
if T[j] > S[i+1]:
T[j] = T[j] + C[i+1]
else:
T[j] = S[i+1]
T[N-1] = 0
for i in len(T):
print(T[i]) |
s504350835 | p03475 | u896741788 | 1584660189 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 219 | def f():
n=int(input())
l=(tuple(map(int,input().split())) for i in range(n-1))
for i in range(n):
now=0
for a,s,d in l[i:]:
now=a+s-(-max(0,now-s)//d)*d
print(now)
if __name__=="__main__":
f() |
s223712964 | p03475 | u253952966 | 1583705527 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 497 | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
long next(long time, long f) {
if (time % f == 0) return time;
else return time + f - time % f;
}
int main() {
int n;cin>>n;
int c[n-1],f[n-1];
long s[n-1];
rep(i,n-1) cin>>c[i]>>s[i]>>f[i];
long time;
... |
s045450927 | p03475 | u857070771 | 1581396281 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 213 | n,q=map(int,input().split())
s=input()
lr=[list(map(int,input().split())) for _ in range(q)]
L=[0]
c=0
for i in range(n-1):
if s[i]=='A' and s[i+1]=='C':
c += 1
L.append(c)
for l,r in lr:
print(L[r-1]-L[l-1]) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.