problem_id
stringclasses
428 values
submission_id
stringlengths
10
10
status
stringclasses
2 values
code
stringlengths
5
816
p03061
s486709232
Accepted
import math N = int(input()) A = [int(X) for X in input().split()] Left = [0]*(N+1) Right = [0]*(N+1) GCDLR = [0]*(N+1) for T in range(0,N): Left[T+1] = math.gcd(Left[T],A[T]) Right[N-T-1] = math.gcd(Right[N-T],A[N-T-1]) for T in range(0,N): GCDLR[T] = math.gcd(Left[T],Right[T+1]) print(max(GCDLR))
p02935
s754338702
Accepted
n = int(input()) arr = sorted(list(map(int, input().split()))) res = arr[0] for i in range(1, n): res = (res + arr[i]) / 2 print(res)
p02859
s165289884
Wrong Answer
r = int(input()) m = 3.14*r*r ans = int(m/3.14) print(ans)
p03645
s005355102
Accepted
#グラフの連結成分を調べる def Graph(ab): G=[[] for i in range(n)] for a,b in ab: G[a-1].append(b) G[b-1].append(a) return G n, m = map(int,input().split()) ab = [list(map(int,input().split())) for i in range(m)] G = Graph(ab) for new_v in G[0]: if n in G[new_v - 1]: print('POSSIBLE') exit() print('IMPOSSIBLE')
p03796
s318959188
Accepted
N=int(input()) ans=1 mod=10**9+7 for i in range(1,N+1): ans=ans*i ans=ans%mod print(ans)
p03243
s314180884
Accepted
n = int(input()) for i in range(111, 1000, 111): if i >= n: print(i) break
p02791
s093957142
Accepted
n=int(input()) p=list(map(int,input().split())) mini = 112345678909 ans = 0 for i in range(n): if p[i] < mini: ans += 1 mini = min(mini,p[i]) print(ans)
p03760
s646008122
Wrong Answer
O = list(input()) E = list(input()) for x, y in zip(O, E): print(x+y,end="")
p02572
s846414190
Wrong Answer
n = int(input()) a = [int(i) for i in input().split()] res = sum(i for i in a) ans = 0 base = 1e9 + 7 for i in a: res -= i ans += (i * res) print(ans % base)
p02744
s972095637
Accepted
N = int(input()) lst = [] m = 0 temp = [[0]] while temp: p = temp.pop() if len(p)==N: lst.append(p) else: for i in range(max(p)+2): s = p[:] s.append(i) temp.append(s) lst.sort() abc = 'abcdefghij' for l in lst: print(*[abc[i] for i in l], sep='')
p02899
s539816134
Accepted
n = int(input()) a = list(map(int, input().split())) ans = [0]*n for i in range(n): ans[a[i]-1] = i+1 print(*ans)
p02661
s289202218
Wrong Answer
def main(): n = int(input()) A = [0]*n B = [0]*n for i in range(n): a,b = map(int,input().split()) A[i] = a B[i] = b A.sort() B.sort() if n%2 == 0: m1 = (A[n//2-1]+A[n//2])//2 m2 = (B[n//2-1]+B[n//2])//2 print(2*(m2-m1)+1) else: print(B[(n+1)//2-1]-A[(n+1)//2-1]+1) main()
p02729
s298994186
Wrong Answer
N,M=map(int,input().split()) print((N**2-N)/2 + (M**2-M)/2)
p02606
s646802784
Accepted
l = [int(x) for x in input().split()] ans = 0 for i in range(l[0],l[1]+1): if i % l[2] == 0: ans += 1 print(ans)
p02598
s276946928
Accepted
def countcut(A, length): ret = 0 for a in A: ret += -(-a//length) - 1 return ret def main(): N, K = map(int, input().split()) A = list(map(int, input().split())) lo = 1 hi = int(1e9) while lo < hi: mid = (lo+hi) // 2 if countcut(A, mid) <= K: hi = mid else: lo = mid + 1 print(lo) if __name__ == "__main__": main()
p02797
s342652158
Accepted
N,K,S=map(int,input().split()) if S!=10**9: ANS=[10**9 for i in range(N)] for i in range(K): ANS[i]=S else: ANS=[10**9-1 for i in range(N)] for i in range(K): ANS[i]=S print(*ANS)
p03073
s766658586
Wrong Answer
import math import copy neko = 0 nuko = 0 s = input() a = ["0","1"] for i in range(len(s)-1): if s[i] == a[i%2]: neko += 1 if s[i] == a[(i+1)%2]: nuko += 1 if neko > nuko: neko = nuko print(neko)
p03252
s798278411
Accepted
import sys import itertools sys.setrecursionlimit(1000000000) from heapq import heapify,heappop,heappush,heappushpop import math import collections MOD = 10**9 + 7 s = input() t = input() c1 = collections.Counter(s) c2 = collections.Counter(t) value1 = [] value2 = [] for value in c1.values(): value1.append(value) for value in c2.values(): value2.append(value) value1.sort(),value2.sort() if value1 == value2: print("Yes") else: print("No")
p03471
s858421255
Wrong Answer
l = list(map(int,input().split())) N = l[0] Y = l[1] S = 0 man = 0 gosen = 0 sen = 0 for i in range(1): while S <= Y-10000: S = S + 10000 man += 1 while S <= Y-5000: S = S + 5000 gosen += 1 while S <= Y-1000: S = S + 1000 sen += 1 if man + gosen +sen > N: print("-1 -1 -1") break else: print(man,gosen,sen)
p02612
s662713812
Wrong Answer
n = int(input()) while n < 1000: n //= 1000 print(n)
p03434
s266317245
Accepted
from heapq import heappop, heappush, heapify import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines sys.setrecursionlimit(10**8) INF = float('inf') MOD = 10**9+7 def main(): N = int(readline()) A = list(x for x in map(int, readline().split())) heapify(A) Alice = 0 Bob = 0 for i in range(N): if i%2==0: Alice += heappop(A) else: Bob += heappop(A) ans = abs(Alice-Bob) print(ans) if __name__ == '__main__': main()
p02843
s888507884
Wrong Answer
# C - 100 to 105 # https://atcoder.jp/contests/sumitrust2019/tasks/sumitb2019_c x = int(input()) d, m = divmod(x, 100) D = [0] * 5 for i in range(4, -1, -1): D[i], m = divmod(m, i + 1) print(D) if d >= sum(D): print(1) else: print(0)
p04019
s730706927
Accepted
import sys input = sys.stdin.readline A = input().rstrip('\n') N = A.count("N") S = A.count("S") W = A.count("W") E = A.count("E") if (N == 0 or S == 0) and N + S != 0: print("No") exit() if (W == 0 or E == 0) and W + E != 0: print("No") exit() print("Yes")
p02696
s531073548
Accepted
a,b,n=map(int,input().split()) x=min(b-1,n) print((a*x)//b-a*(x//b))
p03043
s189352826
Accepted
n, k = map(int, input().split()) ans = 0 for i in range(1, n + 1): c = 0 while i < k: i *= 2 c += 1 ans += 1 / n * (1 / 2) ** c print(ans)
p02780
s878358841
Accepted
N, K = map(int, input().split()) p = [(int(x)+1)/2 for x in input().split()] cm = [0] for n in p: cm.append(cm[-1]+n) ans = 0 for n in range(N-K+1): ans = max(cm[n+K]-cm[n],ans) print(ans)
p03471
s871706044
Wrong Answer
N,Y = map(int,input().split()) A,B,C = 0,0,0 flag = False for i in range(N): if flag: break for j in range(N): if i*10000 + j*5000 + (N-i-j)*1000 == Y and (N-i-j) >= 0: A,B,C = i,j,(N-i-j) flag = True break if A == B == C == 0: A,B,C = -1,-1,-1 print(A,B,C)
p02989
s691515605
Wrong Answer
N = int(input()) N_List = sorted(list(map(int,input().split()))) std = int(N/2) ansstd = N_List[std] - N_List[std-1] print((0,ansstd-1)[ansstd > 1])
p02688
s967598799
Accepted
N, K = map(int, input().split()) sunukes = {i for i in range(1,N+1)} for _ in range(K): d = int(input()) sunukes_having = set(map(int, input().split())) sunukes -= sunukes_having print(len(sunukes))
p02778
s636797970
Wrong Answer
S = input() for i in range(len(S)): print('x')
p02918
s336947470
Accepted
n,k = map(int,input().split()) s = input() print(min(sum([1 for i in range(n-1) if s[i] == s[i+1]])+k*2,n-1))
p02606
s249427738
Accepted
l,r,d=map(int,input().split()) print(r//d-(l-1)//d)
p02691
s490047665
Accepted
from collections import defaultdict n = int(input()) a = list(map(int, input().split())) ri = defaultdict(lambda: 0) lj = defaultdict(lambda: 0) ret = 0 for i in range(n): ri[a[i]+i]+=1 lj[i-a[i]]+=1 for k in ri: if(lj[k] >= 1): ret+=ri[k]*lj[k] #print(ri) #print(lj) print(ret)
p03971
s888983818
Accepted
n, a, b = map(int, input().split()) s = input() i = 0 j = 0 for n in s: if n == "a": if i + j < a + b: i += 1 print("Yes") else: print("No") elif n == "b": if (i + j < a + b) and j < b: j += 1 print("Yes") else: print("No") else: print("No")
p03324
s527943616
Accepted
d,n=map(int,input().split()) if d==0: if n==100: ans=101 else: ans=n elif d==1: if n==100: ans=10100 else: ans=n*100 else: if n==100: ans=1010000 else: ans=n*10000 print(ans)
p03759
s213268714
Accepted
a, b, c = map(int, input().split()) x = b - a y = c - b if x == y: print('YES') else: print('NO')
p02639
s776513677
Accepted
# -*- coding: utf-8 -*- def main(): import sys input = sys.stdin.readline x = list(map(int, input().split())) for index, xi in enumerate(x, 1): if xi == 0: print(index) exit() if __name__ == '__main__': main()
p03419
s184671534
Wrong Answer
def main(): n,k=map(int,input().split()) ans=n**2 ans-=n*(k) for i in range(k+1,n+1): temp=n//i temp*=k temp+=min(n%i,k-1) #print(ans) ans-=temp print(ans) main()
p02701
s448521286
Wrong Answer
n=int(input()) c=1 x=input() for i in range(n-1): if x!=input(): c+=1 print(c)
p02833
s328487868
Wrong Answer
n = int(input()) if n%2==1: print(0) exit() import math cnt=0 num=10 while True: cnt+=math.floor(n/num) num *= 5 if num > n: break print(cnt)
p02598
s652907684
Accepted
from bisect import bisect_left,bisect N, K = map(int, input().split()) A = list(map(int, input().split())) A.sort() def is_ok(arg): L = bisect(A, arg) cnt = 0 for i in range(L, N): p, q = divmod(A[i], arg) if q == 0: cnt += p-1 else: cnt += p return cnt <= K ng = 0 ok = max(A) + 1 def m_bisect(ng, ok): while (abs(ok - ng) > 1): mid = (ok + ng) // 2 if is_ok(mid): ok = mid else: ng = mid return ok print(m_bisect(ng, ok))
p03071
s661882478
Accepted
a,b=map(int,input().split()) lis=[2*a-1,a+b,2*b-1] print(max(lis))
p03495
s433687741
Wrong Answer
n, k = map(int, input().split()) a = list(map(int, input().split())) a.sort() count = 0 num_count = 1 num_count_list = list() for i in range(1, n): if(a[i] == a[i - 1]): num_count += 1 else: num_count_list.append(num_count) num_count = 1 count += 1 num_count_list.append(num_count) if(num_count == 1): count += 1 num_count_list.sort() result = 0 if(count > k): loop = count - k for i in range(loop): result += num_count_list[i] print(result)
p02779
s068829451
Accepted
def solve(): N = int(input()) A = [int(i) for i in input().split()] set_A = set([]) for num in A: if num in set_A: print('NO') return set_A.add(num) print('YES') if __name__ == "__main__": solve()
p02546
s284616998
Wrong Answer
s=input() if s[-1]==s: print(s+"s") elif s[-1]!=s: print(s+"s")
p03219
s783812228
Accepted
def INT(): return int(input()) def MI(): return map(int, input().split()) def LI(): return list(map(int, input().split())) X, Y = MI() print(X + Y // 2)
p03637
s342397417
Accepted
N, *A = map(int, open(0).read().split()) cnt1 = cnt2 = cnt4 = 0 for a in A: if a % 4 == 0: cnt4 += 1 elif a % 2 == 0: cnt2 += 1 else: cnt1 += 1 if cnt4 >= cnt1: print('Yes') elif cnt4 == cnt1-1 and cnt2 == 0: print('Yes') else: print('No')
p02866
s776702760
Accepted
N = int(input()) D_list = list(map(int, input().split())) if D_list[0]: print(0) exit() branchs = [0] * N MOD = 998244353 for d in D_list: branchs[d] += 1 if branchs[0] != 1: print(0) exit() cnt = 1 for v1,v2 in zip(branchs, branchs[1:]): cnt *= v1**v2 % MOD print(cnt%MOD)
p02684
s300205750
Accepted
from collections import defaultdict N, K = map(int, input().split()) A = list(map(int, input().split())) visited = [0] * N current = 0 i = 1 while i <= K: current = A[current] - 1 if visited[current] == 0: visited[current] = i else: loop = i - visited[current] num_loop = (K - i) // loop i += loop * num_loop i += 1 ans = current + 1 print(ans)
p02765
s524728633
Accepted
def solve(string): n, r = map(int, string.split()) return str(r + max(10 - n, 0) * 100) if __name__ == '__main__': import sys print(solve(sys.stdin.read().strip()))
p02717
s993909893
Accepted
'''Swap the integer in each box''' A, B, C = [int(i) for i in input("").split()] New = A A = B B = New New1 = A A = C C = New1 print(A, B, C)
p02607
s055604447
Accepted
def main(): N = int(input()) A = list(map(int, input().split())) cnt = 0 for i in range(N): if i%2==0 and A[i]%2==1: cnt += 1 print(cnt) if __name__ == '__main__': main()
p04043
s014643278
Wrong Answer
sort_list = list(map(int, input().split())) if sort_list.count(5) == 1 and sort_list.count(7) == 2: print("YES") else: print("NO")
p04043
s989113459
Accepted
s = input() if s.count('5') == 2 and s.count('7') == 1: print('YES') else: print('NO')
p03486
s358922042
Accepted
import sys s = sys.stdin.readline().strip() t = sys.stdin.readline().strip() if sorted(s) < sorted(t, reverse=True): print("Yes") else: print("No")
p02554
s550165982
Accepted
N = int(input()) x = 10 ** 9 + 7 print(((10 ** N) % x - (2 * (9 ** N)) % x + (8 ** N) % x) % x)
p03438
s269237885
Accepted
def petrozavodsk001_b(): _ = int(input()) A = list(map(int, input().split())) B = list(map(int, input().split())) act = sum(B) - sum(A) if act < 0: print('No') return addA, addB = 0, 0 for a, b in zip(A, B): if a > b: addB += a - b else: addA += (b - a + 1) // 2 if addA <= act and addB <= act: print('Yes') else: print('No') petrozavodsk001_b()
p02641
s862954121
Wrong Answer
x, n = map(int, input().split()) if n == 0: # input() print(x) else: l = list(map(int, input().split())) l.sort() small = x large = x while small in l and large in l: small -= 1 large += 1 if x - small > large - x: print(large) else: print(small)
p02717
s767021649
Wrong Answer
x,y,z = input().split() print(y,z,x)
p02640
s734673212
Wrong Answer
n,m=map(int,input().split()) x=(4*n-m)/2 y=n-x ans = x+y if ans==n: print('Yes') else: ('No')
p02811
s898447436
Wrong Answer
k,x = input().split(" ") text = "No" if k*500>=x: text = "Yes" print(text)
p02687
s201959961
Accepted
x=input() if x =="ABC": print("ARC") else: print("ABC")
p03774
s008329116
Wrong Answer
n,m = list(map(int,input().strip().split())) # 2次元配列 student = [] for i in range(n): array = list(map(int, input().strip().split())) student.append(array) cp = [] for i in range(m): array = list(map(int, input().strip().split())) cp.append(array) result = [0] * n for i in range(n): dis_min = 10**9 for j in range(m): dis = abs(student[i][0]-cp[j][0]) + abs(student[i][1] - cp[j][1]) if dis <= dis_min: dis_min = dis result[i] = j+1 for i in result: print(i)
p03211
s053284851
Wrong Answer
s=input() res=1000 for i in range(3,len(s)): res=min(res,abs(753-int(s[i-3:i]))) print(res)
p03160
s394966589
Accepted
n = int(input()) h = list(map(int,input().split())) dp = [999999]*(n+1) dp[0] = 0 dp[1] = 0 dp[2] = abs(h[1]-h[0]) for i in range(3,n+1): dp[i] = min(dp[i-1] + abs(h[i-1]-h[i-2]), dp[i-2] +abs(h[i-1] - h[i-3])) print(dp[n])
p03073
s361378826
Wrong Answer
s = list(input()) n = int(len(s)/2) c = 0 if len(s) >= 2: if s[1] == s[0]: c +=1 if s[0] == 0: s[1] = 1 elif s[0] == 1: s[1] = 0 for i in range(n): if s[0] != s[2*i]: c += 1 if s[1] != s[2*i+1]: c += 1 print(c)
p02909
s472469910
Accepted
s = input() tenki = ["Sunny", "Cloudy", "Rainy"] i = tenki.index(s) i = (i+1)%3 print(tenki[i])
p02910
s321892827
Accepted
n=input() l=len(n) h="Yes" for i in range(0,len(n)): if (i+1)%2!=0: if n[i]=="R"or n[i]=="U"or n[i]=="D" : pass else: h="No" break else: if n[i]=="L"or n[i]=="U"or n[i]=="D" : pass else: h="No" break print(h)
p03013
s056563993
Accepted
n, m = list(map(int, input().split())) broken = [0] * (n + 1) for _ in range(m): broken[int(input())] = 1 mod = 1000000007 dp = [0] * (n + 2) dp[n] = 1 for i in range(n - 1, -1, -1): if broken[i]: dp[i] = 0 else: dp[i] = dp[i + 1] + dp[i + 2] dp[i] = dp[i] % mod print(dp[0])
p02546
s946471042
Accepted
S = input() #print(S,len(S)) if S[len(S)-1] == 's': print(S+'es') else: print(S+'s')
p02888
s743151513
Accepted
import bisect n = int(input()) l = list(map(int,input().split())) l.sort() c = 0 for i in range(n)[::-1]: for j in range(i)[::-1]: d = l[i] - l[j] idx = bisect.bisect_right(l,d) c += max(0,j-idx) print(c)
p03745
s708529071
Accepted
from collections import deque n = int(input()) a = list(map(int,input().split())) d = deque(a) tmp = [] cnt = 0 while d: v = d.popleft() if len(tmp)<=1: pass else: if not (v >= tmp[-1] >= tmp[-2] >= tmp[0] or v <= tmp[-1] <= tmp[-2] <= tmp[0]): tmp = [] cnt += 1 tmp.append(v) # print(d,tmp,cnt) if tmp: cnt+=1 print(cnt)
p02811
s563041884
Accepted
k,x = (int(x) for x in input().split()) if 500*k >= x: print("Yes") else: print("No")
p02947
s156312845
Wrong Answer
from collections import Counter N = int(input()) s_list = list() for _ in range(N): s_list.append(''.join(sorted(input()))) count = 0 for k, v in Counter(s_list).items(): count += v - 1 print(count)
p03131
s024249311
Accepted
k, a, b = map(int, input().split()) n = min(a - 1, k) + 1 k -= (n - 1) if a + 2 <= b: n += (k // 2) * (b - a) n += k % 2 else: n += k print(n)
p03062
s293853322
Accepted
def resolve(): N = int(input()) A = list(map(int, input().split())) absA = list(map(abs, A)) negcnt = 0 for a in A: if a < 0: negcnt += 1 if 0 in A or negcnt%2==0: print(sum(absA)) else: print(sum(absA)-2*min(absA)) if '__main__' == __name__: resolve()
p04031
s494816805
Accepted
# -*- coding:utf-8 -*- import sys,math,statistics input = sys.stdin.readline n = int(input()) a = [int(_) for _ in input().split()] c1 = math.floor(statistics.mean(a)) c2 = math.ceil(statistics.mean(a)) a1 = sum([(i-c1)**2 for i in a]) a2 = sum([(i-c2)**2 for i in a]) print(min(a1,a2))
p03861
s697618859
Accepted
# import numpy as np # import math import sys input = sys.stdin.readline def main(): a,b,x = map(int,input().split()) res = b // x - (a - 1) // x print(res) main()
p03433
s693760615
Accepted
n = int(input()) a = int(input()) r = n%500 if a>=r: print('Yes') else: print('No')
p03427
s560909011
Wrong Answer
n = list(input()) n = [int(n[i]) for i in range(len(n))] m = set(n[1:]) if m == {9}: print(sum(n[1:]) + n[0]) exit() elif m == {}: print(n[0]) exit() else: print(9*(len(n)-1) + n[0] -1)
p03379
s362888499
Wrong Answer
N = int(input()) X = list(map(int,input().split())) for i in range(N): if i < N//2-1: print(X[(N)//2]) elif i == N//2: print(X[(N)//2-1]) elif i == N//2-1: print(X[(N)//2]) elif i > N//2: print(X[(N)//2-1])
p02661
s986187464
Accepted
import bisect n = int(input()) a = [] b = [] for i in range(n): m, p = map(int, input().split()) a.append(m) b.append(p) a.sort() b.sort() middle = n // 2 if n % 2: print(b[middle] - a[middle] + 1) else: a_m = ( a[middle] + a[middle - 1] ) / 2 b_m = ( b[middle] + b[middle - 1] ) / 2 print(int((b_m - a_m) * 2 + 1))
p03160
s510641986
Accepted
n=int(input()) h=list(map(int,input().split())) dp=[0] dp.append(abs(h[1]-h[0])) for i in range(2,n): step1=dp[i-1]+abs(h[i]-h[i-1]) step2=dp[i-2]+abs(h[i]-h[i-2]) dp.append(min(step1,step2)) print(dp[-1])
p03759
s316348649
Accepted
a,b,c=map(int,input().split()) if b-a==c-b: print("YES") else: print("NO")
p03438
s314480049
Wrong Answer
n,*a=map(int,open(0).read().split()) u=d=z=0 for i,j in zip(a[:n],a[n:]): if j-i>0:u+=j-i elif j-i==0:z+=1 else:d+=j-i print("Yes" if u+2*d>=0 else "No")
p02780
s978464293
Accepted
n,k = map(int, input().split()) p = list(map(int, input().split())) m = sum(p[:k]) q = m for i in range(n - k): q = q - p[i] + p[i + k] if q > m: m = q print((k + m) / 2)
p02780
s565081243
Accepted
a, b = map(int, input().split()) c = list(map(int,input().split())) x = [(e + 1) / 2 for e in c] t = sum(x[0:b]) res = t for i in range(a - b): t -= x[i] t += x[i+b] res = max(res,t) print('{:.12f}'.format(res))
p04011
s532905816
Accepted
N = int(input()) K = int(input()) X = int(input()) Y = int(input()) print(min(N*X, (N-K)*Y+K*X))
p02695
s059928405
Accepted
N, M, Q = map(int, input().split()) #数字 Q = [list(map(int, input().split())) for i in range(Q)] #数字複数列、複数行 import itertools A = 0 for i in itertools.combinations_with_replacement(range(M),N): score = 0 for j in range(len(Q)): if i[Q[j][1]-1] - i[Q[j][0]-1] == Q[j][2]: score += Q[j][3] if score > A: A = score print(A)
p02910
s274463040
Accepted
S=input() ans=True for i in range(0, len(S)): if i%2==1 and S[i]=='R': ans=False elif i%2==0 and S[i]=='L': ans=False print("Yes" if ans else "No")
p02659
s818858642
Accepted
from decimal import Decimal a, b = map(Decimal, input().split()) print(a * b //1)
p03854
s315201581
Wrong Answer
s = input() def solve(query): while 1: for frag in ("erase", "eraser", "dream", "dreamer"): if query.endswith(frag): query = query[:-len(frag)] print("cut", frag) break else: print("NO", query) break if not query: print("YES") break solve(s)
p02775
s101857731
Accepted
nl = list(input()) # 繰り上げと繰り下げ dp = [[0, 10000] for i in range(len(nl) + 1)] for i, n in enumerate(nl[::-1]): n = int(n) dp[i+1][0] = min(dp[i][0] + n, dp[i][1] + n + 1) dp[i+1][1] = min(10 - n + dp[i][0], 10 - n - 1 + dp[i][1]) print(min(dp[-1][0], dp[-1][1]+1))
p03852
s899710257
Wrong Answer
c = raw_input() if c == 'a' or 'e' or 'i' or 'e' or 'u': print "vowel" else: print "consonant"
p02924
s448931477
Wrong Answer
n=int(input()) ans=int((n-1)*n/2) print(ans)
p03720
s352559923
Wrong Answer
n, m = map(int, input().split()) route_lists = [input().split() for i in range(m)] new_lists = [] for i in route_lists: for j in range(2): new_lists.append(i[j]) new_lists.sort() sets = set(new_lists) num_lists = list(sets) num_lists.sort() for i in num_lists: print(new_lists.count(i))
p02971
s124286550
Accepted
n = int(input()) s = [int(input()) for i in range(n)] a = sorted(s,reverse=True) M = a[0] for i in range(n): if s[i] == M: print(a[1]) else: print(a[0])
p03438
s390816173
Accepted
n=int(input()) a=list(map(int,input().split())) b=list(map(int,input().split())) sum1=0 sum2=0 for i,j in zip(a,b): if i>j: sum1+=(i-j) elif i<j: sum2+=(j-i)//2 print('Yes' if sum1<=sum2 else 'No')
p02657
s258910898
Wrong Answer
a, b = map(str, input().split()) a = int(a) b = int(float(b) //0.01) print(int(a*b)//100)
p03062
s508067195
Wrong Answer
n=int(input()) a=list(map(int,input().split())) ans=0 mai=0 for i in range(n): if a[i]<0: mai+=1 for i in range(n): if i==0 or i==n-1: continue if a[i]<0: a[i]=-a[i] ans+=a[i] dif=min(a[0],a[n-1]) dim=max(a[0],a[n-1]) if mai%2==0: print(max(ans-dif-dim,ans+dif+dim)) else: print(max(ans+dif-dim,ans-dif+dim))