problem_id
stringclasses
428 values
submission_id
stringlengths
10
10
status
stringclasses
2 values
code
stringlengths
5
816
p03625
s435073635
Accepted
n = int(input()) l = list(map(int, input().split())) from collections import Counter c = Counter(l) c = sorted(c.items(), reverse=1) temp = 0 for i in range(len(c)): if c[i][1] >= 2: if temp != 0: print(temp * c[i][0]) exit() else: temp = c[i][0] if c[i][1] >= 4: print(c[i][0] ** 2) exit() else: print(0)
p03345
s092279564
Accepted
A ,B , C , K = map(int,input().split()) if K % 2 == 0: print(A - B) else: print(B - A)
p04019
s434797648
Wrong Answer
import sys input = sys.stdin.readline def main(): S = input().rstrip('\n') if ('S' in S == 'N' in S) and ('E' in S == 'W' in S): print('Yes') else: print('No') if __name__ == '__main__': main()
p03720
s284921459
Wrong Answer
import numpy as np n, m = map(int, input().split()) mat = [[0] * n] * n mat = np.array(mat) for i in range(m): a, b = map(int, input().split()) tar1 = mat[a - 1, b - 1] tar2 = mat[b - 1, a - 1] if (tar1 == 0): mat[a - 1, b - 1] = 1 if (tar2 == 0): mat[b - 1, a - 1]= 1 #print(mat) for i in range(n): ans = np.sum(mat[i, :]) print(ans)
p04033
s900785367
Accepted
def main(): a, b = (int(i) for i in input().split()) if a*b <= 0: print("Zero") elif 0 < a: print("Positive") else: if (b-a+1) % 2 == 0: print("Positive") else: print("Negative") if __name__ == '__main__': main()
p03380
s059408775
Accepted
n = int(input()) dat = list(map(int, input().split())) dat.sort() x = dat[-1] xx = x / 2 dat = dat[:-1] mindiff = 999999999999999999999999999 minnum = None for i in range(n-1): if abs(xx-dat[i]) < mindiff: mindiff = abs(xx-dat[i]) minnum = dat[i] print(x, minnum)
p02772
s984998564
Wrong Answer
N=int(input()) S=[int(s) for s in input().split()] for i in range(N): if S[i]%2==0 and S[i]%15!=0: print("DENIED") elif i==N-1: print("APPROVED")
p02768
s707867331
Accepted
m=10**9+7 n,a,b=map(int,input().split()) s=r=1 for i in range(b):s+=r*(i==a);r=r*(n-i)*pow(i+1,m-2,m)%m print((pow(2,n,m)-s-r)%m)
p02725
s144741188
Accepted
from sys import stdin def main(): input = lambda: stdin.readline()[:-1] K, N = map(int, input().split()) A = tuple(map(int, input().split())) d = K - A[-1] + A[0] for i in range(N - 1): d = max(d, A[i+1] - A[i]) print(K - d) main()
p02658
s359996620
Wrong Answer
n = int(input()) big = 0 a = list(map(int, input().split())) ans = 1 for num in a: ans = ans * num if ans > 10 ** 18: print(-1) big = 1 break if big == 0: print(ans)
p02629
s564027579
Accepted
n= (int)(input()) ans = "" count = 0 if n % 26 != 0: ans += chr(n % 26 + 96) n -= n % 26 else: ans += 'z' n -= 26 for i in range(1, 11): n = n // 26 if n == 0: break if n % 26 != 0: ans = chr(n % 26 + 96) + ans n -= n % 26 else: ans = 'z' + ans n -= 26 print(ans)
p02946
s553889837
Wrong Answer
K, X = map(int, input().split()) list_ans = [] for i in range(K): list_ans.append(X-(K-(i+1))) for j in range(K-1): list_ans.append(X+j+1) print(list_ans)
p03680
s160600753
Accepted
n = int(input()) a = [int(input()) for _ in range(n)] now = 1 ans = 0 while True: now = a[now-1] ans += 1 if (now==2): print(ans) break elif (now==1): print(-1) break elif (ans>len(a)): print(-1) break
p02983
s736430333
Accepted
l, r = map(int, input().split()) interval = min(r - (l - 1), 2019) min_remain = 2018 for i in range(l, l + interval): for j in range(i + 1, l + interval): if (i * j) % 2019 < min_remain: min_remain = (i * j) % 2019 print(min_remain)
p02627
s455320302
Wrong Answer
letter = str(input()) if letter.islower is True: print('a') else: print('A')
p03095
s670915826
Accepted
from collections import defaultdict n = int(input()) s = input() MOD = 10**9 + 7 dd = defaultdict(int) for c in s: dd[c] += 1 ans = 0 for c in s: dd[c] -= 1 tmp = 1 for k, v in dd.items(): if k == c: continue else: tmp *= v + 1 ans = (ans + tmp) % MOD print(ans)
p03127
s163143757
Accepted
n = int(input()) al = list(map(int, input().split())) t = al[0] def gcd(a, b): while b: a, b = b, a % b return a for i in range(1, n): t = gcd(t, al[i]) # a,bの最大公約数 print(t)
p03059
s644364653
Wrong Answer
a,b,t = map(int,input().split()) print((b*(t+0.5))//a)
p03073
s740007540
Wrong Answer
S = input() count_a = 0 count_b = 0 l=len(S) for i in range(l//2): if S[2*i] =='0': count_a +=1 if S[2*i + 1]=='1': count_a +=1 if S[2*i] =='1': count_b +=1 if S[2*i + 1]=='0': count_b +=1 if l%2==1: if S[l-1] =='0': count_a +=1 if S[l-1] =='1': count_a +=1 print(min(count_a, count_b))
p03705
s845782915
Accepted
n,a,b=map(int,input().split()) if a>b: print(0) exit() if n==1 and a!=b: print(0) exit() if n==1 and a==b: print(1) exit() m=n-2 print(b*m-a*m+1)
p02554
s040225198
Wrong Answer
n=int(input()) print((n*(n-1)*10**(n-2))%1000000007)
p02947
s166355815
Wrong Answer
n = int(input()) S = [list(input()) for i in range(n)] ans = 0 for i in range(n-1): for j in range(i+1,n): if set(S[i]) != set(S[j]): pass else: if S[i].sort() == S[j].sort(): ans += 1 else: pass print(ans)
p03062
s692329189
Accepted
n=int(input()) a=list(map(int,input().split())) sm=sum(map(abs,a)) f=1 for i in range(n-1): f= 1 if a[i]*f>=0 else -1 print (sm if f*a[n-1]>0 or 0 in a else sm-2*min(map(abs,a)))
p03338
s761020678
Accepted
n = int(input()) s = list(input()) p = 0 for i in range(1,n): a = list(s[0:i]) a = list(set(a)) b = list(s[i:]) t = 0 for j in range(len(a)): if a[j] in b: t += 1 p = max(t,p) print(p)
p03838
s762893985
Accepted
x, y = map(int, input().split()) ans = 0 ans += abs(abs(y) - abs(x)) if abs(x) <= abs(y): if x < 0: ans += 1 if y < 0: ans += 1 else: if x >= 0: ans += 1 if y > 0: ans += 1 print(ans)
p03448
s421363183
Accepted
def main(): A = int(input()) B = int(input()) C = int(input()) X = int(input()) ans = 0 for i in range(A+1): for j in range(B+1): tmp = X - 500*i - 100*j if tmp >= 0 and tmp//50 <= C: ans += 1 print(ans) if __name__ == "__main__": main()
p03555
s316169889
Accepted
c1 = input() c2 = input() print('YES' if c1[::-1] == c2 else 'NO')
p02555
s236516094
Wrong Answer
n = int(input()) mod = pow(10, 9) + 7 l = [] for i in range(2001): if i < 3: l.append(0) elif 3 <= i <= 5: l.append(1) else: sum_ = 1 for j in range(i-5): sum_ += l[3+j] * l[i-(3+j)] sum_ = sum_ % mod l.append(sum_) print(l[n])
p02924
s006760475
Accepted
#!/usr/bin/env python import sys import re from collections import deque, defaultdict from itertools import combinations, combinations_with_replacement import bisect from math import factorial, sqrt, log, ceil, floor sys.setrecursionlimit(1000000) def main(): input = sys.stdin.readline #N, M = map(int, input().split()) #N, K = map(int, input().split()) #ps = list(map(int, input().split())) N = int(input()) print(N * (N - 1) // 2) if __name__ == '__main__': main()
p02595
s687599679
Wrong Answer
N,D=map(int, input().split()) a=0 for i in str(N): x,y=map(int, input().split()) if x*x+y*y<=D*D: a+=1 else: pass print(a)
p03852
s140656509
Accepted
v = ["a","e","i","o","u"] a = input() if a in v: print("vowel") else: print("consonant")
p02952
s159548153
Wrong Answer
import math import os import random import re import sys if __name__ == '__main__': n = int(input()) res = math.ceil(math.log(n, 10)) s = 1 if math.log(n, 10) % 2 == 0 else 0 for i in range(0, res, 2): k = 9*(10**i) if n > k: s = s + k else: s = s + n - 10**i + 1 print(s)
p02813
s539323288
Accepted
import itertools n = int(input()) P = list(map(str, input().split())) Q = list(map(str, input().split())) p = '' for e in P: p += e p = int(p) q = '' for e in Q: q += e q = int(q) l = [str(i) for i in range(1, n + 1)] r = itertools.permutations(l, n) a = [] for v in r: s = '' for e in v: s += e s = int(s) a.append(s) print(abs(a.index(p) - a.index(q)))
p02811
s261345086
Wrong Answer
k,x = map(int,input().split()) if x<500*k: print("No") else: print("Yes")
p03162
s686376119
Accepted
N = int(input()) abc = [list(map(int, input().split())) for i in range(N)] abc.append([0, 0, 0]) dp = [[-1] * 4 for i in range(N + 1)] dp[0] = [0, 0, 0] for i in range(1, N + 1): dp[i][0] = max([dp[i - 1][1] + abc[i - 1][1], dp[i - 1][2] + abc[i - 1][2]]) dp[i][1] = max([dp[i - 1][0] + abc[i - 1][0], dp[i - 1][2] + abc[i - 1][2]]) dp[i][2] = max([dp[i - 1][1] + abc[i - 1][1], dp[i - 1][0] + abc[i - 1][0]]) print(max(dp[N]))
p03456
s688894078
Accepted
a,b = map(str,input().split()) c = int(a + b) if c ** 0.5 ==int(c ** 0.5): print('Yes') else: print('No')
p03105
s962205508
Accepted
a,b,c=map(int,input().split()) print(min(c, b // a))
p02888
s020843851
Accepted
import bisect import sys sys.setrecursionlimit(10 ** 6) INF = float("inf") MOD = 10 ** 9 + 7 def input(): return sys.stdin.readline().strip() def main(): N = int(input()) L = list(map(int, input().split())) L.sort() ans = 0 for i in range(N - 2): for j in range(i + 1, N - 1): ab = L[i] + L[j] idx = bisect.bisect_left(L, ab) ans += max(idx - j - 1, 0) print(ans) if __name__ == "__main__": main()
p03137
s092324709
Accepted
import sys input = sys.stdin.readline n,m = map(int,input().split()) if n >= m: print(0) exit() s = set(map(int,input().split())) l = list(s) l.sort() gap = [] for i in range(len(l)-1): gap.append(l[i+1]-l[i]) gap.sort() print(sum(gap[:1-n]) if n!= 1 else sum(gap))
p02748
s723327891
Accepted
import itertools a,b,m = map(int, input().split()) A = list(map(int, input().split())) B = list(map(int, input().split())) P = [list(map(int,input().split())) for i in range(m)] y = [] #普通に足算する aa = min(A) bb = min(B) xx =aa+bb #割引券使う for i in range(m): y.append(A[P[i][0]-1] + B[P[i][1]-1] - P[i][2]) #min出す yy = min(y) print(min(xx,yy))
p03761
s343063822
Accepted
n = int(input()) a = input() alphabet = {} for i in a: alphabet.update({i: a.count(i)}) for i in range(n-1): b = input() for j in alphabet: alphabet[j] = min(alphabet[j], b.count(j)) ans = [] for i in alphabet: ans += [i]*alphabet[i] print(''.join(sorted(ans)))
p03767
s719418090
Wrong Answer
#-*-coding:utf-8-*- import sys input=sys.stdin.readline import numpy as np def main(): numbers=[] dp=[] n = int(input()) numbers=np.array(list(map(int,input().split())),dtype=int) numbers.sort() t1,t2,t3=np.hsplit(numbers,3) print(t2.sum()) if __name__=="__main__": main()
p03086
s058900537
Accepted
s=input() gene = ["A","T","G","C"] ans=0 counter=0 for i in range(len(s)): for j in range(i,len(s)): if(s[j] in gene): counter += 1 else: if(counter > ans): ans=counter counter=0 break if(counter > ans): ans=counter counter=0 print(ans)
p02642
s455030401
Accepted
n = int(input()) a_li = list(map(int,input().split())) cnt = [0]*(10**6+1) for i in a_li: cnt[i] += 1 unique = [] for i in range(10**6+1): if cnt[i] == 1: unique.append(i) #print(unique) a_li = set(a_li) cnt = [0]*(10**6+1) for i in a_li: for j in range(i * 2, 10 ** 6 + 1, i): cnt[j] = 1 ans = 0 for i in unique: if cnt[i] == 0: ans += 1 print(ans)
p02792
s518731969
Accepted
N=int(input()) A=[[0 for s in range(10)] for t in range(10)] for i in range(1,N+1): s = str(i) A[int(s[0])][int(s[-1])]+=1 x=0 for s in range(10): for t in range(10): x+=A[s][t]*A[t][s] print(x)
p02597
s306166819
Accepted
import sys input = sys.stdin.readline N = int(input()) c = input() nR = c.count('R') #nW = c.count('W') lnR = c[:nR].count('R') #lnW = c[:nW].count('W') print(nR-lnR)
p02688
s160425624
Accepted
N,K = map(int,input().split()) li = [] count = 0 for i in range(K): d = int(input()) a = list(map(int,input().split())) for j in range(d): li.append(a[j]) for i in range(N): if i+1 not in li: count += 1 print(count)
p02922
s059504531
Wrong Answer
a, b = map(int, input().split()) cnt = 0 power = 1 if a > b: print(1) exit() while(power < b): cnt += 1 power = power - 1 + a print(cnt)
p03017
s350568658
Wrong Answer
N, A, B, C, D = map(int, input().split()) S = input() if "##" in S: print("No") exit(0) if C <= D: print("Yes") exit(0) ans = False for i in range(B - 1, D - 1): if S[i - 1] == '.' and S[i] == '.' and S[i + 1] == '.': ans = True break if ans: print("Yes") else: print("No")
p03962
s740736809
Accepted
a = list(input().split()) print(len(set(a)))
p03086
s216519829
Wrong Answer
s = input() result = "" result_old = "" #現在の文字列の長さ #1個前の文字列の長さ for i in range(int(len(s))): if s[i] == "A" or s[i] == "C" or s[i] == "G" or s[i] == "T": result = result +s[i] else: if int(len(result_old)) < int(len(result)): result_old = result else: result = [None for _ in range(int(len(result)))] result = "" print(len(result_old))
p04034
s095550138
Wrong Answer
n,m=map(int,input().split()) check=[False]*n check[0]=True ball=[1]*n for i in range(m): x,y=map(int,input().split()) x-=1 y-=1 if check[x]: check[y]=True else: continue ball[y]+=1 ball[x]-=1 if ball[x]==0: check[x]=False ans=0 for i in range(n): if ball[i]==0: check[i]=False for chk in check: if chk: ans+=1 print(ans)
p03127
s881965447
Accepted
import functools import fractions n = int(input()) a = [int(i) for i in input().split()] gcd = functools.reduce(fractions.gcd, a) print(gcd)
p03241
s521076754
Accepted
N, M = map(int, input().split()) def make_divisors(n): divisors = [] for i in range(1, int(n**0.5)+1): if n % i == 0: divisors.append(i) if i != n // i: divisors.append(n//i) divisors.sort() return divisors divs = make_divisors(M) ans = [] for i in divs: if i * N <= M: ans.append(i) print(max(ans))
p03481
s201371124
Wrong Answer
x,y=map(int,input().split()) from math import log print(1+int(log(y/x,2)))
p03779
s568432069
Accepted
from math import ceil x = int(input()) print(ceil((-1+(-1+8*x)**0.5)/2))
p03637
s361330016
Accepted
def main(): N = int(input()) alist = list(map(int, input().split())) adj4cou = 0 adjn4y2 = 0 for a in alist: if a%4 == 0: adj4cou += 1 if adj4cou >= N//2: return 'Yes' elif a%2 == 0: adjn4y2 += 1 if adjn4y2 >= (N - 2*adj4cou): return 'Yes' return 'No' if __name__ == '__main__': print(main())
p03696
s192750879
Wrong Answer
from itertools import groupby N = int(input()) S = input() l = [[i, len(list(j))] for i, j in groupby(S)] + [[0, 0]] ans = "" s = 0 if l[0][0] == ")": ans += "(" * l[0][1] + ")" * l[0][1] s = 1 for i in range(s,len(l)-1)[::2]: m = max(l[i][1], l[i+1][1]) ans += "(" * m + ")" * m print(ans)
p03767
s709129489
Wrong Answer
n = int(input()) a = list(map(int, input().split())) a = sorted(a)[::-1] ans = [] for i in range(n): ans.append(a[i::n][1]) print(sum(ans))
p02843
s144617111
Accepted
n = int(input()) print(1 if divmod(n,100)[1] <= divmod(n,100)[0]*5 else 0)
p03494
s681266463
Wrong Answer
N = int(input()) A = list(map(int, input().split())) counter_min = 9 for a in A: counter = 0 while a%2 == 0: a /= 2 counter += 1 if counter < counter_min: counter_min = counter print(counter_min)
p02683
s142308111
Wrong Answer
import numpy as np n, m, x = map(int, input().split()) a = [list(map(int, input().split())) for _ in range(n)] a.sort(reverse=True) a = np.array(a) ans = np.array([0 for i in range(m+1)]) for i in a: ans += i for i in ans[1:]: if i < x: print(-1) exit() for i in a: cnt = 0 tmp = ans - i for j in tmp[1:]: if j >= x: cnt += 1 if cnt == m: ans -= i print(ans[0])
p03136
s083431507
Accepted
u = input() length = list(input().split()) h = [int(i) for i in length] if max(h) < sum(h)-max(h): print("Yes") else: print("No")
p04044
s817534499
Accepted
def main(): n, l = map(int, input().split()) s = [input() for _ in range(n)] s.sort() print("".join(s)) if __name__ == '__main__': main()
p02760
s952526790
Accepted
a = [list(map(int, input().split())) for _ in range(3)] n = int(input()) b = [int(input()) for _ in range(n)] lines = [set(x) for x in a] + [set(x) for x in zip(*a)] + [set([a[0][0], a[1][1], a[2][2]]), set([a[0][2], a[1][1], a[2][0]])] bs = set(b) if any(line.issubset(bs) for line in lines): print('Yes') else: print('No')
p03696
s407257400
Wrong Answer
import sys def I(): return int(sys.stdin.readline().rstrip()) def LS2(): return list(sys.stdin.readline().rstrip()) #空白なし N = I() S = LS2() a,b = 0,0 left = [] for i in range(N): if S[i] == '(': a += 1 else: b += 1 if a < b: a,b = 0,0 left.append('(') ANS = left + S + [')']*(a-b) print(*ANS)
p02873
s822861157
Wrong Answer
S = list(input()) lis = [0] * (len(S)+1) #最初は < を処理する for i in range(len(S)): if S[i] == "<": lis[i+1] = lis[i] + 1 for j in range(len(S)-1,0,-1): if S[j] == ">": lis[j] = max(lis[j],lis[j+1] + 1) print(sum(lis))
p03698
s983923449
Wrong Answer
import sys s=input() for i in range(len(s)+1): for j in range(len(s)+1): if s[i]==s[j]: print('no') sys.exit() print('yes')
p03329
s191798655
Accepted
#import collections #aa = collections.Counter(a) # list to list #from itertools import combinations # (string,3) 3回 mod = 10**9 + 7 def readInts(): return list(map(int,input().split())) def main(): n = int(input()) def count_(num,x): i = 0 while num > 0: i += num % x num //= x return i ans = n for j in range(n + 1): ans = min(ans,count_(j,6)+count_(n-j,9)) print(ans) if __name__ == '__main__': main()
p02628
s943753208
Accepted
N,K = map(int,input().split()) P = list(map(int,input().split())) P.sort() print(sum(P[:K]))
p02888
s176802619
Accepted
n = int(input()) nums = list(map(int, input().split(' '))) nums.sort() total = 0 for i in range(n-1, -1, -1): l = 0 r = i - 1 while l < r: if nums[l] + nums[r] > nums[i]: total += r - l r -= 1 else: l += 1 print(total)
p02947
s512133096
Wrong Answer
N=int(input()) s=[] for _ in range(N): tmp=list(input()) s.append(sorted(tmp)) cnt=0 def hantei(s): global cnt comp=s.pop(0) for n,word in enumerate(s): if(comp==word): cnt+=1 s.remove(comp) else: hantei(s[:]) hantei(s[:]) print(cnt)
p03210
s271898504
Accepted
X = input() print("YES" if X in "753" else "NO")
p03545
s831313113
Accepted
def kipp(i,f): if i == 3: if eval(f) == 7: print(f+"=7") exit() else: kipp(i+1,f+"+"+s[i+1]) kipp(i+1,f+"-"+s[i+1]) s = input() kipp(0,s[0])
p02584
s092001207
Accepted
X, K, D = map(int, input().split()) X = abs(X) q, m = divmod(X, D) if q >= K: print(X-K*D) elif (q+K)%2==0: print(m) else: print(-(m-D))
p02571
s403069236
Wrong Answer
S = input() T = input() ls = len(S) lt = len(T) a = 0 for i in range(lt): for j in range(i+1,lt+1): if T[i:j] in S[i:ls-lt+j]: if a < j -i: a = j - i print(lt-a)
p02838
s064415126
Wrong Answer
import sys ## io ## def IS(): return sys.stdin.readline().rstrip() def II(): return int(IS()) def MII(): return list(map(int, IS().split())) def MIIZ(): return list(map(lambda x: x-1, MII())) import numpy as np #======================================================# MOD=10**9+7 def main(): n = II() aa = np.array(MII()) ans = 0 for i in range(60): cnt1 = ((aa&1).sum())//1 ans += (cnt1*(n-cnt1)*(2**i))%MOD aa >>= 1 print(ans%MOD) if __name__ == '__main__': main()
p03319
s964378280
Wrong Answer
import math N,K = map(int,input().split()) A = list(map(int,input().split())) a = len(A) if a == K: ans = 1 else: ans = math.ceil(a /(K-1)) print(ans)
p03760
s021424537
Accepted
o = input() e = input() p = '' for i in range(len(e)): p += o[i] + e[i] if len(o) > len(e): p += o[-1] print(p)
p02622
s000671374
Accepted
s = list(input()) t = list(input()) cnt = 0 for i in range(len(s)): if s[i] != t[i]: cnt += 1 print(cnt)
p03745
s716417491
Wrong Answer
def solve(): n = int(input()) a = list(map(int, input().split())) state, cut = -1, 0 for i in range(n-1): #print(i, cut, state) if a[i] < a[i+1]: if state != 1: cut += 1 state = 1 else: if state != 0: cut += 1 state = 0 print(cut) return 0 if __name__ == "__main__": solve()
p03359
s311355566
Wrong Answer
a, b = [int(i) for i in input().split()] print(len(list(filter(lambda date: date[0] == date[1], [(m, d) for m in range(1, a + 1) for d in range(1, b + 1)]))))
p02730
s129809768
Accepted
import sys L=list(input()) N=len(L) R=N//2 for i in range(R): if L[i]!=L[N-1-i]: print("No") sys.exit() elif L[i]!=L[R-1-i]: print("No") sys.exit() print("Yes")
p03469
s467686920
Accepted
s = input() print('2018/01/' + s[-2:])
p03672
s262652006
Wrong Answer
s=input() for i in range(len(s)): s=s[:-1] if len(s)%2 ==0 and s[:len(s)//2] == s[len(s)//2:]: print(s) break
p02747
s952738549
Accepted
s = input() if s == "hi" or s == "hihi" or s == "hihihi" or s == "hihihihi" or s == "hihihihihi": print("Yes") else: print("No")
p04012
s540341599
Wrong Answer
w = list(input()) w.sort() i = 0 while i < len(w) -1: if w[i] != w[i+1]: print('No') exit() i += 2 else: print('Yes')
p03767
s921304933
Wrong Answer
n = int(input()) a = list(map(int, input().split())) a.sort(reverse=True) print(sum(a[n:2*n]))
p02879
s751677297
Accepted
A,B = map(int,input().split()) if A>9 or B>9: print(-1) else: print(A*B)
p03059
s663263165
Wrong Answer
a, b, t = (int(i) for i in input().split()) print(b * t//a)
p02748
s240556628
Accepted
a,b,m = map(int, input().split()) a = list(map(int, input().split())) b = list(map(int, input().split())) x = [] for i in range(m): x.append(list(map(int, input().split()))) min_a = min(a) min_b = min(b) money = min_a + min_b for i in range(m): kingaku = a[x[i][0]-1] + b[x[i][1]-1] - x[i][2] if kingaku < money: money = kingaku print(money)
p02755
s150529577
Accepted
a, b = map(int, input().split()) flag = 0 for i in range(2000): if (i*0.08)//1 == a: if (i*0.1)//1 == b: print(i) flag += 1 break else: if flag == 0: print("-1")
p02933
s889393409
Accepted
if int(input()) >= 3200: print(input()) else: print("red")
p02801
s305385019
Accepted
n=ord(input()) print(chr(n+1))
p02833
s543708617
Accepted
n = int(input()) count = 0 i = 1 while True: temp = 2 * (5 ** i) count += n // temp if temp > n: break else: i += 1 print(count if n % 2 == 0 else 0)
p03161
s755655737
Wrong Answer
[n, k] = [int(i) for i in input().split()] h = [int(i) for i in input().split()] dp = [10 ** 6 for _ in range(n)] dp[0] = 0 for i in range(n): for j in range(1, k+1): if i - j >= 0: dp[i] = min(dp[i] , dp[i-j] + abs(h[i] - h[i-j])) print(dp[n-1])
p03592
s188149149
Accepted
n, m, k = map(int, input().split()) flag = False for r in range(n+1): for c in range(m+1): if m*r + n*c - 2*c*r == k: flag = True break if flag: break print('Yes' if flag else 'No')
p02778
s837247793
Accepted
import re N = input() N = re.sub(r'[A-z]', 'x', N) print(N)
p02900
s526891906
Wrong Answer
import math from fractions import gcd a,b=map(int,input().split()) gd = gcd(a,b) gd_bun=list() valid = [0 for i in range(int(math.sqrt(gd))+1)] b=2 tmp=gd while 1: if tmp %b==0: tmp = tmp//b gd_bun.append(b) while 1: tmp = tmp // b if tmp%b: break if tmp==1: break b+=1 print(1+len(list(set(gd_bun))))
p02702
s023480799
Wrong Answer
## coding: UTF-8 S = input() #文字列型で受け取る N = len(S) remainder = [0] * 2019 for i in range(N): #print(S[i:], int(S[i:])%2019) remainder[int(S[i:])%2019]+= 1 remainder[0] += 1 print(-1) ''' answer = 0 for i in range(2019): p = remainder[i] answer += p*(p-1)/2 print(int(answer)) '''