problem_id
stringclasses
428 values
submission_id
stringlengths
10
10
status
stringclasses
2 values
code
stringlengths
5
816
p04029
s393921164
Accepted
n=int(input()) a=0 for i in range(n+1): a+=i print(a)
p02859
s661049323
Accepted
n = int(input()) print(n**2)
p02660
s086916540
Accepted
n = int(input()) primes = {} for i in range(2, int(n**0.5)+1): if n%i==0: cnt = 0 while n%i==0: n //= i cnt += 1 primes[i] = cnt if n==1: break else: if n!=1: primes[n] = 1 ans = 0 for i in primes.values(): for j in range(1, 100000): if j*(j+1)//2<=i: ans += 1 else: break print(ans)
p02595
s180632328
Wrong Answer
import math num, dist = map(int, input().split()) count = 0 for i in range(0,num): x, y = map(int, input().split()) distance = math.sqrt(x**2 + y**2) if distance >= dist: count += 1 print(count)
p02724
s199841207
Accepted
x=int(input()) print(x//500*1000+x%500//5*5)
p03105
s488761834
Accepted
#116A # 1.値を正しく取得 a, b, c = (int(x) for x in input().split()) # 2.正しく処理 print(min(b//a,c))
p02832
s439519663
Accepted
n = int(input()) a = list(map(int,input().split())) x = 1 ans = 0 for i in a: if i == x: ans += 1 x += 1 if ans == 0: print(-1) else: print(len(a)-ans)
p02879
s514373436
Accepted
#k = int(input()) #s = input() #a, b = map(int, input().split()) #s, t = map(str, input().split()) #l = list(map(int, input().split())) a,b = map(int, input().split()) if (b > 9 or a > 9): print(-1) else: print(a*b)
p02861
s053972710
Accepted
from itertools import permutations N = int(input()) dist = [list(map(int, input().split())) for _ in range(N)] ans = [] for case in permutations([i for i in range(N)]): total = 0 for i in range(len(case)-1): total += ((dist[case[i]][0]-dist[case[i+1]][0])**2 + (dist[case[i]][1]-dist[case[i+1]][1])**2)**(1/2) ans.append(total) print(sum(ans)/len(ans))
p03387
s862458001
Wrong Answer
[A,B,C] = list(map(int,input().split())) X = [A,B,C] saidai=max(X) #print(saidai) #print(sum(X)) i=1 while True: dammy = 3 * (saidai+i) - sum(X) if dammy %2 == 0: print(dammy//2) break i+=1
p02706
s401291888
Wrong Answer
n,m=(int(i) for i in input().split()) l=[int(i) for i in input().split()] if(sum(l)>=m): print(n-sum(l)) else: print(-1)
p03012
s304345790
Accepted
n = int(input()) w = [int(x) for x in input().split()] ans = 1e9 for i in range(n): s1 = sum(w[:i]) s2 = sum(w[i:]) s = abs(s1 - s2) ans = min(s, ans) print(ans)
p02572
s283584318
Accepted
n = int(input()) a = list(map(int,input().split())) arr = [0]*(n+1) ans = 0 mod = 10**9+7 for i in range(n): arr[i+1] += arr[i]+a[i] for i in range(n): ans += (a[i]*(arr[n]-arr[i+1]))%mod print(ans%mod)
p03251
s663290598
Accepted
n,m,X,Y=map(int,input().split()) x=list(map(int,input().split())) y=list(map(int,input().split())) xx=max(x) yy=min(y) t1=max(X,xx) t2=min(Y,yy) if t1<t2: print("No War") else: print("War")
p03061
s290343565
Accepted
n = int(input()) a = list(map(int,input().split())) def gcd(x,y): while y != 0: x,y = y,x%y return x l,r = [0],[0] for i in range(n-1): l.append(gcd(l[-1],a[i])) r.append(gcd(r[-1],a[n-i-1])) ans = 0 for i in range(n): ans = max(ans,gcd(l[i],r[n-i-1])) print(ans)
p03206
s071277962
Wrong Answer
a=int(input()) print("christmas"+"Eve"*(25-a))
p03274
s839604243
Wrong Answer
n,k=map(int,input().split()) x=list(map(int,input().split())) a=[x[i] for i in range(n) if x[i]<0] b=[x[i] for i in range(n) if x[i]>=0] na=len(a) nb=len(b) ans=10**10 if k<=nb: ans=b[k-1] for i in range(1,na+1): if 0<=k-i-1<=nb-1: ans=min(ans,min(-2*a[-i]+b[k-i-1],-a[i-i]+2*b[k-i-1])) elif k-i<0: ans=min(ans,-a[-k]) print(ans)
p03852
s279973044
Accepted
v = ["a", "e", "i", "o", "u"] if input() in v: print("vowel") else: print("consonant")
p02602
s014309786
Wrong Answer
n,k=map(int,input().split()) lst_1=list(map(int,input().split())) # print(lst_1) lst_2=[] for i in range(n-k+1): temp=1 temp=lst_1[i+k-1]/lst_1[i] lst_2.append(temp) for i in range(len(lst_2)-1): if lst_2[i]<lst_2[i+1]: print("Yes") else:print("No")
p03838
s586326421
Accepted
x, y = map(int,input().split()) if x*y < 0: #異符号→反転可能性あり print(abs(abs(x)-abs(y))+1) elif x*y == 0: if x <= y: print(y-x) else: print(x-y+1) else: #同符号→反転可能性なし if x <= y: print(y-x) else: print(x-y+2)
p02608
s297719981
Accepted
from collections import defaultdict ans = defaultdict(int) N = int(input()) for i in range(1, 100): for j in range(1, 100): for k in range(1, 100): ans[i*i+j*j+k*k+i*j+j*k+k*i] += 1 for i in range(N): print(ans[i+1])
p03437
s306743656
Wrong Answer
x, y = map(int, input().split()) if y % x == 0: print(-1) else: print(x)
p03779
s891398579
Accepted
x = int(input()) i, j = 0, 0 while j < x: i += 1 j += i print(i)
p02556
s708942406
Accepted
N = int(input()) xy = [list(map(int, input().split())) for _ in range(N)] z = [x + y for x, y in xy] w = [x - y for x, y in xy] z.sort() w.sort() ans = max(z[-1] - z[0], w[-1] - w[0]) print(ans)
p02802
s987295455
Wrong Answer
n,m = map(int,input().split()) li = [] for _ in range(m): li.append(list(input().split())) li.sort(key=lambda x:x[0]) already = False cnt_ans = 0 cnt_penalty = 0 prev = 0 checked = [] for p,s in li: if p in checked: continue else: prev = p if s == "WA": cnt_penalty += 1 else: cnt_ans += 1 checked.append(p) print(cnt_ans,cnt_penalty)
p02701
s861565267
Accepted
n = int(input()) s = set() for _ in range(n): s.add(input()) print(len(s))
p03254
s169921747
Accepted
n, x = map(int, input().split()) a = list(map(int, input().split())) a.sort() cnt = 0 for i in range(n): if i == n - 1: if x == a[i]: cnt += 1 elif x >= a[i]: x -= a[i] cnt += 1 print(cnt)
p02823
s925794000
Wrong Answer
N,A,B = map(int, input().split()) if (B-A)%2==0: print((B-A)//2) else: print(min(N-B, A))
p02717
s625414599
Accepted
#!/usr/bin/env python3 x,y ,z= map(int,input().split()) print(z,x,y)
p02606
s828531827
Accepted
l, r, d = map(int, input().split()) ans = 0 for i in range(l, r+1): if i%d==0: ans += 1 print(ans)
p03017
s418392053
Accepted
import re N, A, B, C, D = map(int, input().split()) S = input() S = '#' + S flag = True if re.search(r'##', S[min([A,B]): max([C,D])+1]): flag *= False if D < C: if re.search(r'\.\.\.', S[B-1:D+2]): flag *= True else: flag *= False print('Yes') if flag else print('No')
p03632
s279933149
Wrong Answer
A, B, C, D = map(int, input().split()) if A<=C and D<=B: print(D-C) if C<=A and B<=D: print(B-A) if (A<=C and C<= B and B<=D): print(B-C) if C<=A and A<=D and D<=B: print(B-A) if B<=C or D<=A: print(0)
p02755
s334894245
Accepted
import math a,b=map(int,input().split()) m=max(math.ceil(100*a/8),math.ceil(100*b/10)) if a<=m*8/100<a+1 and b<=m*10/100<b+1: print(m) else: print(-1)
p03075
s752222477
Accepted
a=[] for i in range(6): a.append(int(input())) if a[4]-a[0]>a[5]: print(":(") else: print("Yay!")
p02552
s049992339
Wrong Answer
print(1) if int(input()) == 0 else print(1)
p02647
s031279440
Accepted
n, k = map(int, input().split()) a = list(map(int, input().split())) for i in range(k): im = [0 for _ in range(n+1)] for i, x in enumerate(a): im[max(i-x, 0)] += 1 im[min(i+x+1, n)] -= 1 nxt = [im[0]] for i in range(1, n): nxt.append(nxt[-1] + im[i]) a = nxt if min(a) == n: break print(*a)
p02792
s176393904
Accepted
n=int(input()) l=[[0]*10for _ in range(10)] for x in range(1,n+1):l[int(str(x)[0])][int(str(x)[-1])]+=1 print(sum(l[i][j]*l[j][i]for i in range(10)for j in range(10)))
p02790
s727981444
Wrong Answer
a,b=map(int,input().split()) if a>=b: print(str(a)*b) else: print(str(b)*a)
p02761
s797371709
Accepted
N,M = map(int,input().split()) s,c=[],[] for _ in range(M): s_,c_ = map(int,input().split()) s.append(s_) c.append(c_) if N != 1: a,b=10**(N-1),10**N else: a,b=0,10 for i in range(a,b): ok = True num = str(i) for k in range(M): if num[s[k]-1] != str(c[k]): ok = False if ok: print(i) exit() print(-1)
p02629
s382407676
Accepted
# -*- coding: utf-8 -*- def conv(a): #convert the num to character a += 97 return chr(a) # 整数の入力 n = int(input()) name = '' while n>0: n -= 1 name += conv(n%26) n //= 26 # 出力 print(name[::-1])
p03109
s622201008
Accepted
s = input() if int(s[:4]) <= 2019: if int(s[5:7]) <= 4: if int(s[8:]) <= 30: print("Heisei");exit() print("TBD")
p03030
s931345742
Accepted
import numpy as np N = int(input()) city_num = {} score = [] for i in range(N): s, p = input().split() if s not in city_num.keys(): city_num[s] = [i] else: city_num[s].append(i) score.append(int(p)) score_rank = np.argsort(score)[::-1] city_num = sorted(city_num.items()) for city, num in city_num: order = [s for s in score_rank if s in num] [print(o + 1) for o in order]
p02817
s042442524
Accepted
a, b = input().split() print(b+a)
p03481
s911236040
Wrong Answer
A, B = map(int, input().split()) tmp = A ans = 1 while tmp < B: tmp *= 2 if tmp < B: ans += 1 print(ans)
p02909
s385550365
Wrong Answer
s=input() if(s=="sunny"): print("cloudy") elif(s=="cloudy"): print("rainy") else: print("sunny")
p02642
s166043733
Accepted
n=int(input()) a=list(map(int,input().split())) m=max(a) l=[0for i in range(m+1)] for i in range(n): for j in range(a[i], m + 1, a[i]):l[j] += 1 c=0 for i in range(n): if l[a[i]] == 1:c += 1 print(c)
p03219
s585909740
Wrong Answer
X, Y = map(int, input().split()) print(X+Y/2)
p03345
s128980114
Wrong Answer
a, b, c, k = map(int, input().split()) ans = abs(b - a) * (-1) ** (k%2 + 1) if abs(ans) >= 1000000000000000000: print("Unfair") else: print(ans)
p03730
s855778723
Accepted
a, b, c = map(int, input().split()) for i in range(1, 100000): if a*i % b == c: print("YES") exit() print("NO")
p02842
s753996078
Accepted
n = int(input()) a = {int(i*1.08):i for i in range(1, 5*10**4+1)} if n in a: print(a[n]) else: print(':(')
p02836
s232175800
Accepted
s = input() count = 0 for i in range(len(s)//2): if s[i] != s[-i-1]: count += 1 print(count)
p03254
s891993005
Accepted
import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines import numpy as np def main(n, x, a): cnt = 0 for j, i in enumerate(a): x -= i if x < 0: break elif j == n-1 and x > 0: break cnt += 1 return cnt n, x = map(int, readline().split()) a = np.sort(np.array(readline().split(), np.int64)) print(main(n, x, a))
p03285
s653266544
Accepted
def solve(n): if n == 0: return True if n < 0: return False return (False or solve(n-4) or solve(n-7)) n = int(input()) print('Yes' if solve(n) else 'No')
p03617
s770238757
Wrong Answer
sizePrice = list(map(int, input().split())) N = int(input()) perL = [sizePrice[0] * 4, sizePrice[1] * 2, sizePrice[2], sizePrice[3] / 2] ans = 0 if N % 2 == 0: ans = int(min(perL)) * (N // 2) else: ans = int(min(perL)) * (N - 1) ans += min(perL[:-1]) print(ans)
p02615
s548133151
Wrong Answer
N = input() S = list(map(int,input().split())) max=S[0]; semimax=S[1]; val=max; for i in range(int(N)-2): val+=semimax if S[i+1]>max: max=S[i+1] if S[i+1]>semimax: semimax=S[i+1] print(val)
p02678
s408463040
Accepted
n,m = map(int, input().split()) link = [[] for _ in range(n)] for i in range(m): a,b = list(map(int,input().split())) link[a-1].append(b-1) link[b-1].append(a-1) from collections import deque Q = deque() Q.append([0,0]) visited=[-1]*n visited[0]=1 while Q: now,cnt = Q.popleft() for nxt in link[now]: if visited[nxt]!=-1: continue visited[nxt]=now+1 Q.append([nxt,cnt+1]) print("Yes") for a in visited[1:]: print(a)
p03221
s407925363
Accepted
N, M = map(int, input().split()) Ps = [[] for i in range(N)] Cs = [] for i in range(M): p, y = map(int, input().split()) p -= 1 Cs.append([p, 0]) Ps[p].append([i, y]) for p in Ps: p = sorted(p, key=lambda city: city[1]) for i in range(len(p)): Cs[p[i][0]][1] = i+1 for i in range(M): print('{:0=6}{:0=6}'.format(Cs[i][0]+1, Cs[i][1]))
p03759
s672667424
Accepted
# -*- coding: utf-8 -*- #---------- a,b,c = list(map(int, input().rstrip().split())) #---------- if (b-a) == (c-b): print("YES") else: print("NO")
p02711
s128012733
Accepted
ln = list(input()) for i in ln: if i == "7": print("Yes") exit() print("No")
p03323
s335982868
Accepted
a,b=map(int,input().split()) if a<=8 and b<=8: print('Yay!') else: print(":(")
p03274
s511837094
Accepted
from bisect import bisect_right def main(): n, k = map(int, input().split()) x = [int(i) for i in input().split()] o = bisect_right(x, 0) ans = 10**9 for i in range(max(o - k, 0), min(o, n - k) + 1): a, b = x[i], x[i + k - 1] c, d = abs(a), abs(b) if a * b > 0: ans = min(max(c, d), ans) else: ans = min(min(c, d) * 2 + max(c, d), ans) print(ans) if __name__ == '__main__': main()
p03239
s057037671
Accepted
n, T = map(int, input().split()) a = 1001 for _ in range(n): c, t = map(int, input().split()) if t <= T and c < a: a = c if a == 1001: print('TLE') else: print(a)
p02598
s634400281
Accepted
import math N, K = map(int, input().split()) As = list(map(int, input().split())) r = max(As) if K == 0: print(r) exit() l = 1 while l < r: mid = (r + l)//2 cnt = 0 for a in As: cnt += math.ceil(a/mid) - 1 if cnt <= K: r = mid else: l = mid + 1 print(r)
p03835
s344083941
Accepted
a,b = map(int,input().split()) ans = 0 for x in range(b+1): if x > a: break for y in range(b+1): if y > a: break z = b-x-y if z <= a and z >= 0: ans +=1 else: continue print(ans)
p02640
s394418923
Accepted
X,Y = map(int,input().split()) ans = 'No' for a in range(X+1): for b in range(X+1): if a + b == X and 2*a + 4*b == Y: ans = 'Yes' print(ans)
p03107
s638619221
Accepted
s=sorted(list(input())) if s[0]==s[-1]: print(0) else: a=s.index('1') print(2*min(a,len(s)-a))
p03623
s053619332
Wrong Answer
x, a, b = map(int, input().split()) if x - a < x - b: print("A") else: print("B")
p02971
s190709334
Accepted
n = int(input()) a_list = [int(input()) for nesya in range(n)] s = sorted(a_list,reverse=True) max1 = s[0] max2 = s[1] for a in a_list: if a == max1: print(max2) else: print(max1)
p02553
s559206509
Accepted
a, b, c, d = map(int, input().split()) ans = [a * c, a * d, b * c, b * d] print(max(ans))
p02773
s620133986
Wrong Answer
n = int(input()) s = [input() for _ in range(n)] import collections c = collections.Counter(s) d = c.most_common() e = [d[0][0]] for i in range(len(d)-1): #nじゃない dの長さ if d[0][1] == d[i+1][1]: e.append(d[i+1][0]) #辞書順にする e.sort() print(repr(e)) #print(repr(e))でもいける?
p03778
s605568909
Accepted
w, a, b = [int(x) for x in input().split()] ans = 0 if a + w < b: ans = b - (a + w) elif b + w < a: ans = a - (b + w) print(ans)
p03331
s276488778
Accepted
#!/usr/bin python3 # -*- coding: utf-8 -*- def main(): N = int(input()) ret = 10**9 for a in range(1,N): b = N-a ret = min(ret,sum(map(int,list(str(a))))+sum(map(int,list(str(b))))) print(ret) if __name__ == '__main__': main()
p03077
s963493918
Accepted
n = int(input()) abc = [] ans = 0 for i in range(5) : abc.append(int(input())) minabc = min(abc) ans += n//minabc if n % minabc != 0: ans += 1 if minabc >= n : print(5) else : print(4 + ans)
p02690
s977321778
Wrong Answer
import math x = int(input()) uba = math.ceil(x**0.2) # ルート1/5 flag = False for a in range(-uba-1, uba+1): for b in range(-uba-1, uba+1): s = a**5 - b**5 if s == x: flag = True break if flag: break print(a, b)
p04034
s231805967
Accepted
# AGC002 B Box and Ball n, m = map(int, input().split()) b_list = [0] * (n+1) b_list[1] = 1 c_list = [1] * (n+1) for i in range(m): _x, _y = map(int, input().split()) c_list[_x] -= 1 c_list[_y] += 1 if b_list[_x] == 1: b_list[_y] = 1 if c_list[_x] == 0: b_list[_x] = 0 print(sum(b_list))
p03625
s909689086
Wrong Answer
n = int(input()) a = list(map(int,input().split())) ans = [] a.sort(reverse=True) key = a[0] i = 1 while True: if len(ans) == 2: break if a[i] == key: i += 2 ans.append(key) if i > n-1: break key = a[i] else: i += 1 if i > n-1: break key = a[i] if len(ans) != 2: print(0) else: print(ans[0]*ans[1])
p03779
s093089333
Wrong Answer
x = int(input()) t = int(x ** 0.5) min_d = t * (t + 1) * 0.5 if min_d == x: print(t) else: if min_d + t + 1 == x: print(t+1) elif min_d + t + 1 < x: print(t + 2) else: print(t + 3)
p03705
s709924580
Accepted
def main(): N, A, B = map(int, input().split()) if A > B: return 0 if N == 1: if A != B: return 0 else: return 1 if N == 2: return 1 mn = A * (N - 1) + B mx = A + B * (N - 1) return mx - mn + 1 if __name__ == "__main__": print(main())
p02642
s968667310
Accepted
N = int(input()) A = [int(a) for a in input().split()] M = 10**6+1 L = [0]*M for a in A: if L[a] >= 1: L[a] = 2 continue L[a] = 1 i = 2 while a*i < M: L[a*i] = 2 i += 1 ans = 0 for a in A: if L[a] == 1: ans += 1 print(ans)
p02946
s450367097
Accepted
K, X = map(int, input().split()) print(' '.join(map(str, range(X - K + 1, X + K))))
p03719
s988170624
Accepted
A,B,C = map(int, input().split()) print("Yes" if A<=C and C<=B else "No")
p02833
s877601647
Accepted
n=int(input()) if n%2==1: print(0) exit(0) n=n//2 i=0 f=5 while (n//f)>0: i+=n//f f=f*5 i+=n//f print(i)
p02755
s578728939
Accepted
a,b = map(int,input().split()) ten = [] ei = [] for i in range(1,1010): if a <= i*0.08 < a+1: ei.append(i) for j in range(1,1010): if b <= j*0.1 < b+1: ten.append(j) case = set(ei) & set(ten) if not case: print(-1) else: print(min(case))
p02760
s964765903
Accepted
A=[] B=[False]*9 for i in range(3): A+=[int(i) for i in input().split()] n=int(input()) for _ in range(n): b=int(input()) for i in range(9): if b==A[i]: B[i]=True C=[[1,2,3],[4,5,6],[7,8,9],[1,4,7],[2,5,8],[3,6,9],[1,5,9],[3,5,7]] Chk=False for a,b,c in C: if B[a-1] and B[b-1] and B[c-1]: Chk=True print("Yes" if Chk else "No")
p02963
s662972679
Wrong Answer
n=int(input()) a=-(-n//10**9) b=10**9*a-n print(0,0,10**9,1,a,b)
p03524
s092257256
Accepted
S = list(input()) a = 0 b = 0 c = 0 for s in S: if s == 'a': a += 1 elif s == 'b': b += 1 else: c += 1 if max(a, b, c) - min(a, b, c) < 2: print('YES') else: print('NO')
p03730
s665042258
Wrong Answer
a, b, c = list(map(int, input().split())) answer = 'NO' def hantei(a, b, c): if a == 1: return 'YES' if b % 2 == 0 and c % 2 == 0: return 'YES' if b % 2 == 0 and c % 2 == 1: # 総和が奇数 if a % 2 == 0: return 'NO' return 'YES' print(hantei(a, b, c))
p03289
s309339462
Wrong Answer
#104B s = "AtCoder" c_list = [] c_count = 0 answer = "WA" for i in range(2,len(s)): if s[i] == "C": c_list.append(i) if s[i].islower() == False: c_count += 1 if s[0]=="A" and s[1].islower()==True and len(c_list)==1 and c_count==1: answer="AC" print(answer)
p03001
s683800899
Accepted
W, H, x, y = map(int, input().split()) s = 0 if W == 2*x and H == 2*y: s = 1 S = W*H/2 print(S, s, sep =' ')
p02555
s074820362
Wrong Answer
def sep(n,mod): r = 1 if n == 1: return 1 if n == 2: return mod+1 for i in range(mod): r += sep(n-1,mod-i) return r s = int(input()) n = s//3 mod = s%3 count = 0 while n != 0: if mod == 0 or n == 1: count += n**mod else: count += n**mod - int((mod*(mod-1))/2) #count += sep(n,mod) mod += 3 n -= 1 print(count%((10**9)+7))
p02860
s564416432
Wrong Answer
n=int(input()) s=input() if len(s)%2!=0: print('No') else: if s[len(s)//2]==s[len(s)//2+1:]: print('Yes') else: print('No')
p03433
s890419695
Wrong Answer
n = int(input()) a = int(input()) tmp = n % 500 if tmp <= n: print("Yes") else: print("No")
p03338
s238960677
Accepted
n = int(input()) s = input() ans = 0 for i in range(1,n+1) : l = set(s[:i]) r = set(s[i:]) ans = max(ans,len(l&r)) print(ans)
p02742
s696980676
Wrong Answer
H, W = input().split() H = int(H) W = int(W) result = (W + 1)/2 if H % 2 == 0: even_row = H / 2 else: even_row = (H-1)/2 odd_row = H - even_row result2 = (result-1)*even_row result1 = result*odd_row print(result1+result2)
p02912
s553286948
Accepted
import heapq N,M=map(int,input().split()) A=[-a for a in list(map(int,input().split()))] heapq.heapify(A) for _ in [0]*M: a=heapq.heappop(A) heapq.heappush(A,-((-a)//2)) res=0 for i in range(N): a=heapq.heappop(A) res+=-a print(res)
p03150
s702705967
Accepted
S = input() T = "keyence" for i in range(len(S)): for j in range(len(S)): if S[:i] + S[j:] == T: print('YES') exit() print('NO')
p02603
s120435903
Accepted
N = int(input()) rate = list(map(int,input().split())) rate.append(100) position = 0 flag = 'motanai' money = 1000 for i in range(N): if flag == 'motanai' and rate[i]<rate[i+1]: position = money//rate[i] money = money%rate[i] flag = 'motu' elif flag == 'motu' and rate[i]>rate[i+1]: money += position*rate[i] position = 0 flag = 'motanai' else: continue print(money)
p03761
s511220971
Accepted
n=int(input()) c=list(input()) for i in range(n-1): t=[] s=list(input()) for j in c: if j in s: t.append(j) s.remove(j) c=t c.sort() print("".join(c))
p04043
s350845870
Accepted
from collections import Counter ns = Counter([int(i) for i in input().split()]) if ns[5] == 2 and ns[7] == 1: print("YES") else: print("NO")
p03073
s331094057
Wrong Answer
s = input() ss = [] count = 0 for x in range(len(s)): ss.append(int(s[x])) #print(ss) for x in range(1,len(s)): if ss[x-1] == 0: ss[x] = 1 count += 1 else: ss[x] = 0 #print(ss) print(count)