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
s244153294
p04032
u820461302
1565819555
Python
Python (3.4.3)
py
Runtime Error
54
4664
513
# -*- coding: utf-8 -*- from collections import Counter # 文字列の入力 S = input() # 文字列から部分文字列を抽出して偏りをチェック counter = Counter(S) # 最頻出の文字とその次の文字の出現回数を比較 if counter.most_common()[0][1] != counter.most_common()[1][1] : # 文字の頻出分布をチェック counter.most_common()) print(S.index(counter.most_common()[0][0])+1,len(S)-sorted(S,reverse=True).index(counter.most_common()[0][0])+1) else: print("-1","-1")
s578360580
p04032
u227082700
1565658850
Python
Python (3.4.3)
py
Runtime Error
17
3064
149
s=input() l=len(s) for i in range(1,l) if s[i-1]==s[i]:print(i,i+1);exit() for i in range(2,l) if s[i-2]==s[i]:print(i-1,i+1);exit() print(-1,-1)
s555131788
p04032
u762540523
1564856708
Python
Python (3.4.3)
py
Runtime Error
39
3188
383
def main(): s = str(input()) sLen = len(s) for i in range(sLen - 2): if s[i] == s[i + 1]: print(i + 1, i + 2) return elif s[i] == s[i + 2]: print(i + 1, i + 3) return if s[sLen - 2] == s[sLen - 1]: print(slen - 1, sLen) return print("-1 -1") if __name__ == "__main__": main()
s376784920
p04032
u567434159
1562899524
Python
Python (3.4.3)
py
Runtime Error
17
2940
298
s = input() for sz in [3, 5, 7, 9, 11, 13, 15, 17, 19, 21] if sz > len(s): break for i in range(len(s) - sz + 1): curr = s[i:i + sz] for it in curr: if curr.count(it) > sz // 2: print(i + 1, i + sz) exit(0) print("-1 -1")
s353940890
p04032
u567434159
1562899407
Python
Python (3.4.3)
py
Runtime Error
17
2940
295
s = input() for sz in [3, 5, 7, 9, 11, 13, 15, 17, 19, 21] for i in range(len(s) - sz): curr = s[i:i + sz] if curr.count(curr[0]) > sz // 2 or curr.count(curr[1]) > sz // 2 or curr.count(curr[2]) > sz // 2: print(i + 1, i + sz) exit(0) print("-1 -1")
s092693704
p04032
u787456042
1562470590
Python
Python (3.4.3)
py
Runtime Error
59
3188
336
s = input() se = s[::2] so = s[1::2] ans = "-1 -1" for i in range(len(s)-1) : if s[i] == s[i+1] : ans = str(i+1)+" "+str(i+2) for i in range(len(se)-1) : if se[i] == se[i+1] : ans = str(2*i+1)+" "+str(2*i+3) for i in range(len(se)-1) : if so[i] == so[i+1] : ans = str(2*i+2)+" "+str(2*i+4) print(ans)
s317031227
p04032
u570545890
1558727828
Python
Python (3.4.3)
py
Runtime Error
17
2940
260
def balance: slen = len(S) s = S + '##' for i in range(slen): if s[i] == s[i+1]: return '{} {}'.format(i + 1, i + 2) if s[i] == [i+2]: return '{} {}'.format(i + 1, i + 3) return '-1 -1' S = input().strip() print(balance(S))
s307969581
p04032
u570545890
1558727638
Python
Python (3.4.3)
py
Runtime Error
18
3188
191
S = input().strip() slen = len(S) s = S + '##' for i in range(slen): if s[i] == s[i+1]: print(i+1, i+2) exit() if s[i] == [i+2]: print(i+1, i+3) exit() print(-1, -1)
s606333958
p04032
u570545890
1558727599
Python
Python (3.4.3)
py
Runtime Error
17
2940
191
S = input().strip() slen = len(S) s = S + '##' for i in range(slen): if s[i] == s[i+1]: print(i+1, i+2) exit() if s[i] == [i+2]: print(i+1, i+3) exit() print(-1, -1)
s989124163
p04032
u644778646
1556200115
Python
PyPy3 (2.4.0)
py
Runtime Error
219
47340
645
s = input() l = [] t = s[0] m = 1 for i in range(1,len(s)): if s[i] == t: m += 1 else: t = s[i] l.append(m) m = 1 l.append(m) if max(l) == 1: print(-1,-1) exit() if len(l) == 1: print(1,l[0]) if l[0] > 1: print(1,l[0]+l[1]) exit() ruiseki = [l[0]] for i in range(1,len(l)): ruiseki.append(ruiseki[i-1] + l[i]) for i in range(len(ruiseki)-1): if ruiseki[i+1] - ruiseki[i] > 1 and i != len(ruiseki) - 2: print(ruiseki[i],ruiseki[i+1]) exit() if ruiseki[i+1] - ruiseki[i] > 1 and i == len(ruiseki) - 2: print(ruiseki[i],ruiseki[i+1]) exit()
s048782913
p04032
u319818856
1554761690
Python
Python (3.4.3)
py
Runtime Error
56
3188
359
def unbalanced(s: str) -> tuple: for i in range(len(s) - 1): c1, c2 = s[i], s[i + 1] if c1 == c2: return i+1, i+2 if i + 2 < len(s): c3 = s[i + 2] if c1 == c3: return i+1, i+3 return False if __name__ == "__main__": s = input() a, b = unbalanced(s) print(a, b)
s007213086
p04032
u268516119
1553133135
Python
Python (3.4.3)
py
Runtime Error
18
2940
799
#アンバランスな文字列からアンバランスでない文字列を取り除くと、 #アンバランスな文字列が残るはず。ということは、両側から文字を削り取ることで「どの部分列をとってもアンバランスな文字列」が存在するはず #すなわちそれは、両側に「ax」が存在しない文字列で、「axa」または「aa...aa」 #aaがある時点でアンバランス確定なので「axa」「aa」のどちらかを探せばよし import re s=input() alphabet="abcdefghijklmnopqrstuvwxyz" for i in alphabet: ba=s.find(i+i) if ba!=-1: print(str(ba+1)+str(ba+2)) break A=re.compile(i+"."+i) axa=A.search(s,0) if axa: ba=axa.start()) print(str(ba+1)+str(ba+3)) break
s227108005
p04032
u914773681
1552681630
Python
Python (3.4.3)
py
Runtime Error
29
3444
666
import re def main(): s = input() # for i in s: l = list(set(s)) # 重複のない文字列の取得 ten = 1 for i in l: # 文字列探査開始 j = 1 pattern = '' while j < len(s): pattern = i * j # 該当文字列iをj回繰り返す matchOB = re.search(pattern, s) if matchOB: st = matchOB.start() # マッチした開始位置 en = matchOB.end() # マッチの終了位置 tu = matchOB.span() # マッチの位置をタプルで返す elif not matchOB: break j = j + 1 if ten < en - st: ten = en - st an_en = en an_st = st print(an_st, an_en) main()
s986040858
p04032
u190086340
1550257632
Python
Python (3.4.3)
py
Runtime Error
136
3188
884
S = input() def solve(): # print(S) diff = ord("a") head = 0 while head < len(S): tail = head + 1 while tail <= len(S): # print(S[head:tail]) table = [0 for _ in range(abs(ord("z") - ord("a")))] for j in range(len(S[head:tail])): # print("\t{}".format(S[head:tail][j:j+1])) index = ord(S[head:tail][j:j+1]) - diff table[index] += 1 # print(table[index], len(S[head:tail]), table[index] / len(S[head:tail])) if len(S[head:tail]) >= 2 and table[index] / len(S[head:tail]) > 0.5: # print("hit:" + S[head:tail]) # print(head + 1, tail) return head + 1, tail tail += 1 head += 1 # print("no hit") return -1, -1 res = solve() print(res[0], res[1])
s881661128
p04032
u483645888
1549994149
Python
Python (3.4.3)
py
Runtime Error
44
3188
305
def solve(s): for i, j in zip(range(0, len(s)-1), range(1, len(s))): if s[i] == s[j]: return '{0} {1}'.format(i+1,j+1) for i, j in zip(range(0, len(s)-2), range(2, len(s))): if s[i] == s[j]: return '{0} {1}'.format(i+1, j+1) return '{0} {1}'.format(-1 -1) print(solve(input()))
s046064729
p04032
u483645888
1549469844
Python
Python (3.4.3)
py
Runtime Error
39
3316
386
s = input() dic = {} flag = False for key in s: if key not in dic: dic[key] = 0 dic[key] += 1 for k, v in dic.items(): if len(s) % 2 == 0: if v > len(s)/2: answ = k flag = True elif len(s) % 2 == 1: if v >= len(s)/2: answ = k flag = True if flag == False: print(-1, -1) start = s.find(answ)+1 end = s.rfind(answ)+1 print(start, end)
s036443330
p04032
u483645888
1549469647
Python
Python (3.4.3)
py
Runtime Error
38
3188
280
s = input() dic = {} flag = False for key in s: if key not in dic: dic[key] = 0 dic[key] += 1 for k, v in dic.items(): if v >= len(s)/2: answ = k flag = True if flag == False: print(-1, -1) start = s.find(answ)+1 end = s.rfind(answ)+1 print(start, end)
s805817342
p04032
u811156202
1548628507
Python
Python (3.4.3)
py
Runtime Error
56
3188
546
s = input() checker = '' if len(s) == 2: if s[0] == s[1]: print(1, 2) checker += '*' else: print(-1, -1) checker += '*' if checker == '': for a, b in zip(range(len(s)-1), range(1,len(s))): if s[a] == s[b]: print(a+1, b+1) checker += '*' break if checker == '': for a, c in zip(range(len(s)-2), range(2, len(s))): if s[a] == s[c]: print(a+1, c+1) chekcher += '*' break if checker == '': print(-1, -1)
s484276288
p04032
u811156202
1548628410
Python
Python (3.4.3)
py
Runtime Error
63
11124
557
s = input() checker = '' if len(s) == 2: if s[0] == s[1]: print(1, 2) checker += '*' else: print(-1, -1) checker += '*' if checker == '': for a, b in zip(range(len(s)-1), range(1,len(s))): if s[a] == s[b]: print(a+1, b+1) checker += '*' break if checker == '': for a, c in zip(list(range(len(s)-2)), list(range(2, len(s)))): if s[a] == s[c]: print(a+1, c+1) chekcher += '*' break if checker == '': print(-1, -1)
s097665236
p04032
u811156202
1548628287
Python
Python (3.4.3)
py
Runtime Error
18
2940
557
s = input() checker = '' if len(s) <= 2: if s[0] == s[1]: print(1, 2) checker += '*' else: print(-1, -1) checker += '*' if checker == '' for a, b in zip(range(len(s)-1), range(1,len(s))): if s[a] == s[b]: print(a+1, b+1) checker += '*' break if checker == '': for a, c in zip(list(range(len(s)-2)), list(range(2, len(s)))): if s[a] == s[c]: print(a+1, c+1) chekcher += '*' break if checker == '': print(-1, -1)
s023543307
p04032
u811156202
1548627764
Python
Python (3.4.3)
py
Runtime Error
65
11124
395
s = input() checker = '' for a, b in zip(list(range(len(s)-1)), list(range(1,len(s)))): if s[a] == s[b]: print(a+1, b+1) checker += '*' break if checker == '': for a, c in zip(list(range(len(s)-2)), list(range(2, len(s)))): if s[a] == s[c]: print(a+1, c+1) chekcher += '*' break if checker == '': print(-1, -1)
s471155919
p04032
u513081876
1544818550
Python
Python (3.4.3)
py
Runtime Error
36
3188
245
import sys s = input() N = len(s) for i in range(N-2+1): if s[i] == s[i+1]: print(i+1, i+3) sys.exit() for i in range(N-3+1): if s[i] == s[i+3]: print(i+1, i+4) sys.exit() print(-1, -1)
s199234964
p04032
u022215787
1542513625
Python
Python (3.4.3)
py
Runtime Error
2111
4652
448
S = list(input()) for i,c in enumerate(S): if len(S[i:]) == 2: subset = S[i:i+1] if subset[0] == subset[1]: print("%d %d" % (i+1, i+2)) break continue elif len(S[i:]) > 2: subset = S[i:i+3] if subset[0] in subset[1:] or subset[1] == subset[2]: print("%d %d" % (i+1, i+3)) break continue else: print("-1 -1")
s623979069
p04032
u754553095
1540667329
Python
Python (3.4.3)
py
Runtime Error
373
3316
683
a=input() if len(a)%2==0: if (len(a)==2)&(len(list(set(a)))==1): print("1 2") else: for i in range(len(a)-3): b=sorted([a[i],a[i+1],a[i+2],a[i+3]]) c="".join(b) d=list(set(a[i:i+4])) if (len(d)==2)&(c!="{}".format(d[0]+d[0]+d[1]+d[1]))&(c!="{}".format(d[1]+d[1]+d[0]+d[0])): print("{}".format(i+1)+" "+"{}".format(i+4)) break else: print("-1 -1") else: for j in range(len(a)-2): e=list(set(a[i:i+3])) if (len(e)==2) or (len(e)==1): print("{}".format(i+1)+" "+"{}".format(i+3)) break else: print("-1 -1")
s785197082
p04032
u754553095
1540666608
Python
Python (3.4.3)
py
Runtime Error
387
3316
646
a=input() if len(a)%2==0: for i in range(len(a)-3): b=sorted([a[i],a[i+1],a[i+2],a[i+3]]) c="".join(b) d=list(set(a[i:i+4])) if len(d)==1: print("1 2") else: if (len(d)==2)&(c!="{}".format(d[0]+d[0]+d[1]+d[1]))&(c!="{}".format(d[1]+d[1]+d[0]+d[0])): print("{}".format(i+1)+" "+"{}".format(i+4)) break else: print("-1 -1") else: for j in range(len(a)-2): e=list(set(a[i:i+3])) if (len(e)==2) or (len(e)==1): print("{}".format(i+1)+" "+"{}".format(i+3)) break else: print("-1 -1")
s814197726
p04032
u754553095
1540612107
Python
Python (3.4.3)
py
Runtime Error
367
3188
569
a=input() if len(a)%2==0: for i in range(len(a)-3): b=sorted([a[i],a[i+1],a[i+2],a[i+3]]) c="".join(b) d=list(set(a[i:i+4])) if (len(d)==2)&(c!="{}".format(d[0]+d[0]+d[1]+d[1]))&(c!="{}".format(d[1]+d[1]+d[0]+d[0])): print("{}".format(i+1)+" "+"{}".format(i+4)) break else: print("-1 -1") else: for j in range(len(a)-2): e=list(set(a[i:i+3])) if len(e)==2 or len(e)==1: print("{}".format(i+1)+" "+"{}".format(i+3)) break else: print("-1 -1")
s243399861
p04032
u754553095
1540610649
Python
Python (3.4.3)
py
Runtime Error
309
3316
593
a=input() if len(a)%2==0: for i in range(len(a)-3): b="{}".format(a[i]+a[i+1]+a[i+2]+a[i+3]) c=list(set(a[i:i+4])) if (len(c)==2)&(b!="{}".format(c[0]+c[0]+c[1]+c[1]))&(b!="{}".format(c[1]+c[1]+c[0]+c[0])): print("{}".format(i+1)+" "+"{}".format(i+4)) break else: print("-1 -1") else: for j in range(len(a)-2): d="{}".format(a[j]+a[j+1]+a[j+2]) e=list(set(a[i:i+3])) if len(e)==2 or len(e)==1: print("{}".format(i+1)+" "+"{}".format(i+3)) break else: print("-1 -1")
s546030011
p04032
u754553095
1540610464
Python
Python (3.4.3)
py
Runtime Error
325
3316
575
a=input() if len(a)%2==0: for i in range(len(a)-3): b="{}".format(a[i]+a[i+1]+a[i+2]+a[i+3]) c=list(set(a[i:i+4])) if (len(c)==2)&(b!="{}".format(c[0]+c[0]+c[1]+c[1]))&(b!="{}".format(c[1]+c[1]+c[0]+c[0])): print("{}".format(i+1)+" "+"{}".format(i+4)) break else: print("-1 -1") else: for j in range(len(a)-2): d="{}".format(a[j]+a[j+1]+a[j+2]) e=list(set(a[i:i+3])) if len(e)==2 or len(e)==1: print("{}".format(i+1)+" "+"{}".format(i+3)) else: print("-1 -1")
s990458193
p04032
u754553095
1540573276
Python
Python (3.4.3)
py
Runtime Error
2661
3188
334
import math a=input() a1=list(a) b=a1[:] b.sort() b="".join(b) c=set(a1) d=[] for i in c: for i1 in range(math.floor(len(a1)/2),len(a1)+1): d.append(i*i1) for i in d: if i in b: print("{}".format(a.find("{}".format(i[0]))+1)+" "+"{}".format(a.rfind("{}".format(i[0]))+1)) break else: print("-1 -1")
s377370456
p04032
u883048396
1538101956
Python
Python (3.4.3)
py
Runtime Error
38
3188
183
sS = input().rstrip() iL = len(sS) for i in range(iL-1): if sS[i] == sS[i+1] : print(i+1,i+2) exit() if sS[0] == sS[2]: print("1 3") exit() print("-1 -1")
s518263547
p04032
u883048396
1538101328
Python
Python (3.4.3)
py
Runtime Error
54
3188
208
sS = input().rstrip() iL = len(sS) if iL == 2: print("-1 -1") exit() for i in range(iL-1): if sS[i] == sS[i+1] or sS[i] == sS[i+2]: print(i+1,i+3) #あぁ.. exit() print("-1 -1")
s591848852
p04032
u608088992
1537558096
Python
Python (3.4.3)
py
Runtime Error
42
4084
588
S = list(input()) i = 0 while i < len(S)-2: j = i+1 if S[i] == S[j]: print(i, j) break else: k = i+2 if S[i] == S[k] or S[j] == S[k]: print(i, k) break else: i += 3 else: if i == len(S) - 2: if S[i] == S[i+1]: print(i, i+1) elif S[i] == S[i+2]: print(i, i+2) elif S[i+1] == S[i+2]: print(i+1, i+2) else: print(-1, -1) elif i == len(S) - 1 and S[i] == S[i+1]: print(i, i+1) else: print(-1, -1)
s002658151
p04032
u769852547
1533782777
Python
Python (3.4.3)
py
Runtime Error
54
3188
335
import sys s = input() if len(s) == 2 and s[0] == s[1]: print("0, 1") sys.exit(0) for i in range(len(s)-2): if s[i] == s[i+1]: print(i+1, i+2) sys.exit(0) if s[i] == s[i+2]: print(i+1, i+3) sys.exit(0) if s[i+1] == s[i+2]: print(i+2, i+3) sys.exit(0) print("-1 -1") sys.exit(0)
s548901409
p04032
u769852547
1533782624
Python
Python (3.4.3)
py
Runtime Error
57
3316
267
import sys s = input() for i in range(len(s)-2): if s[i] == s[i+1]: print(i+1, i+2) sys.exit(0) if s[i] == s[i+2]: print(i+1, i+3) sys.exit(0) if s[i+1] == s[i+2]: print(i+2, i+3) sys.exit(0) print("-1 -1") sys.exit(0)
s910605370
p04032
u769852547
1533782497
Python
Python (3.4.3)
py
Runtime Error
54
3956
273
import sys s = list(input()) for i in range(len(s)-2): if s[i] == s[i+1]: print(i+1, i+2) sys.exit(0) if s[i] == s[i+2]: print(i+1, i+3) sys.exit(0) if s[i+1] == s[i+2]: print(i+2, i+3) sys.exit(0) print("-1 -1") sys.exit(0)
s652730757
p04032
u729133443
1533373720
Python
Python (3.4.3)
py
Runtime Error
65
3188
168
s=input() n=len(s) for i in range(n-1): if s[i]==s[i+1]: print(i+1,i+2) break elif i<n-1 and s[i]==s[i+2]: print(i+1,i+3) break else: print(-1,-1)
s998275874
p04032
u729133443
1533373677
Python
Python (3.4.3)
py
Runtime Error
64
3188
164
s=input() n=len(s) for i in range(n-1): if s[i]==s[i+1]: print(i,i+1) break elif i<n-1 and s[i]==s[i+2]: print(i,i+2) break else: print(-1,-1)
s874005490
p04032
u099566485
1531420766
Python
Python (3.4.3)
py
Runtime Error
51
3956
168
w=list(input()) for i in range(len(w)): if w[i]==w[i+1] or w[i]==w[i+2]: print("{} {}".format(i+1,i+3)) break else: print("{} {}".format(-1,-1))
s756215868
p04032
u112523623
1527700451
Python
Python (3.4.3)
py
Runtime Error
39
3188
319
if __name__ == '__main__': s = input() for i in range(len(s) - 1): if s[i] == s[i + 1]: print("{} {}".format(i + 1, i + 2)) exit(0) for i in range(len(s - 2)): if s[i] == s[i + 2]: print("{} {}".format(i + 1, i + 3)) exit(0) print("-1 -1")
s456842513
p04032
u112523623
1527699227
Python
Python (3.4.3)
py
Runtime Error
17
3064
694
if __name__ == '__main__': s = input() d = {} unbalanced = False unbalanced_char = '' for c in s: if c in d: d[c] += 1 unbalanced = (d[c] >= int(len(s) / 2)) if unbalanced: unbalanced_char = c break else: d[c] = 1 if unbalanced: count = 0 start = s.find(unbalanced_char) end = start for i in range(start, len(s)): if s[i] == unbalanced_char: end = i count += 1 if count >= int(len(s) / 2): break print(f"{start + 1} {end + 1}") else: print("-1 -1")
s341331943
p04032
u268793453
1526624151
Python
Python (3.4.3)
py
Runtime Error
17
2940
509
import numpy as np s = [ord(a)-ord('a') for a in input()] n = len(s) if n == 2: if s[0] == s[1]: print('1 2') else print('-1 -1') exit() cnt = np.array([0] * 26) cum = [cnt.copy()] for i, a in enumerate(s): cnt[a] += 1 cum.append(cnt.copy()) def is_check(cum, n): i = 3 d = 1 for j in range(n-i+1): for k in cum[j+i] - cum[j]: if k > d: return j+1, j+i return -1, -1 print(' '.join(map(str, is_check(cum, len(s)))))
s979356040
p04032
u268793453
1526622966
Python
Python (3.4.3)
py
Runtime Error
17
2940
555
import numpy as np s = [ord(a)-ord('a') for a in input()] n = len(s) if n == 2: if s[0] == s[1]: print('1 2') else print('-1 -1') exit() cnt = np.array([0] * 26) cum = [cnt.copy()] for i, a in enumerate(s): cnt[a] += 1 cum.append(cnt.copy()) def is_check(cum, n): for i in range(3, n+1, 2): d = i // 2 for j in range(n-i+1): for k in cum[j+i] - cum[j]: if k > d: return j+1, j+i return -1, -1 print(' '.join(map(str, is_check(cum, len(s)))))
s112862098
p04032
u158566391
1521904494
Python
Python (3.4.3)
py
Runtime Error
70
3188
159
a=input() for i in range(0,len(a)-1): if a[i]==a[i+1]: print(i+1,i+2) exit() elif i<len(a)-1: if a[i]==a[i+2]: print(i+1,i+3) exit() print(-1,-1)
s089119714
p04032
u650245944
1503610141
Python
Python (3.4.3)
py
Runtime Error
112
3188
366
s = input() tc = [ chr(i)*2 for i in range(ord('a'), ord('z')+1) ] + [ chr(i)+chr(j)+chr(i) for i in range(ord('a'), ord('z')+1) for j in range(ord('a'), ord('z')+1)] for i in tc: if i in s: t = i break else: t = 0 if t == 0: x=y=-1 for i in range(len(s)-len(t)+1): if s[i:i+len(t)] == t: x = i+1 y = i+len(t) print(x, y)
s564441990
p04032
u839537730
1501087854
Python
Python (3.4.3)
py
Runtime Error
17
3188
218
s = input() a = -1 b = -1 for i in range(N-2): if s[i]==s[i+1]: a = i+1 b = i+2 break elif s[i]==s[i+2]: a = i+1 b = i+3 break print(str(a)+" "+str(b))
s497319396
p04032
u584355711
1487394809
Python
Python (3.4.3)
py
Runtime Error
147
3188
498
# -*- coding: utf-8 -*- INF=10**10 def main(): str=input() n=len(str) if n==2: if str[0]==str[1]: print("1 2") else: print("-1 -1") for i in range(n-1): temp=str[i:i+3] for j in range(2): for k in range(j+1,3): if temp[j]==temp[k]: print("{0} {1}".format(i+1,i+3)) return 0 print("-1 -1") if __name__=="__main__": main()
s347282120
p04032
u584355711
1487393569
Python
Python (3.4.3)
py
Runtime Error
127
3188
434
# -*- coding: utf-8 -*- INF=10**10 def main(): str=input() n=len(str) if n==2: str("-1 -1") return 0 for i in range(n-2): temp=str[i:i+3] for j in range(2): for k in range(j+1,2): if temp[j]==temp[k]: print("{0} {1}".format(i+1,i+3)) return 0 print("-1 -1") if __name__=="__main__": main()
s505056786
p04032
u711741418
1487106592
Python
Python (3.4.3)
py
Runtime Error
46
3188
411
#!/usr/bin/env python3 # -*- coding: utf-8 -*- s = input() def search(s): for i in range(len(s)-1): if s[i] == s[i+1]: return i+1, i+2 if s[i] == s[i+2]: return i+1, i+3 return -1, -1 if __name__ == "__main__": a, b = search(s) if a == -1: print("-1 -1") else: print(a, end="") print(' ', end="") print(b, end="")
s316503395
p04032
u591287669
1471283128
Python
Python (3.4.3)
py
Runtime Error
42
3064
235
from pandas import Series ser1 = Series(list(input())) for w in range(2,len(ser1)+1): for st in range(0,len(ser1)+1-w): if ser1[st:st+w].value_counts()[0] > w/2: print(st+1,st+w) exit() print(-1,-1)
s822410002
p04032
u886545507
1471184469
Python
Python (2.7.6)
py
Runtime Error
71
2692
215
#coding: utf-8 #ABC043D import sys s=raw_input() for i in xrange(len(s)-1): if s[i]==s[i+1]: print i+1,i+2 sys.exit() for i in xrange(len(s)-1): if s[i]==s[i+2]: print i+1,i+3 sys.exit() print -1,-1
s325810491
p04032
u277373937
1471142251
Python
Python (2.7.6)
py
Runtime Error
29
2568
385
import sys s = list(raw_input()) if len(s) == 2: if s[0] == s[1]: print 1, 2 else print -1, -1 else: for n in [3]: for i in xrange(len(s) - n + 1): sub = s[i:i+n] for char in set(sub): if sub.count(char) >= n / 2 + n % 2: print i + 1, i + n sys.exit() print -1, -1
s382336504
p04032
u277373937
1471142072
Python
Python (2.7.6)
py
Runtime Error
26
2568
398
import sys s = list(raw_input()) if len(s) == 2: if s[0] == s[1]: print 1, 2 else print -1, -1 else: for n in range(3, len(s)): for i in xrange(len(s) - n + 1): sub = s[i:i+n] for char in set(sub): if sub.count(char) >= n / 2 + n % 2: print i + 1, i + n sys.exit() print -1, -1
s120774191
p04032
u277373937
1471141980
Python
Python (2.7.6)
py
Runtime Error
30
2568
395
import sys s = list(raw_input()) if len(s) == 2: if s[0] == s[1]: print 1, 2 else print -1, -1 else: for n in range(3, 100): for i in xrange(len(s) - n + 1): sub = s[i:i+n] for char in set(sub): if sub.count(char) >= n / 2 + n % 2: print i + 1, i + n sys.exit() print -1, -1
s971840761
p04033
u478417863
1601084402
Python
PyPy3 (7.3.0)
py
Runtime Error
81
68704
386
import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines N, M = map(int, readline().split()) m = map(int, read().split()) count = [1] * (N+1) red = [0] * (N+1) red[1] = True for x, y in zip(m, m): count[x] -= 1 count[y] += 1 if red[x]: red[y] = 1 if not count[x]: red[x] = 0 print(sum(red))
s552814198
p04033
u629540524
1600889773
Python
Python (3.8.2)
py
Runtime Error
30
8864
136
a,b = map(int,input().split()) c= (b-a+1)*(a+b)//2 if c>0: print("Positive") elif c=0: print("Zero") else: print("Negative")
s426788752
p04033
u318427318
1600120059
Python
Python (3.8.2)
py
Runtime Error
24
9136
389
#-*-coding:utf-8-*- import sys input=sys.stdin.readline import itertools def main(): a,b = map(int,input().split()) datas = list(range(a,b+1)) answer=1 if a == 0 or b ==0 or (a<0 and b>0): print("Zero") exit() else: if abs(a-b)%2!=0: print("Positive") else: print("Negative") if __name__=="__main__": main()
s579550764
p04033
u318427318
1600119306
Python
Python (3.8.2)
py
Runtime Error
31
8956
393
#-*-coding:utf-8-*- import sys input=sys.stdin.readline import itertools def main(): a,b = map(int,input().split()) datas = list(range(a,b+1)) answer=1 if 0 in datas: print("Zero") exit() else: for i in datas: answer*=i if answer>=0: print("Positive") else: print("Negative") if __name__=="__main__": main()
s989601197
p04033
u977605150
1600094495
Python
Python (3.8.2)
py
Runtime Error
21
8996
206
a, b = map(int, input().split()) c = b - a if a <= 0 <= b: print("Zero") elif a > 0: print("Positive") elif b < 0:a if c%2 == 1: print("Positive") else: print("Negative")
s900317931
p04033
u468972478
1599701193
Python
Python (3.8.2)
py
Runtime Error
30
9140
207
a, b = map(int, input().split()) s = list(range(a, b+1)) if 0 in s: print("Zero") else: c = 0 for i in s: if i < 0: c += 1 if c % 2 == 0: print("Positive") else: print("Negative")
s550919653
p04033
u980205854
1599404289
Python
PyPy3 (7.3.0)
py
Runtime Error
98
74536
195
# C - Exception Handling N = int(input()) A = [int(input()) for i in range(N)] m1 = max(A) i = 0 while A[i]<m1: i += 1 m2 = max(A[:i]+A[i+1:]) for j in range(N): print(m1 if i!=j else m2)
s475684347
p04033
u336236846
1599331707
Python
Python (3.8.2)
py
Runtime Error
20
8740
360
import math var numero1 = -10 * 9, numero2 = 10 * - 9, cadena "1, 3,"; console.log( numero1 === numero2); console.log( numero1 !== numero2; console.log( numero1 < numero2); console.log( numero1 > numero2); console.log( numero1 <= numero2); console.log( -90 >= 90); document.write(numero1 === 1,3) document.write(numero2 === "positive, 1*2*3 = 6") return = 0
s192725871
p04033
u968404618
1598495677
Python
Python (3.8.2)
py
Runtime Error
29
9116
228
a, b = map(int, input().split()) if a <= 0 and b >= 0: print("Zero") elif a < 0 and b < 0: if len(list(range(a, b+1))) % 2: print("Negative") else: print("Positive") else: print("Positive")
s670500630
p04033
u968404618
1598495455
Python
Python (3.8.2)
py
Runtime Error
27
9044
185
a, b = map(int, input().split()) if a <= 0 and b >= 0: print("Zero") elif a < 0 and b < 0: if len(list(range(a, b+1))) % 2: print("Negative") else: print("Positive")
s355558543
p04033
u869265610
1597156410
Python
Python (3.8.2)
py
Runtime Error
25
9136
263
a,b=map(int,input().split()) if 0<a: print("Positive") exit() W=list(range(a,b+1)) ne=0 if 0 in W: print("Zero") exit() else: for i in range(len(W)): if W[i]<0: ne+=1 if ne%2==0: print("Positive") else: print("Negative")
s561334733
p04033
u869265610
1597156195
Python
Python (3.8.2)
py
Runtime Error
28
9180
216
a,b=map(int,input().split()) W=list(range(a,b+1)) ne=0 if 0 in W: print("Zero") exit() else: for i in range(len(W)): if W[i]<0: ne+=1 if ne%2==0: print("Positive") else: print("Negative")
s609394970
p04033
u972658925
1597037031
Python
Python (3.8.2)
py
Runtime Error
29
8928
252
a,b = map(int,input().split()) lst = list(range(a,b+1)) if a > 0 and b > 0: print("Positive") elif a <= 0 and b >= 0: print("Zero") elif a < 0 and b < 0: if ((b-a)-1) % 2 != 0: print("Negative") else: print("Positive")
s137275194
p04033
u498575211
1596249543
Python
Python (3.8.2)
py
Runtime Error
25
9160
430
a, b = map(int, input().split()) ans = "" if a > 0: ans = "Positive" elif a <= 0 and b >= 0: ans = "Zero" elif a < 0 and b < 0: if (abs(a-b)+1) % 2 == 0: ans = "Positive" else: ans = "Negative" a, b = map(int, input().split()) ans = "" if a > 0: ans = "Positive" elif a <= 0 and b >= 0: ans = "Zero" elif a < 0 and b < 0: if (abs(a-b)+1) % 2 == 0: ans = "Positive" else: ans = "Negative" print(ans)
s665716431
p04033
u942051624
1595896289
Python
Python (3.8.2)
py
Runtime Error
23
8960
330
a,b=map(int,input().split()) if a>0 and b>0: print('Positive') exit() elif a=0 or b=0: print('Zero') exit() elif a<0 and 0<b: if abs(a)%2==0: print('Positive') exit() else: print('Negative') exit() else: if abs(b-a)%2==0: print('Negative') exit() else: print('Positive') exit()
s607057264
p04033
u661060077
1594426192
Python
Python (3.8.2)
py
Runtime Error
25
8772
168
if a > 0: print('Positive') if a <= 0 and b >= 0: print('Zero') else: if (b - a + 1) % 2 == 0: print('Positive') else: print('Negative')
s508734179
p04033
u694665829
1594318826
Python
Python (3.8.2)
py
Runtime Error
26
8916
266
a,b=map(int,inout().split()) if a>=0: print("Positive" if a!=0 else "Zero") if a<0 and b>0: print("Zero") if b<=0: if b==0: print("Zero") else: if (a-b+1)%2==0: print("Positive") else: print("Negative")
s233356287
p04033
u098982053
1594027487
Python
Python (3.8.2)
py
Runtime Error
29
9180
227
a,b = map(int,input().split()) if (a<0 and b>0) or a == 0 or b == 0: print("Zero") else: nega = [i for i in list(range(a,b+1)) if i<0] if len(nega)%2==0: print("Positive") else: print("Negative")
s240656002
p04033
u232873434
1593875031
Python
PyPy3 (7.3.0)
py
Runtime Error
100
74112
239
a,b = map(int,input().split()) if (a>0) & (b>0): print('Positive') elif (a<0) & (b>0): print('Zero') elif (a==0) or(b==0): print('Zero') else: if (b-a)%2==1: print('Positive') else: print('Negative') 
s975202849
p04033
u068142202
1593535834
Python
Python (3.8.2)
py
Runtime Error
24
9164
268
a, b = map(int, input().split()) numbers = list(range(a, b + 1)) if a <= 0: if 0 <= b or a == 0 or b == 0: print("Zero") exit() if len(numbers) % 2 != 0: print("Negative") else: print("Positive") else: print("Positive")
s888929671
p04033
u068142202
1593535660
Python
Python (3.8.2)
py
Runtime Error
25
9168
246
a, b = map(int, input().split()) numbers = list(range(a, b + 1)) if a < 0: if 0 < b: print("Zero") exit() if len(numbers) % 2 != 0: print("Negative") else: print("Positive") else: print("Positive")
s155511687
p04033
u068142202
1593535343
Python
Python (3.8.2)
py
Runtime Error
28
9168
251
a, b = map(int, input().split()) numbers = list(range(a, b + 1)) if a < 0: if 0 < b: print("Zero") exit() if numbers.index(-1) % 2 != 0: print("Positive") else: print("Negative") else: print("Positive")
s271398160
p04033
u068142202
1593535281
Python
Python (3.8.2)
py
Runtime Error
29
9128
253
a, b = map(int, input().split()) numbers = list(range(a, b + 1)) if a < 0: if 0 < b: print("Zero") exit() elif numbers.index(-1) % 2 != 0: print("Positive") else: print("Negative") else: print("Positive")
s500387948
p04033
u068142202
1593535238
Python
Python (3.8.2)
py
Runtime Error
25
9168
238
a, b = map(int, input().split()) numbers = list(range(a, b + 1)) if a < 0: if 0 < b: print("Zero") elif numbers.index(-1) % 2 != 0: print("Positive") else: print("Negative") else: print("Positive")
s508615445
p04033
u492737043
1593486237
Python
Python (3.8.2)
py
Runtime Error
22
9136
165
a,b=map(int,input().split()) if ab<=0: print('Zero') elif a>0: print('Positive') elif b<0: if (b-a+1)%2==0: print('Positive') else: print('Negative')
s248262293
p04033
u841021102
1592960135
Python
Python (3.8.2)
py
Runtime Error
22
8768
177
a, b = map(int(input().split()) if a > 0: print("Positive") elif a < 0 : if (b - a) % 2 == 0 : print("Positive") else: print("Negative") else: print("Zero")
s671547226
p04033
u864276028
1592883254
Python
Python (3.8.2)
py
Runtime Error
20
9032
187
a,b = map(int, input().split()) L = [] for i in range (a,b+1): L.append(i) P = 1 for j in L: P *= j if P > 0: print('Positive') elif P = 0: print('Zero') else: print('Negetive')
s119183800
p04033
u034624359
1592443112
Python
Python (3.4.3)
py
Runtime Error
17
2940
170
a,b=int(input().split()) k=1 for i in range(a,b+1): k=k*i if k>0: print("Positive") return elif k=0: print("Zero") return elif k<0: print("Negative") return
s311085572
p04033
u364386647
1591911470
Python
Python (3.4.3)
py
Runtime Error
17
3060
261
def resolve(): a, b = list(map(int, input().split())) l = list(range(a, b + 1)) if a <= 0 and b >= 0: print('Zero') elif b < 0 and (b - a + 1) % 2 == 1: print('Negative') else: print('Positive') return resolve()
s500252079
p04033
u364386647
1591911244
Python
Python (3.4.3)
py
Runtime Error
17
3060
314
def resolve(): a, b = list(map(int, input().split())) l = list(range(a, b + 1)) if a <= 0 and b >= 0: print('Zero') elif a > 0: print('Positive') else: if (b - a) % 2 == 0: print('Negative') else: print('Positive') return resolve()
s020190622
p04033
u364386647
1591910797
Python
Python (3.4.3)
py
Runtime Error
18
3064
345
def resolve(): a, b = list(map(int, input().split())) l = list(range(a, b + 1)) if 0 < a and a <= b: print('Positive') elif a <= b and b < 0: if (b - a + 1) % 2 == 0: print('Positive') else: print('Negative') elif a <= 0 and 0 <= b: print('Zero') return resolve()
s489127638
p04033
u364386647
1591910601
Python
Python (3.4.3)
py
Runtime Error
20
3316
433
def resolve(): a, b = list(map(int, input().split())) l = list(range(a, b + 1)) l.sort() minus = list(filter(lambda x: x < 0, l)) minus = len(minus) if a <= 0 and b >= 0: print('Zero') return if a < 0 and b < 0: minus = len(range(a, b + 1)) if minus % 2 == 1: print('Negative') return else: print('Positive') return return resolve()
s433475079
p04033
u364386647
1591910275
Python
Python (3.4.3)
py
Runtime Error
17
3060
404
def resolve(): a, b = list(map(int, input().split())) l = list(range(a, b + 1)) l.sort() minus = list(filter(lambda x: x < 0, l)) minus = len(minus) if a <= 0 and b >= 0: print('Zero') return else: if minus % 2 == 1: print('Negative') return else: print('Positive') return return resolve()
s698357168
p04033
u364386647
1591910183
Python
Python (3.4.3)
py
Runtime Error
17
3060
392
def resolve(): a, b = list(map(int, input().split())) l = list(range(a, b + 1)) l.sort() minus = list(filter(lambda x: x < 0, l)) minus = len(minus) if 0 in l: print('Zero') return else: if minus % 2 == 1: print('Negative') return else: print('Positive') return return resolve()
s959414083
p04033
u364386647
1591910063
Python
Python (3.4.3)
py
Runtime Error
18
3060
380
def resolve(): a, b = list(map(int, input().split())) l = list(range(a, b + 1)) minus = list(filter(lambda x: x < 0, l)) minus = len(minus) if 0 in l: print('Zero') return else: if minus % 2 == 1: print('Negative') return else: print('Positive') return return resolve()
s762245529
p04033
u665369939
1591647247
Python
Python (3.4.3)
py
Runtime Error
17
2940
236
a,b = map(int,input().split()) if a>=0: print('Positive') elif a<=0 and b>=0: if abs(a)%2 == 0: print('Positive') else: print('Negative') else: if abs(b-a)%2 == 0: print('Positive') else: print('Negative')
s423735064
p04033
u213580455
1590103587
Python
Python (3.4.3)
py
Runtime Error
19
3064
1221
redBalls = [] currentRedBall = 0 def putBall(i, balles, routes): global redBalles global currentRedBall if i == len(routes): redBalles[currentRedBall] = 1 return None _from = routes[i][0]-1 _to = routes[i][1]-1 if balles[_from]%2 == 0: balles[_from] -= 2 balles[_to] += 2 putBall(i+1, balles, routes) else: if balles[_from] == 1: balles[_from] -= 1 balles[_to] += 1 currentRedBall = _to putBall(i+1, balles, routes) else: _balles = [b for b in balles] _balles[_from] -= 1 _balles[_to] += 1 currentRedBall = _to putBall(i+1, _balles, routes) _balles = [b for b in balles] _balles[_from] -= 2 _balles[_to] += 2 currentRedBall = _from putBall(i+1, _balles, routes) def answer(n, routes): global redBalles redBalles = [0]*n balles = [1] + [2]*(n-1) putBall(0, balles, routes) return sum(redBalles) n, m = map(int, input().split()) routes = [] for _ in range(m): routes.append(list(map(int, input().split()))) print(answer(n, routes))
s011343039
p04033
u680503348
1590079600
Python
Python (3.4.3)
py
Runtime Error
17
3064
780
# For taking integer inputs. def inp(): return(int(input())) # For taking List inputs. def inlist(): return(list(map(int, input().split()))) # For taking string inputs. Actually it returns a List of Characters, instead of a string, which is easier to use in Python, because in Python, Strings are Immutable. def instr(): s = input() return(list(s[:len(s)])) # For taking space seperated integer variable inputs. def invr(): return(map(int, input().split())) a, b = invr() res = "Negative" if a > 0 and b > 0: res = "Positive" if a < 0 and b < 0: temp = abs(abs(a)-abs(b)) + 1 if temp % 2 == 0: res = "positive" else: res = "Negative" if a == b: res = "Positive" if a <= 0 and b = > 0: res = "Zero" print(res)
s338204126
p04033
u779293207
1589218787
Python
Python (3.4.3)
py
Runtime Error
17
2940
158
a,b=map(int,input().split()) if a<=b<0: if print('Negative' if (-1)**(a-b-1)==-1 else 'Positive') elif a<=0<=b: print('Zero') else: print('Positive')
s955853453
p04033
u711238850
1589029074
Python
Python (3.4.3)
py
Runtime Error
17
2940
199
a,b = tuple(map(int,input().split())) if a=<0 and b>=0: print("Zero") elif a<0 and b<0: if (b-a+1)%2==0: print("Positive") else: print("Negative") elif a>0 and b>0: print("Positive")
s141593142
p04033
u057964173
1588518739
Python
Python (3.4.3)
py
Runtime Error
20
3188
308
import sys def input(): return sys.stdin.readline().strip() def resolve(): a,b=map(int, input().split()) l=list(range(a,b+1)) seki=1 for i in l: seki=seki*i if seki>0: print('Positive') elif seki==0: print('Zero') else: print('Negative') resolve()
s929516157
p04033
u057964173
1588516206
Python
Python (3.4.3)
py
Runtime Error
18
3060
304
import sys def input(): return sys.stdin.readline().strip() def resolve(): a,b=map(int, input().split()) l=list(range(a,b+1)) seki=1 for i in l: seki*=i if seki>0: print('Positive') elif seki==0: print('Zero') else: print('Negative') resolve()
s849556216
p04033
u057964173
1588515812
Python
PyPy3 (2.4.0)
py
Runtime Error
187
38384
304
import sys def input(): return sys.stdin.readline().strip() def resolve(): a,b=map(int, input().split()) l=list(range(a,b+1)) seki=1 for i in l: seki*=i if seki>0: print('Positive') elif seki==0: print('Zero') else: print('Negative') resolve()
s965887030
p04033
u263933075
1588085985
Python
Python (3.4.3)
py
Runtime Error
18
2940
156
a=list(map(int,input().split())) b=1 for i in range(a[0],a[1]+1): b*=i if b>0: print('Positive') elif b<0: print('Negative') elif b=0: print('Zero')
s728269288
p04033
u021548497
1587166340
Python
Python (3.4.3)
py
Runtime Error
17
2940
159
a, b = map(int, input()) if a*b < 0: print("Zero") elif a > 0: print("Positive") else: if (b-a)%2: print("Positive") else: print("Negative")
s261777375
p04033
u262244504
1586200921
Python
Python (3.4.3)
py
Runtime Error
18
3060
179
ans=a c=a if a==b : ans=a**b else: while c<=b: c=c+1 ans=ans*c pm = numpy.sign(ans) if pm==0: print('zero') elif pm==1: print('Positive') else: print('Negative')
s327348712
p04033
u602677143
1584581409
Python
Python (3.4.3)
py
Runtime Error
17
3060
263
a,b,c = map(int,input().split()) if (a > 0 and b > 0) or (a > b and a > 0) or (b > a and b > 0): print("Positive") elif (a-b) == 0 or (b-a) == 0: print("Zero") elif (a < 0 and b < 0) or (a > b and a < 0) or (b > a and b < 0): print("Negative") print()