problem_id
stringclasses
428 values
submission_id
stringlengths
10
10
status
stringclasses
2 values
code
stringlengths
5
816
p03210
s418429570
Wrong Answer
a=int(input()) print(['No','Yes'][a == 7 or a==5 or a==3])
p02729
s605543876
Wrong Answer
from scipy.misc import comb N, M = map(int, input().split()) print(int(comb(N, 2)) + int(comb(M, 2)))
p02702
s516468708
Accepted
from collections import defaultdict S = input() l = len(S) d = {0:0} mod10n = 1 for i in range(1, len(S)+1): s = int(S[l-i]) d[i] = (d[i-1] + s * mod10n) %2019 mod10n = (mod10n * 10) % 2019 count_d = defaultdict(int) for key in d.keys(): count_d[d[key]] += 1 counter = 0 for key in count_d.keys(): counter += (count_d[key] * (count_d[key]-1)) //2 print(counter)
p02663
s374536683
Accepted
#!/usr/bin/env python3 h1, m1, h2, m2, k = map(int, input().split()) print((h2 * 60 + m2) - (h1 * 60 + m1) - k)
p04043
s343094558
Accepted
X=list(map(int,input().split())) X.sort() if X==[5,5,7]: print('YES') else: print('NO')
p02660
s335785347
Accepted
from collections import defaultdict as dd from math import sqrt d=dd(int) def pr(n): while n % 2 == 0: d[2]+=1 n = n / 2 for i in range(3,int(sqrt(n))+1,2): while n % i== 0: d[i]+=1 n = n / i if n > 2: d[n]+=1 n=int(input()) pr(n) ans=0 for i in d: ans+=(sqrt(1+8*d[i])-1)//2 print(int(ans))
p03481
s179057279
Accepted
X,Y = map(int,input().split()) k = 0 while X<=Y: k += 1 X = X*2 print(k)
p03997
s848729901
Accepted
a,b,h=map(int,open(0));print((a+b)*h//2)
p02959
s239898512
Accepted
n=int(input()) a=list(map(int,input().split())) b=list(map(int,input().split())) ans=0 for i in range(n): if b[i]<=a[i]: a[i]-=b[i] ans+=b[i] elif b[i]<=(a[i]+a[i+1]): a[i+1]-=(b[i]-a[i]) a[i]=0 ans+=b[i] else: ans+=(a[i]+a[i+1]) a[i]=0 a[i+1]=0 print(ans)
p03719
s112588861
Accepted
a,b,c = map(int,input().split()) if a <= c <= b: print('Yes') else: print('No')
p03069
s171939124
Accepted
n=int(input()) s=input() c=[0] for i in range(n): c.append(c[i]+(s[i]=='#')) p=n for i in range(n+1): p=min((n-c[-1]+c[i])+(c[i]-i),p) print(p)
p03592
s888527884
Wrong Answer
import sys stdin = sys.stdin ns = lambda: stdin.readline().rstrip() ni = lambda: int(ns()) na = lambda: list(map(int, stdin.readline().split())) n, m, k = na() dp = [[0] * (m+1) for _ in range(n+1)] for ni in range(n): for mi in range(m): r = ni + mi s = ni * m + mi * n - (0+ni-1)*(ni)//2 - (0+mi-1)*(mi)//2 if k == s: print("Yes") quit() print("No")
p03427
s234977698
Accepted
S = input() N = int(S) K = len(S) c = int(S[0]) if len(S) == 1: ans = c elif (N+1)/(10**(K-1))-1 == c: ans = c + 9*(K-1) else: ans = (c-1) + 9*(K-1) print(ans)
p02659
s150248228
Wrong Answer
def main(): a, b = map(float, input().split()) zajedno = a*b print(int(zajedno)) if __name__ == '__main__': main()
p03001
s161171701
Wrong Answer
h,w,x,y=map(int,input().split()) print(h*w/2, int((2*x==w)*(y*2==h)))
p02675
s589865241
Accepted
n = int(input()) n %= 10 if n == 3: print('bon') elif n == 0 or n == 1 or n == 6 or n == 8: print('pon') else: print('hon')
p03644
s620308746
Accepted
n = range(1,int(input())+1) def calc_div(n): cnt = 0 while n/2 !=0: cnt += 1 if n%2 != 1: n = n/2 else: break return cnt list = [] for i in n: j = calc_div(i) list.append(j) max_value = max(list) max_index = list.index(max_value) print(n[max_index])
p03131
s995516913
Accepted
K, A, B = map(int, input().split()) ans = 0 if A + 1 >= B or K <= A: ans += K + 1 else: ans = A K -= A - 1 ans += (B - A) * (K // 2) + K % 2 print(ans)
p03352
s648048349
Wrong Answer
x=int(input()) ans=1 for i in range(1,x+1): for j in range(2,x+1): if i**j<=x: ans=i**j print(ans)
p02697
s642858502
Accepted
N,M=map(int,input().split()) if N%2: x,y=N,1 for i in range(M): print(x,y) x-=1 y+=1 else: x,y=N,1 for i in range(M): print(x,y) x-=1 y+=1 if x-y in (y+N-x,y+N-x-2):break x-=1 for j in range(M-i-1): print(x,y) x-=1 y+=1
p03693
s353297844
Accepted
a,b,c=map(int,input().split()) print(["NO","YES"][(b*10+c)%4==0])
p03043
s127514846
Accepted
N, K = map(int, input().split()) B = [] for i in range(1,N+1): count = 0 while i < K: i *= 2 count += 1 B.append(count) result = 0 for a in B: result += 1/N*0.5**a print(result)
p02622
s423552961
Wrong Answer
s,t = input(), input() a = 0 for i in range(len(s)): if s[i]==t[i]: a = a + 1 else: a = a + 0 print(a)
p03127
s877156557
Accepted
n = int(input()) a_list = list(map(int, input().split())) def gcd(a,b): ''' 3 個以上の値の最大公約数を求めるためには、 res = 0 と初期化 各 i に対して res = GCD(res, x[i]) と更新する ''' while b!=0: a,b = b,a%b return a ans = gcd(a_list[0],a_list[1]) for i in range(1,n): ans = gcd(ans,a_list[i]) print(ans)
p04043
s377206624
Wrong Answer
a,b,c = input().split() if (a==b or b==c or c==a and not a==b==c): print("YES") else: print("NO")
p03680
s970220746
Accepted
n = int(input()) al = [int(input())-1 for _ in range(n)] used = [False] *n s = 0 res = 0 used[s] = True while s != 1: s = al[s] if used[s]: print(-1) exit() used[s] = True res += 1 print(res)
p02623
s064366863
Accepted
n,m,k = list(map(int,input().split(" "))) a = list(map(int,input().split(" "))) b = list(map(int,input().split(" "))) cnt = 0 ans = 0 j = m t = sum(b) for i in range(n+1): while j>0: if t>k: #aのみの場合の処理が足りない(常にjでスキップされてしまう) j -= 1 t -= b[j] else:break if t<=k:ans = max(ans,i+j) if i==n:break t += a[i] print(ans)
p02597
s164422537
Wrong Answer
import sys input = sys.stdin.readline n = int(input()) s = list(input()) ans = 0 for i in range(n - 1): idx = n - 2 - i if s[idx] == 'W' and s[idx + 1] == 'R': ans += 1 s[idx] = 'R' print(ans)
p03262
s055250126
Accepted
import math from functools import reduce def gcd(*numbers): return reduce(math.gcd, numbers) n, x = map(int, input().split()) xx = list(map(int, input().split())) a = [abs(x - i) for i in xx] print(gcd(*a))
p03448
s021594971
Wrong Answer
a = int(input()) b = int(input()) c = int(input()) x = int(input()) rCnt = 0 ttla = 0 ttlb = 0 for ia in range(a): ttla = 500 * ia for ib in range(b): ttlb = 100 * ib for ic in range(c): if ttla + ttlb + 50 * ic: rCnt = rCnt + 1
p02547
s458394018
Accepted
n=int(input()) cnt=0 for i in range(n): a,b=map(int,input().split()) if a==b: cnt+=1 if cnt==3: print("Yes") exit() else: cnt=0 print("No")
p02988
s440812454
Accepted
a=int(input()) b=list(map(int,input().split())) c=0 for i in range(a-2): if b[i]<b[i+1] and b[i+1]<b[i+2] or b[i]>b[i+1] and b[i+1]>b[i+2]: c+=1 print(c)
p02784
s320369249
Wrong Answer
import numpy as np INPUT = input().split() H = int(INPUT[0]) N = int(INPUT[1]) A_list = np.array(list(input().split()), dtype="int" ) if np.sum(A_list) >= H: print("yes") elif np.sum(A_list) < H: print("no")
p02771
s133301647
Accepted
A, B, C = input().split() if A == B and C!=A: print("Yes") elif B==C and A!=B: print("Yes") elif A==C and B!=A: print("Yes") else: print("No")
p02663
s226795524
Accepted
a = input().split() H1 = int(a[0]) M1 = int(a[1]) H2 = int(a[2]) M2 = int(a[3]) K = int(a[4]) time = (H2 * 60 + M2) - K okiru = 60 * H1 + M1 print(time - okiru)
p02959
s314607906
Accepted
n = int(input()) a = list(map(int,input().split())) b = list(map(int,input().split())) x = sum(a) for i in range(len(b)): if a[i]+a[i+1]<b[i]: a[i] = 0 a[i+1] = 0 elif a[i]<b[i]: a[i+1] = a[i]+a[i+1]-b[i] a[i] = 0 else: a[i]-=b[i] print(x-sum(a))
p03059
s028995696
Accepted
stdin = input().split(" ") A = int(stdin[0]) B = int(stdin[1]) T = int(stdin[2]) x = 1 sums = 0 print(int(((T+0.5)//A)*B))
p02797
s026359209
Accepted
N,K,S=map(int,input().split()) if S==10**9: for i in range(K): print(S,"",end="") for i in range(K,N): print(1,"",end="") print() else: for i in range(K): print(S,"",end="") for i in range(K,N): print(S+1,"",end="") print()
p02785
s669717859
Accepted
N, K = map(int, input().split()) H_list = list(map(int, input().split())) H_list.sort() if K >= len(H_list): print(0) else: for i in range(K): H_list[-i - 1] = 0 print(sum(H_list))
p03524
s289034696
Wrong Answer
*c, = map(input().count, "ABC") print(["YES","NO"][max(c) > -~min(c)])
p03545
s967003669
Accepted
def resolve(): a, b, c, d = input() for i in range(8): q = str(a) if (i>>0) & 1: q += '+' else: q += '-' q += str(b) if (i>>1) & 1: q += '+' else: q += '-' q += str(c) if (i>>2) & 1: q += '+' else: q += '-' q += str(d) if eval(q) == 7: q += '=7' print(q) return return if __name__ == "__main__": resolve()
p02882
s041253962
Accepted
import math a,b,x=map(int,input().split()) t=a*b*b/2/x if 2*x<a*a*b else 2/a*(b-x/a/a) print(math.degrees(math.atan(t)))
p04029
s778383766
Accepted
n = int(input()) sum = 0 for i in range(n+1): sum = sum + i print(sum)
p03069
s176592805
Accepted
_ = input() S = input().lstrip('.').rstrip('#') n = len(S) x = 0 y = S.count('.') c = min(n-y, y) for i in range(n): t = S[i]=='#' x += t y -= 1-t c = min(c, x+y) print(c)
p02772
s672468296
Wrong Answer
n = int(input()) a = list(int(x) for x in input().split() if int(x)%2==0) ok = True for i in a: if i%3!=0 and i%5!=0: print('DENIED') ok = False if ok: print('APPROVED')
p02678
s275705569
Accepted
from collections import deque n, m = map(int, input().split()) ab = [[] for i in range(n+1)] for i in range(m): a, b = map(int, input().split()) ab[a].append(b) ab[b].append(a) ans = [-1]*(n+1) que = deque([1]) while que: q = que.popleft() for i in ab[q]: if ans[i] == -1: que.append(i) ans[i] = q print('Yes') for i in range(2, n+1): print(ans[i])
p02836
s957009473
Accepted
S_list = list(input()) ans = 0 for i in range(len(S_list) // 2): if S_list[i] != S_list[-i - 1]: ans += 1 print(ans)
p02742
s448562745
Accepted
h, w = map(int, input().split()) if h == 1 or w == 1: print(1) else: print((h*w)//2 + (h*w)%2)
p03163
s934932469
Accepted
import numpy as np N, W = map(int, input().split()) dp = np.zeros(W+1) for i in range(N): w, v = map(int, input().split()) dp[w:] = np.maximum(dp[w:], dp[:-w] + v) print(int(dp.max()))
p03329
s844302637
Accepted
N = int(input()) dp = [i for i in range(N+1)] for i in range(1, 7): for j in range(9**i, N+1): dp[j] = min(dp[j], dp[j-9**i]+1) for i in range(1, 7): for j in range(6**i, N+1): dp[j] = min(dp[j], dp[j-6**i]+1) print(dp[N])
p02613
s067293412
Wrong Answer
N = [] N.append(input()) print("AC" + " x "+ str(N.count("AC"))) print("WA" + " x "+ str(N.count("WA"))) print("TLE" + " x "+ str(N.count("TLE"))) print("RE" + " x "+ str(N.count("RE")))
p03037
s159799380
Wrong Answer
n,m=map(int,input().split()) l=[0]*m r=[0]*m for i in range(m): l[i],r[i]=map(int,input().split()) if max(l)<=min(r): print(0) else: print(min(r)-max(l)+1)
p04029
s420053225
Wrong Answer
n=int(input()) print(n*(n+1)%2)
p03994
s168294782
Accepted
s = list(input()) k = int(input()) for i in range(len(s)): a = 26-(ord(s[i])-97) # print(ord(s[i])) # print(a) if k >= a and a != 26: k -= a s[i] = "a" # print(k) s[-1] = chr(ord(s[-1]) + k % 26) # print(ord(s[-1])) print("".join(s))
p02866
s960290775
Accepted
N = int(input()) D = list(map(int, input().split())) if D[0] != 0: print(0) exit() c = {} for i in D: c.setdefault(i, 0) c[i] += 1 if c[0] != 1: print(0) exit() result = 1 for i in range(1, max(D) + 1): if i not in c: print(0) exit() result *= pow(c[i - 1], c[i], 998244353) result %= 998244353 print(result)
p03457
s734033694
Wrong Answer
#!/usr/bin/env python3 # coding=utf-8 import sys n = int(sys.stdin.readline().strip()) txy = [tuple(map(int, l.strip().split(" "))) for l in sys.stdin.readlines()] check_txy = [abs(_x) + abs(_y) <= _t and (_t + _x + _y) % 2 == 0 for (_t, _x, _y) in txy] if all(check_txy): print("Yes") else: print("No")
p03760
s929513712
Accepted
O = input() E = input() Olen = len(O) Elen = len(E) password = '' for i in range(min(Olen, Elen)): password += O[i] + E[i] if Olen != Elen: password += O[-1] print(password)
p03699
s055795184
Accepted
n=int(input()) s=[int(input()) for i in range(n)] t=sum(s) if t%10!=0: print(t) else: s.sort() a=1 for i in range(n): if s[i]%10!=0: print(t-s[i]) a=0 break if a: print(0)
p03745
s051699343
Wrong Answer
N = int(input()) A = list(map(int,input().split())) i = 0 ret = 1 while i < N-1: while i < N-1 and A[i] == A[i+1]: i += 1 continue if A[i] < A[i+1]: while i < N-1 and A[i] <= A[i+1]: i += 1 if i < N-1: ret += 1 continue elif A[i] > A[i+1]: while i < N-1 and A[i] >= A[i+1]: i += 1 if i < N-1: ret += 1 continue print(ret)
p03289
s273966910
Accepted
s = input() if s[0] == 'A' and s[2:-1].count('C') == 1 and (s[1:s.find('C')]+s[s.find('C')+1:]).islower(): print('AC') else: print('WA')
p02546
s085357586
Wrong Answer
s=str(input()) print(s+"s")
p03672
s604588226
Accepted
s = input() for i in range((len(s) >> 1) - 1, -1, -1): n = i << 1 if s[:i] == s[i:n]: print(n) break
p02683
s885254831
Accepted
n, m, x = map(int, input().split()) c = [list(map(int, input().split())) for _ in range(n)] ans = [] for i in range(2 ** n): price = 0 und = [0 for _ in range(m)] for j in range(n): if (i >> j) & 1: price += c[j][0] for k in range(m): und[k] += c[j][k+1] if all(und[i] >= x for i in range(m)): ans.append(price) if ans == []: print(-1) else: print(min(ans))
p03556
s399791762
Accepted
n=int(input()) print(int((n**.5))**2)
p03814
s574362062
Wrong Answer
string = input() index_of_A = string.index("A") index_of_Z = string.index("Z", index_of_A) print(index_of_Z - index_of_A + 1)
p02612
s498070959
Accepted
N = int(input()) if N % 1000 == 0: print("0") elif N < 1000: print(1000-N) else: n = list(str(N)) print(1000*(1+int(n[0]))-N)
p02897
s329123743
Accepted
n = int(input()) m = range(1,n + 1) a = range(1,n + 1,2) b = len(a) / len(m) print(b)
p04019
s149578208
Wrong Answer
s = list(input()) s = set(s) if len(s) % 2 == 1: print("No") else: print("Yes")
p03286
s415452600
Accepted
s=int(input()) x=s list=[] for i in range(1000000000000000000): y=x%(-2) if y == -1: x = (x-1)//(-2) y = 1 else: x=x//(-2) list.insert(0, y) if x == 0: print(*list, sep="") break
p02731
s515941641
Wrong Answer
L=int(input()) L1=(L//3) L2=L%3 while L2>=10**-8: L1+=(L2/3) L2=(L2/3) print(L1**3)
p03377
s409830386
Wrong Answer
a,b,x = map(int,input().split()) print('YES' if x <= a+b else 'NO')
p03657
s270712594
Wrong Answer
A,B = map(int,input().split()) if (A+B)%3==0: print("Possible") else: print("Impossible")
p02953
s446676570
Wrong Answer
import sys import heapq from decimal import Decimal input = sys.stdin.readline n = int(input()) h_list = list(map(int, input().split())) tmp = 0 flag = False for h in h_list: if tmp == 0: tmp = h continue if tmp > h: tmp = h if flag: print("No") exit(0) else: flag = True else: tmp = h flag = False print("Yes")
p02996
s670547963
Accepted
#!/usr/bin/env python3 #%% for atcoder uniittest use import sys input= lambda: sys.stdin.readline().rstrip() def pin(type=int):return map(type,input().split()) def tupin(t=int):return tuple(pin(t)) #%%code def resolve(): N,=pin() AB=[tupin() for _ in range(N)] AB.sort(key=lambda x:x[1]) #print(AB) time=0 for i in range(N): time+=AB[i][0] if time>AB[i][1]: print("No") return print("Yes") #%%submit! resolve()
p02702
s555908099
Accepted
from collections import Counter S = input() x = [0] dec = 1 for s in S[::-1] : x.append((x[-1] + dec * int(s)) % 2019) dec *= 10 dec %= 2019 ret = 0 for v in Counter(x).values() : ret += v * (v - 1) // 2 print(ret)
p03274
s932291783
Accepted
N,K=map(int,input().split()) A=list(map(int,input().split())) a=N-K+1 long=10**9 for i in range(a): l=A[i+K-1]-A[i]+min(abs(A[i+K-1]),abs(A[i])) long=min(long,l) print(long)
p02988
s871804039
Accepted
n = int(input()) p = list(map(int,input().split())) cnt = 0 for i in range(n-2): c = [p[i], p[i+1], p[i+2]] cs = sorted(c) if c[1] == cs[1]: cnt += 1 print(cnt)
p03146
s030554032
Accepted
s=int(input()) from collections import Counter cc=Counter() cc[s]=1 cnt=1 while True: if s%2==0: s=s/2 else: s=3*s+1 cnt+=1 if cc[s]>0: print(cnt) import sys sys.exit() cc[s]+=1
p03779
s001663082
Accepted
if __name__ == "__main__": x = int(input()) for i in range(100000): if i * (i+1) / 2 >= x: print(i) exit()
p02848
s057847832
Wrong Answer
num = int(input()) text = input() movedText = "" for i in text: if i == "z" or i == "Z": movedText += chr(ord(i) - 25 + num) continue movedText += chr(ord(i) + num) print(movedText)
p02899
s175444649
Wrong Answer
n = int(input()) a = [int(i) for i in input().split()] out = [] for i in range(n): out.append(a.index(n-i)) print(reversed(out))
p02699
s198025735
Accepted
s, w = map(int, input().split()) print('unsafe' if w >= s else 'safe')
p02711
s015173812
Wrong Answer
N = int(input()) s = str(N) if s in '7': print('Yes') else: print('No')
p03261
s477046385
Accepted
import sys N = int(input()) items = [] for i in range(N): item = input() items.append(item) if(len(items) != len(set(items))): print('No') sys.exit() for i in range(len(items)): if(i != 0 and items[i][0] != items[i-1][-1]): print('No') sys.exit() print('Yes')
p02707
s711327417
Accepted
n = int(input()) a = list(map(int,input().split())) d = {} for i in range(1,n+1): d[i] = 0 for i in range(len(a)): d[a[i]] += 1 for i in range(1,n+1): print(d[i])
p02756
s835221376
Accepted
from collections import deque d = deque() d.extend(list(input())) q = int(input()) z = 0 F = "" R = "" for i in range(q): a = tuple(input().split()) if a[0] == "1": z += 1 z %= 2 else: if (int(a[1]) + z) % 2 == 0: d.append(a[2]) else: d.appendleft(a[2]) ans = "".join(d) if z % 2 == 0: print(ans) else: print(ans[::-1])
p02677
s444295048
Wrong Answer
import math A, B, H, M = [int(i) for i in input().split(' ')] A_theta = 360 / 12 * H B_theta = 360 / 60 * M theta = B_theta - A_theta print(theta) cos = math.cos(math.radians(theta)) print(cos) dist = math.sqrt(A ** 2 + B ** 2 - A * B * cos) print(dist)
p02678
s736618218
Accepted
from collections import deque n,m=map(int,input().split()) graph=[[] for i in range(n)] sirusi=[0]*n for i in range(m): a,b=map(int,input().split()) a-=1;b-=1 graph[a].append(b) graph[b].append(a) D=deque([0]) visited=[False]*n visited[0]=True while D: v=D.popleft() for i in graph[v]: if visited[i]:continue visited[i]=True sirusi[i]=v D.append(i) print("Yes") for i in range(1,n): print(sirusi[i]+1)
p02547
s133499973
Accepted
n = int(input()) d = [list( map( int, input().split() ) ) for i in range(n)] for i in range(n-2): if d[i][0] == d[i][1]: if d[i+1][0] ==d[i+1][1]: if d[i+2][0] == d[i+2][1]: print('Yes') exit() print('No')
p02682
s901414359
Wrong Answer
x = [int(x) for x in input().split()] ans = x[0] x[3] -= x[0] + x[1] if x[3] >= 0: ans -= x[3] print(ans)
p03632
s670574086
Accepted
a, b, c, d = map(int, input().split()) print(max(0, min(b, d) - max(a, c)))
p03695
s743239677
Accepted
n = int(input()) a = list(map(int, input().split())) var = [0]*8 clown = 0 for i in a: if i >= 3200: clown += 1 else: var[i//400] = 1 if sum(var) > 0: print(sum(var), sum(var)+clown) else: print(1, sum(var)+clown)
p02726
s282050929
Accepted
import numpy as np from scipy.sparse import csr_matrix from scipy.sparse.csgraph import dijkstra n,x,y=map(int,input().split()) fr,to,w=[],[],[] for i in range(n-1): fr.append(i) to.append(i+1) w.append(1) fr.append(x-1) to.append(y-1) w.append(1) g=csr_matrix((w, (fr, to)), shape=(n, n)) d=dijkstra(g,directed=False).astype(int) ans_l=np.bincount(d.ravel(), minlength=n)//2 print(*ans_l[1:], sep='\n')
p03838
s848996886
Wrong Answer
x, y = map(int, input().split()) count = 0 if x == y: print(0) elif x == -y: print(1) elif abs(y) > abs(x): if y > 0: if x > 0: print(abs(x-y)) else: print(abs(x-y) + 1) else: print(abs(x-y) + 2) else: if y > 0: print(abs(x-y) + 1) else: print(abs(x-y))
p03076
s220742066
Wrong Answer
import sys def input(): return sys.stdin.readline().strip() def resolve(): l=[input() for i in range(5)] sum=0 for j in range(5): sum+=(int(l[j])//10)*10 num=9 for n in range(5): if int(l[n][-1])!=0 and int(l[n][-1]) < num: num=int(l[n][-1]) sum-=10-num for s in range(5): if int(l[s])%10!=0: sum+=10 print(sum) resolve()
p02701
s319853612
Accepted
N=int(input()) A=[] for i in range(N): A.append(input()) a=set(A) print(len(a))
p02640
s210290338
Accepted
X, Y = map(int, input().split()) if (Y - 2*X) % 2 == 0 and X- (Y-2*X)/2 >= 0 and Y - 2*X >= 0: print("Yes") else: print("No")
p04045
s092697360
Accepted
from collections import Counter def ok(n, D): # Dに含まれる数字をnで使っていたらFalse counter = Counter(str(n)) for d in D: if counter[str(d)] > 0: return False return True def main(): N, K = list(map(int, input().split(' '))) D = list(map(int, input().split(' '))) while not ok(N, D): N += 1 print(N) if __name__ == '__main__': main()
p03284
s754175397
Accepted
a, b = map(int, input().split()) if a%b == 0: print(0) else: print(1)
p02572
s505826125
Wrong Answer
N = int(input()) A = list(map(int,input().split())) mod = 1000000000 + 7 S = sum(A) S2 = sum(map(lambda x: x*x%mod,A)) ans = ((S*S - S2)/2)%mod print(int(ans))