wrong_submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | user_id stringlengths 10 10 | time_limit float64 1k 8k | memory_limit float64 131k 1.05M | wrong_status stringclasses 2
values | wrong_cpu_time float64 10 40k | wrong_memory float64 2.94k 3.37M | wrong_code_size int64 1 15.5k | problem_description stringlengths 1 4.75k | wrong_code stringlengths 1 6.92k | acc_submission_id stringlengths 10 10 | acc_status stringclasses 1
value | acc_cpu_time float64 10 27.8k | acc_memory float64 2.94k 960k | acc_code_size int64 19 14.9k | acc_code stringlengths 19 14.9k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
s751022470 | p03069 | u167931717 | 2,000 | 1,048,576 | Wrong Answer | 303 | 5,180 | 696 | There are N stones arranged in a row. Every stone is painted white or black. A string S represents the color of the stones. The i-th stone from the left is white if the i-th character of S is `.`, and the stone is black if the character is `#`. Takahashi wants to change the colors of some stones to black or white so t... | n = int(input())
s = input()
count1 = 0
found = False
for ss in s:
if found:
if ss == '.':
print('n1')
count1 += 1
else:
print('n2')
pass
else:
if ss == '.':
print('n3')
pass
else:
print('n4')
... | s265595258 | Accepted | 130 | 3,500 | 314 | n = int(input())
s = input()
left_white = 0
right_black = 0
for ss in s:
if ss == '.':
left_white += 1
min_sum = left_white + right_black
for ss in s:
if ss == '.':
left_white -= 1
else:
right_black += 1
min_sum = min(min_sum, left_white + right_black)
print(min_sum)
|
s985942353 | p03360 | u376420711 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 90 | There are three positive integers A, B and C written on a blackboard. E869120 performs the following operation K times: * Choose one integer written on the blackboard and let the chosen integer be n. Replace the chosen integer with 2n. What is the largest possible sum of the integers written on the blackboard after... | l = sorted(map(int, input().split()))
k = int(input())
l[2] = l[2] * k ** 2
print(sum(l))
| s549483508 | Accepted | 17 | 2,940 | 92 | l = sorted(map(int, input().split()))
k = int(input())
l[2] = l[2] * (2 ** k)
print(sum(l))
|
s570841169 | p03351 | u969848070 | 2,000 | 1,048,576 | Wrong Answer | 17 | 2,940 | 202 | Three people, A, B and C, are trying to communicate using transceivers. They are standing along a number line, and the coordinates of A, B and C are a, b and c (in meters), respectively. Two people can directly communicate when the distance between them is at most d meters. Determine if A and C can communicate, either ... | a, b, c, d = map(int, input().split())
if abs(a-b)>abs(a-c):
if abs(a-b)<=d and abs(b-c)<=d:
print('Yes')
else:
print('No')
else:
if abs(a-c)<= d:
print('Yes')
else:
print('No')
| s779657901 | Accepted | 17 | 3,060 | 202 | a, b, c, d = map(int, input().split())
if abs(a-b) <abs(a-c):
if abs(a-b)<=d and abs(b-c)<=d:
print('Yes')
else:
print('No')
else:
if abs(a-c)<= d:
print('Yes')
else:
print('No') |
s881913823 | p03943 | u023229441 | 2,000 | 262,144 | Wrong Answer | 18 | 2,940 | 78 | Two students of AtCoder Kindergarten are fighting over candy packs. There are three candy packs, each of which contains a, b, and c candies, respectively. Teacher Evi is trying to distribute the packs between the two students so that each student gets the same number of candies. Determine whether it is possible. Not... | A=list(map(int,input().split()))
A.sort()
print(["Yes","No"][A[0]+A[1]==A[2]]) | s141961444 | Accepted | 18 | 2,940 | 76 | A=sorted(list(map(int,input().split())))
print("YNeos"[A[0]+A[1]!=A[2]::2])
|
s526289267 | p00205 | u032662562 | 1,000 | 131,072 | Wrong Answer | 20 | 5,656 | 801 | ไปฒ่ฏใ 5 ไบบ็ตใงใใใใใใใใใใจใซใชใใพใใใใใใใใใจใฏใใฐใผใใใงใญใใใผใจใใ 3ใคใฎๆใใใใใฐใผใจใใงใญใฎๅ่ฒ ใชใใฐใผใใๅใกใใปใใงใญใใ่ฒ ใใใใใงใญใจใใผใชใใใใงใญใใๅใกใใปใใผใใ่ฒ ใใใใใผใจใฐใผใชใใใผใใๅใกใใปใฐใผใใ่ฒ ใใใจใใใซใผใซใงใใๅ
จๅกใๅใๆใใพใใฏใฐใผใใใงใญใใใผๅ
จใฆใๅบใๅ ดๅใฏใใใใใใจใชใใพใใ 5 ไบบใฎใใใใใใฎๆใๅ
ฅๅใจใใใใใใใฎไบบใฎๅๆใๅบๅใใใใญใฐใฉใ ใไฝๆใใฆใใ ใใใใใใใใใฎๆใฏใใฐใผใฏ 1ใใใงใญใฏ 2ใใใผใฏ 3 ใฎๆฐๅญใง่กจใใพใใๅๆใฏใๅใกใใ 1ใใ่ฒ ใใใ 2ใใใใใใใ 3 ใฎๆฐๅญใง่กจใใๅ
ฅๅ้ ใซๅพใฃใฆๅบๅใใพใใ | # -*- coding: utf-8 -*-
#import pdb; pdb.set_trace()
import sys
def solv(v):
w = set(v)
if len(w)==1 or len(w)==3:
d={1:2, 2:2, 3:2}
elif 1 in w and 2 in w:
d={1:1, 2:2}
elif 2 in w and 3 in w:
d={2:1, 3:2}
else:
d={3:1, 1:2}
return(list(map(lambda x:d[x], v) ... | s667584935 | Accepted | 30 | 5,652 | 801 | # -*- coding: utf-8 -*-
#import pdb; pdb.set_trace()
import sys
def solv(v):
w = set(v)
if len(w)==1 or len(w)==3:
d={1:3, 2:3, 3:3}
elif 1 in w and 2 in w:
d={1:1, 2:2}
elif 2 in w and 3 in w:
d={2:1, 3:2}
else:
d={3:1, 1:2}
return(list(map(lambda x:d[x], v) ... |
s643711562 | p03386 | u326208069 | 2,000 | 262,144 | Wrong Answer | 2,113 | 186,148 | 491 | Print all the integers that satisfies the following in ascending order: * Among the integers between A and B (inclusive), it is either within the K smallest integers or within the K largest integers. | A,B,K = map(int, input().split())
num = B-A+1
lis = []
ans = []
for i in range(num):
lis += str(A)
A += 1
n=0
for j in range(K):
if j <= B-2:
ans += lis[j]
if j == B:
break
num = B-A
for l in range(K):
if A > l+2:
ans += lis[num-l]
if l == A:
... | s340532900 | Accepted | 17 | 3,064 | 727 |
A,B,K = map(int, input().split())
lis = []
for i in range(A, A+K):
if i <= B:
lis.append(i)
for j in range(B-K+1, B+1):
if j >= A:
lis.append(j)
ans_set = set(lis)
ans_list = list(ans_set)
ans_list.sort()
for n in ans_list:
print(n) |
s384572222 | p02601 | u512623857 | 2,000 | 1,048,576 | Wrong Answer | 31 | 9,192 | 172 | M-kun has the following three cards: * A red card with the integer A. * A green card with the integer B. * A blue card with the integer C. He is a genius magician who can do the following operation at most K times: * Choose one of the three cards and multiply the written integer by 2. His magic is successfu... | A,B,C = map(int,input().split())
K = int(input())
while K != 0:
if A >= B:
B *= 2
elif B >= C:
C *= 2
K -= 1
if A < B < C:
print("YES")
else:
print("NO") | s184764634 | Accepted | 32 | 9,172 | 172 | A,B,C = map(int,input().split())
K = int(input())
while K != 0:
if A >= B:
B *= 2
elif B >= C:
C *= 2
K -= 1
if A < B < C:
print("Yes")
else:
print("No") |
s661750659 | p04045 | u197457087 | 2,000 | 262,144 | Wrong Answer | 118 | 3,064 | 331 | Iroha is very particular about numbers. There are K digits that she dislikes: D_1, D_2, ..., D_K. She is shopping, and now paying at the cashier. Her total is N yen (the currency of Japan), thus she has to hand at least N yen to the cashier (and possibly receive the change). However, as mentioned before, she is very ... | N, K = map(int,input().split())
D = list(map(int,input().split()))
OK = []
for i in range(10):
if i not in D:
OK.append(str(i))
print(OK)
sn = str(N)
l = len(sn)
ans = N*1
Flag = 0
while Flag == 0:
sans = str(ans)
if all(sans[i] in OK for i in range(len(sans))):
Flag = 1
else:
ans += 1
print(ans)
... | s311021426 | Accepted | 88 | 9,188 | 380 | N,K = map(int,input().split())
A = set(map(int,input().split()))
#A = set(A)
ok = []
for i in range(10):
if i not in A:
ok.append(i)
#print(ok)
while True:
nstr = str(N)
nstr = list(nstr)
#print(nstr)
Flag = True
for x in nstr:
x = int(x)
if x in A:
Flag = False
break
#print(Flag)
... |
s115776591 | p03588 | u918935103 | 2,000 | 262,144 | Wrong Answer | 287 | 3,060 | 138 | A group of people played a game. All players had distinct scores, which are positive integers. Takahashi knows N facts on the players' scores. The i-th fact is as follows: the A_i-th highest score among the players is B_i. Find the maximum possible number of players in the game. | n = int(input())
a = 0
for i in range(n):
a1,b1 = map(int,input().split())
if a < a1:
a = a1
b = b1
print(a + b-1) | s284101097 | Accepted | 284 | 3,060 | 140 | n = int(input())
a = 0
b = 0
for i in range(n):
a1,b1 = map(int,input().split())
if a < a1:
a = a1
b = b1
print(a+b) |
s355307037 | p03635 | u481113010 | 2,000 | 262,144 | Wrong Answer | 18 | 2,940 | 117 | In _K-city_ , there are n streets running east-west, and m streets running north-south. Each street running east-west and each street running north-south cross each other. We will call the smallest area that is surrounded by four streets a block. How many blocks there are in K-city? | print('<ๅ
ฅๅ>')
n,m = map(int,input('n m = ').split())
x = (int(n) - 1) * (int(m) - 1)
print('<ๅบๅ>')
print(x) | s020146480 | Accepted | 18 | 2,940 | 71 | n,m = map(int,input().split())
x = (int(n) - 1) * (int(m) - 1)
print(x) |
s235701049 | p00004 | u002010345 | 1,000 | 131,072 | Wrong Answer | 20 | 5,580 | 172 | Write a program which solve a simultaneous equation: ax + by = c dx + ey = f The program should print x and y for given a, b, c, d, e and f (-1,000 โค a, b, c, d, e, f โค 1,000). You can suppose that given equation has a unique solution. | def main():
p = [float(x) for x in input().split()]
x = (p[4]*p[2]-p[1]*p[5])/(p[0]*p[4]-p[1]*p[3])
y = (p[2]-p[0]*x)/p[1]
print("%.3f %.3f"%(x,y))
main()
| s555983689 | Accepted | 30 | 5,588 | 354 | def main():
while 1:
try:
p = [float(x) for x in input().split()]
x = (p[4]*p[2]-p[1]*p[5])/(p[0]*p[4]-p[1]*p[3])
y = (p[2]-p[0]*x)/p[1]
except:
break
if abs(x)<1e-4:
x=0.0
if abs(y)<1e-4:
y=0.0
print("{:... |
s451199176 | p04045 | u363438602 | 2,000 | 262,144 | Wrong Answer | 193 | 3,064 | 325 | Iroha is very particular about numbers. There are K digits that she dislikes: D_1, D_2, ..., D_K. She is shopping, and now paying at the cashier. Her total is N yen (the currency of Japan), thus she has to hand at least N yen to the cashier (and possibly receive the change). However, as mentioned before, she is very ... | n,k=map(int, input().split())
l1=map(int,input().split())
l2=[0,1,2,3,4,5,6,7,8,9]
l3=set(l1)^set(l2)
m=str(n)
l4=map(int,set(m))
l4=set(l4)
def check(a,b):
if (a|b)==a:
return True
else:
return False
while check(l3,l4) is False:
n=n+1
m=str(n)
l4=map(int,set(m))
l4=set(l4)
print... | s093533303 | Accepted | 196 | 3,064 | 323 | n,k=map(int, input().split())
l1=map(int,input().split())
l2=[0,1,2,3,4,5,6,7,8,9]
l3=set(l1)^set(l2)
m=str(n)
l4=map(int,set(m))
l4=set(l4)
def check(a,b):
if (a|b)==a:
return True
else:
return False
while check(l3,l4) is False:
n=n+1
m=str(n)
l4=map(int,set(m))
l4=set(l4)
print... |
s716391613 | p03698 | u453642820 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 55 | You are given a string S consisting of lowercase English letters. Determine whether all the characters in S are different. | S=input()
print("Yes" if len(S)==len(set(S)) else "No") | s120008497 | Accepted | 17 | 2,940 | 55 | S=input()
print("yes" if len(S)==len(set(S)) else "no") |
s207167027 | p03359 | u478212979 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 91 | In AtCoder Kingdom, Gregorian calendar is used, and dates are written in the "year-month-day" order, or the "month-day" order without the year. For example, May 3, 2018 is written as 2018-5-3, or 5-3 without the year. In this country, a date is called _Takahashi_ when the month and the day are equal as numbers. For ... | a, b = (input().split(" "))
a = int(a)
b = int(b)
if a<b:
print(a)
else:
print(a-1) | s963531458 | Accepted | 18 | 2,940 | 92 | a, b = (input().split(" "))
a = int(a)
b = int(b)
if a<=b:
print(a)
else:
print(a-1) |
s305195565 | p03556 | u246572032 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 30 | Find the largest square number not exceeding N. Here, a _square number_ is an integer that can be represented as the square of an integer. | n = int(input())
print(n**.5)
| s010396163 | Accepted | 17 | 2,940 | 37 | n = int(input())
print(int(n**.5)**2) |
s423407293 | p02255 | u185486509 | 1,000 | 131,072 | Wrong Answer | 20 | 5,592 | 192 | Write a program of the Insertion Sort algorithm which sorts a sequence A in ascending order. The algorithm should be based on the following pseudocode: for i = 1 to A.length-1 key = A[i] /* insert A[i] into the sorted sequence A[0,...,j-1] */ j = i - 1 while j >= 0 and A[j] > key ... | n=int(input())
a=list(map(int,input().split(' ')))
for i in range(n):
v=a[i]
j=i-1
while j>=0 and a[j]>v:
a[j+1]=a[j]
j=j-1
a[j+1]=v
print(" ".join(map(str,a))) | s378888423 | Accepted | 20 | 5,596 | 196 | n=int(input())
a=list(map(int,input().split(' ')))
for i in range(n):
v=a[i]
j=i-1
while j>=0 and a[j]>v:
a[j+1]=a[j]
j=j-1
a[j+1]=v
print(" ".join(map(str,a))) |
s834918630 | p04011 | u668352391 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 127 | There is a hotel with the following accommodation fee: * X yen (the currency of Japan) per night, for the first K nights * Y yen per night, for the (K+1)-th and subsequent nights Tak is staying at this hotel for N consecutive nights. Find his total accommodation fee. | n = int(input())
k = int(input())
x = int(input())
y = int(input())
if n >= k:
print(k * x)
else:
print(n * x + (k - n)*y) | s008752917 | Accepted | 17 | 2,940 | 127 | n = int(input())
k = int(input())
x = int(input())
y = int(input())
if n <= k:
print(n * x)
else:
print(k * x + (n - k)*y) |
s558516513 | p03493 | u189575640 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 44 | Snuke has a grid consisting of three squares numbered 1, 2 and 3. In each square, either `0` or `1` is written. The number written in Square i is s_i. Snuke will place a marble on each square that says `1`. Find the number of squares on which Snuke will place a marble. | s = "000"
ss = s.split("1")
print(len(ss)-1) | s723771107 | Accepted | 17 | 2,940 | 51 | s = str(input())
ss = s.split("1")
print(len(ss)-1) |
s214611866 | p03129 | u272557899 | 2,000 | 1,048,576 | Wrong Answer | 18 | 2,940 | 111 | Determine if we can choose K different integers between 1 and N (inclusive) so that no two of them differ by 1. |
n, k = map(int, input().split())
if k <= (n + 1) // 2:
print("Yes")
else:
print("No") | s766675392 | Accepted | 19 | 2,940 | 111 |
n, k = map(int, input().split())
if k <= (n + 1) // 2:
print("YES")
else:
print("NO") |
s222355237 | p03494 | u761529120 | 2,000 | 262,144 | Wrong Answer | 19 | 3,060 | 223 | There are N positive integers written on a blackboard: A_1, ..., A_N. Snuke can perform the following operation when all integers on the blackboard are even: * Replace each integer X on the blackboard by X divided by 2. Find the maximum possible number of operations that Snuke can perform. | N = int(input())
A = list(map(int, input().split()))
ans = float('inf')
for i in range(N):
cnt = 0
while A[i] % 2 == 0:
A[i] = A[i] // 2
cnt += 1
if ans > cnt:
ans = cnt
print(cnt) | s570344969 | Accepted | 19 | 3,060 | 222 | N = int(input())
A = list(map(int, input().split()))
res = float('inf')
for i in range(N):
count = 0
while A[i] % 2 == 0:
A[i] /= 2
count += 1
if res > count:
res = count
print(res) |
s028434262 | p02401 | u406434162 | 1,000 | 131,072 | Wrong Answer | 20 | 5,596 | 221 | Write a program which reads two integers a, b and an operator op, and then prints the value of a op b. The operator op is '+', '-', '*' or '/' (sum, difference, product or quotient). The division should truncate any fractional part. | a,b,c= input().split()
a = int(a)
c = int(c)
#print(a)
#print(a,b,c)
if b == "+":
print(a + c)
elif b == "-":
print(a - c)
elif b == "*":
print(a * c)
elif b == "/":
print(a / c)
elif b == "?":
pass
| s886608262 | Accepted | 20 | 5,596 | 263 | while True:
a,b,c= input().split()
a = int(a)
c = int(c)
if b == "+":
print(a + c)
elif b == "-":
print(a - c)
elif b == "*":
print(a * c)
elif b == "/":
print(a // c)
elif b == "?":
break
|
s406268096 | p03737 | u667694979 | 2,000 | 262,144 | Wrong Answer | 18 | 2,940 | 63 | You are given three words s_1, s_2 and s_3, each composed of lowercase English letters, with spaces in between. Print the acronym formed from the uppercased initial letters of the words. | s1,s2,s3=input().split()
S=s1[0]+s2[0]+s3[0]
S.upper()
print(S) | s608002612 | Accepted | 17 | 2,940 | 61 | s1,s2,s3=input().split()
S=s1[0]+s2[0]+s3[0]
print(S.upper()) |
s138123155 | p02612 | u284120954 | 2,000 | 1,048,576 | Wrong Answer | 27 | 9,052 | 32 | We will buy a product for N yen (the currency of Japan) at a shop. If we use only 1000-yen bills to pay the price, how much change will we receive? Assume we use the minimum number of bills required. | N = int(input())
print(N % 1000) | s664028595 | Accepted | 26 | 9,184 | 82 | N = int(input())
if N % 1000 == 0:
print(0)
else:
print(1000 - (N % 1000)) |
s491253225 | p02613 | u814271993 | 2,000 | 1,048,576 | Wrong Answer | 215 | 9,068 | 312 | Takahashi is participating in a programming contest called AXC002, and he has just submitted his code to Problem A. The problem has N test cases. For each test case i (1\leq i \leq N), you are given a string S_i representing the verdict for that test case. Find the numbers of test cases for which the verdict is `AC`,... | n = int(input())
a = 0
b = 0
c = 0
d = 0
for i in range(n):
S = list(map(str, input().split()))
if S[0] == 'AC':
a += 1
if S[0] == 'WA':
b += 1
if S[0] == 'TLE':
c += 1
if S[0] == 'RE':
d += 1
print('AC ร '+str(a))
print('WA ร '+str(b))
print('TLE ร '+str(c))
print('RE ร '+str(d)) | s267509354 | Accepted | 148 | 16,064 | 323 | n=int(input())
l = [input() for i in range(n)]
ac = 0
wa = 0
tle = 0
re = 0
for i in l:
if i == 'AC':
ac += 1
if i == 'WA':
wa += 1
if i == 'TLE':
tle += 1
if i == 'RE':
re += 1
print('AC x '+str(ac))
print('WA x '+str(wa))
print('TLE x '+str(tle))
print('RE x '+str(r... |
s700539271 | p03353 | u021548497 | 2,000 | 1,048,576 | Wrong Answer | 18 | 3,064 | 386 | You are given a string s. Among the **different** substrings of s, print the K-th lexicographically smallest one. A substring of s is a string obtained by taking out a non-empty contiguous part in s. For example, if s = `ababc`, `a`, `bab` and `ababc` are substrings of s, while `ac`, `z` and an empty string are not. A... | s = input()
n = int(input())
ans = "zzzzz"
anslist = set()
for i in range(0,5):
for j in range(0,5):
if i < j <= len(s):
anslist.add(s[-j:-i])
for i in range(len(s)-5):
if s[i:i+5] < ans:
ans = s[i:i+5]
for i in range(1, 6):
anslist.add(ans[0:i])
anslist = list(anslist)
anslist.s... | s657033466 | Accepted | 19 | 3,064 | 426 | s = input()
n = int(input())
ans = "zzzzz"
anslist = set()
for i in range(0,5):
for j in range(0,5):
if i < j <= len(s):
if i != 0:
anslist.add(s[-j:-i])
else:
anslist.add(s[-j:])
for i in range(len(s)-5):
if s[i:i+5] < ans:
ans = s[i:i+5]
... |
s986551492 | p03721 | u245870380 | 2,000 | 262,144 | Wrong Answer | 314 | 3,060 | 155 | There is an empty array. The following N operations will be performed to insert integers into the array. In the i-th operation (1โคiโคN), b_i copies of an integer a_i are inserted into the array. Find the K-th smallest integer in the array after the N operations. For example, the 4-th smallest integer in the array \\{1,2... | N, K = map(int, input().split())
cnt = 1
for i in range(N):
a, b = map(int, input().split())
if cnt <= K <= cnt + b:
print(a)
cnt += b | s828774762 | Accepted | 519 | 20,872 | 249 | N, K = map(int, input().split())
lis = []
for i in range(N):
a, b = map(int, input().split())
lis.append([a,b])
lis = sorted(lis)
cnt = 0
for x, y in lis:
if cnt <= K <= cnt + y:
print(x)
break
else:
cnt += y |
s963470601 | p03485 | u988191897 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 84 | You are given two positive integers a and b. Let x be the average of a and b. Print x rounded up to the nearest integer. | a,b = map(int,input().split())
A = (a+b)/2
print(A if (A*10)%2 == 0 else int(A+0.5)) | s329281454 | Accepted | 17 | 2,940 | 50 | a,b = map(int,input().split())
print((a+b-1)//2+1) |
s104363107 | p03485 | u505793792 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 96 | You are given two positive integers a and b. Let x be the average of a and b. Print x rounded up to the nearest integer. | a, b = map(int, input().split())
c = int((a + b) / 2)
print(c) if c == (a + b) else print(c + 1) | s880111303 | Accepted | 17 | 2,940 | 102 | a, b = map(int, input().split())
c = int((a + b) / 2)
print(c) if c == ((a + b) / 2) else print(c + 1) |
s725609027 | p02388 | u279955105 | 1,000 | 131,072 | Wrong Answer | 30 | 7,484 | 115 | Write a program which calculates the cube of a given integer x. | def print_list(lst) :
lst = ' '.join(list(map(str, lst)))
print(lst)
x = input().split()
t = 3 * x
print_list(t) | s078918553 | Accepted | 20 | 5,576 | 29 | x = int(input())
print(x**3)
|
s592046653 | p03963 | u557494880 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 49 | There are N balls placed in a row. AtCoDeer the deer is painting each of these in one of the K colors of his paint cans. For aesthetic reasons, any two adjacent balls must be painted in different colors. Find the number of the possible ways to paint the balls. | N, K = map(int,input().split())
print(K*K**(N-1)) | s406904828 | Accepted | 18 | 2,940 | 54 | N, K = map(int,input().split())
print(K*(K-1)**(N-1))
|
s707817403 | p02578 | u974231963 | 2,000 | 1,048,576 | Wrong Answer | 133 | 32,288 | 289 | N persons are standing in a row. The height of the i-th person from the front is A_i. We want to have each person stand on a stool of some heights - at least zero - so that the following condition is satisfied for every person: Condition: Nobody in front of the person is taller than the person. Here, the height of a ... |
n = int(input())
a_list = list(map(int, input().split()))
_sum = 0
for e in range(len(a_list)):
# print('aaa')
if e != 0 :
# print('bbb')
if a_list[e] < a_list[e - 1] :
# print('ccc')
_sum = _sum + (a_list[e - 1] - a_list[e])
print(_sum) | s409683568 | Accepted | 181 | 32,112 | 353 |
n = int(input())
a_list = list(map(int, input().split()))
_sum = 0
for e in range(len(a_list)):
# print('aaa')
if e != 0 :
# print('bbb')
if a_list[e] < a_list[e - 1] :
# print('ccc')
_sum = _sum + (a_list[e - 1] - a_list[e])
a_list[e] = a_list[e] + (a_list... |
s913626929 | p03658 | u791664126 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 77 | Snuke has N sticks. The length of the i-th stick is l_i. Snuke is making a snake toy by joining K of the sticks together. The length of the toy is represented by the sum of the individual sticks that compose it. Find the maximum possible length of the toy. | _,n=map(int,input().split());print(sum(sorted(map(int,input().split()))[n:])) | s697872538 | Accepted | 17 | 2,940 | 78 | _,n=map(int,input().split());print(sum(sorted(map(int,input().split()))[-n:])) |
s655493316 | p02612 | u857673087 | 2,000 | 1,048,576 | Wrong Answer | 31 | 9,164 | 31 | We will buy a product for N yen (the currency of Japan) at a shop. If we use only 1000-yen bills to pay the price, how much change will we receive? Assume we use the minimum number of bills required. | N = int(input())
print(1000-N) | s573503658 | Accepted | 30 | 9,112 | 126 | N = int(input())
if 1 <= N <= 999:
print(1000-N)
elif int(str(N)[1:]) ==0:
print(0)
else:
print(1000-int(str(N)[1:])) |
s594169307 | p00189 | u811733736 | 1,000 | 131,072 | Wrong Answer | 20 | 7,716 | 1,293 | ๆฅๆฅๅๆฅญใใAใใใฏใๅฐฑ่ทใๆฉใซๅผ่ถใใใใใใจใซใใพใใใๅฐฑ่ทใใไผ็คพใฏใใชใใฃในใใใใคใใฎ็บใซใใฃใฆใๆฅใซใใฃใฆๅบๅคใใใชใใฃในใ้ใใพใใใใใงAใใใฏ,ใฉใใฎใชใใฃในใซ ่กใใซใๆ้ใฎ็ญใ็บใซไฝใใใจ่ใใพใใใ ใใใงใใชใใฏใAใใใๅฉใใใใใไฝใใฎใซไธ็ชไพฟๅฉใช็บใๆขใใใจใซใชใใพใใใ ็บใซใฏ 0 ใใๅงใพใ็ชๅทใๆฏใใใฆใใใ็บใจ็บใฎ้ใซใฏ้ใใใใพใใใใใใใฎ้ใซๅฏพใใฆ้ๅคๆ้ใๆฑบใพใฃใฆใใพใใAใใใใใ็บใซไฝใใงใใๅ ดๅใซใ่ชๅใฎ็บใฎใชใใฃในใพใงใฎ้ๅคๆ้ใฏ 0 ใจใใพใใใใฎใจใใซๅ
จใฆใฎ็บใพใงใฎ้ๅคๆ้ใฎ็ทๅใ่ใใพใใไพใใฐใ็บใจ้ใฎ้
็ฝฎใไธใฎๅณใฎใใใซใชใฃใฆใใฆใAใใใ็บ1ใซไฝใใ ๅ ดๅ... | # -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0189
AC
"""
import sys
from sys import stdin
input = stdin.readline
def warshallFloyd(V, dp):
for k in range(V):
for i in range(V):
for j in range(V):
dp_ik = dp[i][k]
dp_kj = d... | s165774323 | Accepted | 30 | 7,764 | 1,313 | # -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0189
AC
"""
import sys
from sys import stdin
input = stdin.readline
def warshallFloyd(V, dp):
for k in range(V):
for i in range(V):
for j in range(V):
dp_ik = dp[i][k]
dp_kj = d... |
s206454798 | p03486 | u165318982 | 2,000 | 262,144 | Wrong Answer | 27 | 9,108 | 146 | You are given strings s and t, consisting of lowercase English letters. You will create a string s' by freely rearranging the characters in s. You will also create a string t' by freely rearranging the characters in t. Determine whether it is possible to satisfy s' < t' for the lexicographic order. | a = list(input().split())
b = list(input().split())
a.sort()
b.sort(reverse=True)
if ''.join(a) < ''.join(b):
print('Yes')
else:
print('No') | s720861669 | Accepted | 25 | 8,964 | 130 | a = list(input())
b = list(input())
a.sort()
b.sort(reverse=True)
if ''.join(a) < ''.join(b):
print('Yes')
else:
print('No') |
s402073057 | p03543 | u371530330 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 133 | We call a 4-digit integer with three or more consecutive same digits, such as 1118, **good**. You are given a 4-digit integer N. Answer the question: Is N **good**? | n = list(input())
cnt = 0
for i in range(10):
cnt = n.count(i)
if cnt == 3 or cnt == 4:
print('Yes')
else:
print('No')
| s527088107 | Accepted | 17 | 2,940 | 95 | n = input()
if n[0] == n[1] == n[2] or n[1] == n[2] == n[3]:
print('Yes')
else:
print('No') |
s961702228 | p04012 | u872056745 | 2,000 | 262,144 | Wrong Answer | 23 | 3,316 | 253 | Let w be a string consisting of lowercase letters. We will call w _beautiful_ if the following condition is satisfied: * Each lowercase letter of the English alphabet occurs even number of times in w. You are given the string w. Determine if w is beautiful. | from collections import Counter
w = input()
char_counter = Counter()
for c in w:
char_counter[c] += 1
print(char_counter)
is_beautiful = "YES"
for c in char_counter.most_common():
if c[1] % 2 == 1:
is_beautiful = "NO"
print(is_beautiful) | s034706723 | Accepted | 20 | 3,316 | 235 | from collections import Counter
w = input()
char_counter = Counter()
for c in w:
char_counter[c] += 1
is_beautiful = "Yes"
for c in char_counter.most_common():
if c[1] % 2 == 1:
is_beautiful = "No"
print(is_beautiful) |
s865989967 | p03738 | u126823513 | 2,000 | 262,144 | Wrong Answer | 18 | 3,060 | 330 | You are given two positive integers A and B. Compare the magnitudes of these numbers. | str_a = input()
str_b = input()
int_len = len(str_a) if len(str_a) > len(str_b) else len(str_b)
for x, y in zip(str_a.zfill(int_len), str_b.zfill(int_len)):
if int(x) > int(y):
print("GREATHER")
exit(0)
elif int(x) < int(y):
print("LESS")
exit(0)
else:
pass
print(... | s333993481 | Accepted | 18 | 3,060 | 328 | str_a = input()
str_b = input()
int_len = len(str_a) if len(str_a) > len(str_b) else len(str_b)
for x, y in zip(str_a.zfill(int_len), str_b.zfill(int_len)):
if int(x) > int(y):
print("GREATER")
exit(0)
elif int(x) < int(y):
print("LESS")
exit(0)
else:
pass
print("... |
s636156263 | p03719 | u055687574 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 98 | You are given three integers A, B and C. Determine whether C is not less than A and not greater than B. | a, b, c = map(int, input().split())
if c >= a and c <= b:
print("YES")
else:
print("NO")
| s592469753 | Accepted | 17 | 2,940 | 98 | a, b, c = map(int, input().split())
if c >= a and c <= b:
print("Yes")
else:
print("No")
|
s777785779 | p02645 | u657208344 | 2,000 | 1,048,576 | Wrong Answer | 22 | 8,940 | 25 | When you asked some guy in your class his name, he called himself S, where S is a string of length between 3 and 20 (inclusive) consisting of lowercase English letters. You have decided to choose some three consecutive characters from S and make it his nickname. Print a string that is a valid nickname for him. | s = input()
print(s[0:2]) | s201174751 | Accepted | 23 | 9,080 | 26 | s = input()
print(s[0:3])
|
s485048182 | p03624 | u243572357 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 75 | You are given a string S consisting of lowercase English letters. Find the lexicographically (alphabetically) smallest lowercase English letter that does not occur in S. If every lowercase English letter occurs in S, print `None` instead. | print(chr(i) for i in range(ord('a'), ord('z')+1) if chr(i) not in input()) | s557401963 | Accepted | 18 | 3,188 | 121 | s = input()
for i in range(ord('a'), ord('z')+1):
if chr(i) not in s:
print(chr(i))
break
else:
print('None') |
s194202824 | p02612 | u244434589 | 2,000 | 1,048,576 | Wrong Answer | 27 | 8,844 | 87 | We will buy a product for N yen (the currency of Japan) at a shop. If we use only 1000-yen bills to pay the price, how much change will we receive? Assume we use the minimum number of bills required. | N=(input())
a = len(N)
if a >=3:
print('N[a-2]'+'N[a-1]'+'N[a]')
else:
print(N) | s413320194 | Accepted | 28 | 9,196 | 271 | N=int((input()))
if N%1000==0:
print(0)
else:
N=str(N)
a = len(N)
if a>=3:
x = int(N[a-3]+N[a-2]+N[a-1])
print(1000-x)
elif a==2:
x = int(N[a-2]+N[a-1])
print(1000-x)
else :
x = int(N[a-1])
print(1000-x) |
s162377505 | p03555 | u597455618 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 109 | You are given a grid with 2 rows and 3 columns of squares. The color of the square at the i-th row and j-th column is represented by the character C_{ij}. Write a program that prints `YES` if this grid remains the same when rotated 180 degrees, and prints `NO` otherwise. | s = input()
c = input()
if s[0] == c[0] and s[1] == c[1] and s[2] == c[2]:
print("YES")
else:
print("NO") | s059373490 | Accepted | 17 | 2,940 | 109 | s = input()
c = input()
if s[0] == c[2] and s[1] == c[1] and s[2] == c[0]:
print("YES")
else:
print("NO") |
s217373204 | p02263 | u117140447 | 1,000 | 131,072 | Wrong Answer | 20 | 5,592 | 696 | An expression is given in a line. Two consequtive symbols (operand or operator) are separated by a space character. You can assume that +, - and * are given as the operator and an operand is a positive integer less than 106 | import sys
str = ""
for line in sys.stdin:
str = line
numbers = str.split()
answer = 0
stackList = []
for number in numbers :
if number == '+' :
answer = int(stackList.pop()) + int(stackList.pop())
stackList.append(answer)
print('+')
print(answer)
elif number == '-' :
... | s801595939 | Accepted | 20 | 5,600 | 573 | import sys
str = ""
for line in sys.stdin:
str = line
numbers = str.split()
answer = 0
stackList = []
for number in numbers :
if number == '+' :
answer = int(stackList.pop()) + int(stackList.pop())
stackList.append(answer)
elif number == '-' :
x = int(stackList.pop())
y = in... |
s384203969 | p03545 | u583276018 | 2,000 | 262,144 | Wrong Answer | 30 | 9,248 | 850 | Sitting in a station waiting room, Joisino is gazing at her train ticket. The ticket is numbered with four digits A, B, C and D in this order, each between 0 and 9 (inclusive). In the formula A op1 B op2 C op3 D = 7, replace each of the symbols op1, op2 and op3 with `+` or `-` so that the formula holds. The given in... | e = input()
a = int(e[0:1])
b = int(e[1:2])
c = int(e[2:3])
d = int(e[3:4])
f, g = a+b, a-b
h, i, j, k = f+c, f-c, g+c, g-c
l, m, n, o, p, q, r, s = h + d, h - d, i + d, i - d, j + d, j - d, k + d, k - d
if(l == 7):
print(str(a) + " + " + str(b) + " + " + str(c) + " + " + str(d))
elif(m == 7):
print(str(a) + " + "... | s863865977 | Accepted | 31 | 9,316 | 859 | e = input()
a = int(e[0:1])
b = int(e[1:2])
c = int(e[2:3])
d = int(e[3:4])
f, g = a+b, a-b
h, i, j, k = f+c, f-c, g+c, g-c
l, m, n, o, p, q, r, s = h + d, h - d, i + d, i - d, j + d, j - d, k + d, k - d
if(l == 7):
print(str(a) + "+" + str(b) + "+" + str(c) + "+" + str(d) + "=7")
elif(m == 7):
print(str(a) + "+" ... |
s623908600 | p02261 | u238001675 | 1,000 | 131,072 | Wrong Answer | 20 | 5,608 | 1,162 | Let's arrange a deck of cards. There are totally 36 cards of 4 suits(S, H, C, D) and 9 values (1, 2, ... 9). For example, 'eight of heart' is represented by H8 and 'one of diamonds' is represented by D1. Your task is to write a program which sorts a given set of cards in ascending order by their values using the Bubbl... | #!/usr/bin/python3
# -*- coding: utf-8 -*-
import sys
def bubble_sort(A):
for i in range(len(A)):
for x in range(len(A)-1, i, -1):
if A[x][1] < A[x-1][1]:
A[x], A[x-1] = A[x-1], A[x]
def selection_sort(A):
for i in range(len(A)):
min_val = A[i][1]
for x in ... | s221881130 | Accepted | 20 | 5,616 | 1,162 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
import sys
def bubble_sort(A):
for i in range(len(A)):
for x in range(len(A)-1, i, -1):
if A[x][1] < A[x-1][1]:
A[x], A[x-1] = A[x-1], A[x]
def selection_sort(A):
for i in range(len(A)):
min_val = A[i][1]
for x in ... |
s634245331 | p02421 | u343251190 | 1,000 | 131,072 | Wrong Answer | 30 | 7,732 | 235 | Taro and Hanako are playing card games. They have n cards each, and they compete n turns. At each turn Taro and Hanako respectively puts out a card. The name of the animal consisting of alphabetical letters is written on each card, and the bigger one in lexicographical order becomes the winner of that turn. The winner ... | n = int(input())
score = [0, 0]
for i in range(n):
c = input().split()
if c[0] == c[1]:
score = list(map(lambda x: x+1, score))
elif c[0] > c[0]:
score[1] += 3
else:
score[0] += 3
print(*score) | s101234164 | Accepted | 20 | 7,700 | 231 | n = int(input())
score = [0, 0]
for i in range(n):
c = input().split()
if c[0] == c[1]:
score[0] += 1
score[1] += 1
elif c[0] < c[1]:
score[1] += 3
else:
score[0] += 3
print(*score) |
s517826693 | p03379 | u944209426 | 2,000 | 262,144 | Wrong Answer | 233 | 25,556 | 137 | When l is an odd number, the median of l numbers a_1, a_2, ..., a_l is the (\frac{l+1}{2})-th largest value among a_1, a_2, ..., a_l. You are given N numbers X_1, X_2, ..., X_N, where N is an even number. For each i = 1, 2, ..., N, let the median of X_1, X_2, ..., X_N excluding X_i, that is, the median of X_1, X_2, ..... | N = int(input())
X = list(map(int, input().split()))
for i in range(N//2):
print(X[N//2])
for i in range(N//2):
print(X[N//2-1]) | s777904823 | Accepted | 367 | 26,352 | 206 | N = int(input())
X = list(map(int, input().split()))
temp = sorted(X)
med = (temp[N//2]+temp[N//2-1])/2
for i in range(N):
if X[i] < med:
print(temp[N//2])
else:
print(temp[N//2-1])
|
s908457276 | p02612 | u975997984 | 2,000 | 1,048,576 | Wrong Answer | 30 | 9,016 | 34 | We will buy a product for N yen (the currency of Japan) at a shop. If we use only 1000-yen bills to pay the price, how much change will we receive? Assume we use the minimum number of bills required. | N = int(input())
print(N // 1000)
| s391550501 | Accepted | 31 | 9,140 | 49 | N = int(input())
print((1000 - N % 1000) % 1000)
|
s928443628 | p02417 | u886729200 | 1,000 | 131,072 | Wrong Answer | 40 | 6,684 | 161 | Write a program which counts and reports the number of each alphabetical letter. Ignore the case of characters. | import string as st
s = list(input())
for i in range(len(st.ascii_lowercase)):
print("{} : {}".format(st.ascii_lowercase[i],s.count(st.ascii_lowercase[i])))
| s223492342 | Accepted | 40 | 6,680 | 476 | import string as st
string=[]
try:
while True:
s = input()
string =list(string)
if not s :
break
string.extend(s)
string=map(str,string)
string="".join(string).lower()
except EOFError:
for i in range(len(st.ascii_lowercase)):
print("{} : {}".fo... |
s941781376 | p02612 | u914043696 | 2,000 | 1,048,576 | Wrong Answer | 24 | 9,112 | 34 | We will buy a product for N yen (the currency of Japan) at a shop. If we use only 1000-yen bills to pay the price, how much change will we receive? Assume we use the minimum number of bills required. | print(str(1000-int(input()))[-3:]) | s686142631 | Accepted | 30 | 9,080 | 73 | n = int(input())
if n%1000 == 0:
print(0)
else:
print(1000 - n%1000) |
s251193854 | p03863 | u785578220 | 2,000 | 262,144 | Wrong Answer | 17 | 3,316 | 70 | There is a string s of length 3 or greater. No two neighboring characters in s are equal. Takahashi and Aoki will play a game against each other. The two players alternately performs the following operation, Takahashi going first: * Remove one of the characters in s, excluding both ends. However, a character cannot... | a = input()
if a[0] == a[-1]:
print("First")
else:
print("Second") | s520217360 | Accepted | 18 | 3,316 | 223 | a = input()
if a[0] == a[-1] and len(a)%2==0:
print("First")
elif a[0] == a[-1] and len(a)%2==1:
print("Second")
elif a[0] != a[-1] and len(a)%2==0:
print("Second")
elif a[0] != a[-1] and len(a)%2==1:
print("First") |
s712716723 | p03377 | u156383602 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 83 | There are a total of A + B cats and dogs. Among them, A are known to be cats, but the remaining B are not known to be either cats or dogs. Determine if it is possible that there are exactly X cats among these A + B animals. | a,b,c=map(int,input().split())
c-=a
if b>=c:
print("Yes")
else:
print("No") | s202736998 | Accepted | 18 | 3,064 | 109 | a,b,c=map(int,input().split())
c-=a
if c<0:
print("NO")
elif b>=c:
print("YES")
else:
print("NO") |
s969543992 | p04011 | u612975321 | 2,000 | 262,144 | Wrong Answer | 30 | 9,108 | 95 | There is a hotel with the following accommodation fee: * X yen (the currency of Japan) per night, for the first K nights * Y yen per night, for the (K+1)-th and subsequent nights Tak is staying at this hotel for N consecutive nights. Find his total accommodation fee. | n = int(input())
k = int(input())
x = int(input())
y = int(input())
print(n*x + max(k-n, 0)*y) | s613250291 | Accepted | 29 | 8,948 | 104 | n = int(input())
k = int(input())
x = int(input())
y = int(input())
print(min(k, n)*x + max(n-k, 0)*y)
|
s997096449 | p04029 | u298297089 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 33 | There are N children in AtCoder Kindergarten. Mr. Evi will arrange the children in a line, then give 1 candy to the first child in the line, 2 candies to the second child, ..., N candies to the N-th child. How many candies will be necessary in total? | n = int(input())
print(n*(n+1)/2) | s937958675 | Accepted | 17 | 2,940 | 38 | n = int(input())
print(n * (n+1) //2 ) |
s970047086 | p03699 | u361381049 | 2,000 | 262,144 | Wrong Answer | 17 | 3,060 | 237 | You are taking a computer-based examination. The examination consists of N questions, and the score allocated to the i-th question is s_i. Your answer to each question will be judged as either "correct" or "incorrect", and your grade will be the sum of the points allocated to questions that are answered correctly. When... | n = int(input())
s = []
for i in range(n):
s.append(int(input()))
s.sort()
if sum(s) % 10 != 0:
print(sum(s))
else:
for i in range(n):
if s[i] % 10 != 0:
print(sum(s) - s[i])
break
print(0) | s056658962 | Accepted | 17 | 2,940 | 254 | n = int(input())
s = []
for i in range(n):
s.append(int(input()))
s.sort()
#print(sum(s))
if sum(s) % 10 != 0:
print(sum(s))
else:
for i in range(n):
if s[i] % 10 != 0:
print(sum(s) - s[i])
exit()
print(0)
|
s077005352 | p03360 | u330176731 | 2,000 | 262,144 | Wrong Answer | 17 | 3,060 | 187 | There are three positive integers A, B and C written on a blackboard. E869120 performs the following operation K times: * Choose one integer written on the blackboard and let the chosen integer be n. Replace the chosen integer with 2n. What is the largest possible sum of the integers written on the blackboard after... | a,b,c = map(int, input().split())
k = int(input())
for n in range(k):
if max(a,b,c)==a:
a*=k
if max(a,b,c)==b:
b*=k
if max(a,b,c)==c:
c*=k
print(a+b+c) | s829569454 | Accepted | 17 | 3,060 | 191 | a,b,c = map(int, input().split())
k = int(input())
for n in range(k):
if max(a,b,c)==a:
a*=2
elif max(a,b,c)==b:
b*=2
elif max(a,b,c)==c:
c*=2
print(a+b+c) |
s035630769 | p03737 | u393253137 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 67 | You are given three words s_1, s_2 and s_3, each composed of lowercase English letters, with spaces in between. Print the acronym formed from the uppercased initial letters of the words. | a,b,c=input().split()
print(a[0].upper(),b[0].upper(),c[0].upper()) | s238367057 | Accepted | 17 | 2,940 | 53 | a,b,c=input().split()
print((a[0]+b[0]+c[0]).upper()) |
s593761765 | p03386 | u328364772 | 2,000 | 262,144 | Wrong Answer | 2,104 | 3,060 | 109 | Print all the integers that satisfies the following in ascending order: * Among the integers between A and B (inclusive), it is either within the K smallest integers or within the K largest integers. | a, b, k = map(int, input().split())
for i in range(a, b+1):
if i <= a+k or b-k+1 <= i:
print(i)
| s081030386 | Accepted | 17 | 3,060 | 200 | a, b, k = map(int, input().split())
if a+k-1 < b-k+1:
for i in range(a, a+k):
print(i)
for j in range(b-k+1, b+1):
print(j)
else:
for i in range(a, b+1):
print(i)
|
s245887315 | p03470 | u855057563 | 2,000 | 262,144 | Wrong Answer | 28 | 9,160 | 66 | An _X -layered kagami mochi_ (X โฅ 1) is a pile of X round mochi (rice cake) stacked vertically where each mochi (except the bottom one) has a smaller diameter than that of the mochi directly below it. For example, if you stack three mochi with diameters of 10, 8 and 6 centimeters from bottom to top in this order, you h... | n=int(input())
d=list(map(int,input().split()))
print(len(set(d))) | s605743729 | Accepted | 32 | 9,076 | 69 | n=int(input())
d=[int(input()) for _ in range(n)]
print(len(set(d)))
|
s675955594 | p03502 | u434872492 | 2,000 | 262,144 | Wrong Answer | 17 | 3,060 | 131 | An integer X is called a Harshad number if X is divisible by f(X), where f(X) is the sum of the digits in X when written in base 10. Given an integer N, determine whether it is a Harshad number. | N = int(input())
s = str(N)
f = 0
for i in range(len(s)):
f += int(s[i])
if f % N == 0:
print("Yes")
else:
print("No") | s213970633 | Accepted | 17 | 3,060 | 129 | N = int(input())
s = str(N)
f = 0
for i in range(len(s)):
f += int(s[i])
if N%f == 0:
print("Yes")
else:
print("No") |
s468669301 | p03637 | u254871849 | 2,000 | 262,144 | Wrong Answer | 62 | 14,052 | 277 | We have a sequence of length N, a = (a_1, a_2, ..., a_N). Each a_i is a positive integer. Snuke's objective is to permute the element in a so that the following condition is satisfied: * For each 1 โค i โค N - 1, the product of a_i and a_{i + 1} is a multiple of 4. Determine whether Snuke can achieve his objective. | from sys import stdin
n, *a = map(int, stdin.read().split())
c2, c4 = 0, 0
for i in a:
if i % 2 == 0:
if i % 4 == 0:
c4 += 1
else:
c2 += 1
if c4 >= len(a) // 2: ans = "Yes"
elif (len(a) - c4 * 2) == c2: ans = "Yes"
else: ans = "No" | s858677670 | Accepted | 58 | 14,052 | 278 | import sys
n, *a = map(int, sys.stdin.read().split())
def main():
c4 = c2 = 0
for x in a:
if not x % 4: c4 += 1
elif not x % 2: c2 += 1
ans = 'Yes' if c4 >= n // 2 or c4 * 2 + c2 >= n else 'No'
print(ans)
if __name__ == '__main__':
main() |
s696340855 | p03469 | u932719058 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 70 | On some day in January 2018, Takaki is writing a document. The document has a column where the current date is written in `yyyy/mm/dd` format. For example, January 23, 2018 should be written as `2018/01/23`. After finishing the document, she noticed that she had mistakenly wrote `2017` at the beginning of the date col... | s = list(input().split('/'))
s[0] = '2018'
print(s)
print('/'.join(s)) | s503765115 | Accepted | 19 | 2,940 | 61 | s = list(input().split('/'))
s[0] = '2018'
print('/'.join(s)) |
s415197238 | p02612 | u589087860 | 2,000 | 1,048,576 | Wrong Answer | 29 | 9,084 | 33 | We will buy a product for N yen (the currency of Japan) at a shop. If we use only 1000-yen bills to pay the price, how much change will we receive? Assume we use the minimum number of bills required. | a = int(input())
print(a % 1000) | s288020500 | Accepted | 29 | 9,048 | 82 | a = int(input())
if a % 1000 == 0:
print(0)
else:
print(1000 - a % 1000) |
s832949597 | p03730 | u475675023 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 115 | We ask you to select some number of positive integers, and calculate the sum of them. It is allowed to select as many integers as you like, and as large integers as you wish. You have to follow these, however: each selected integer needs to be a multiple of A, and you need to select at least one integer. Your objecti... | a,b,c=map(int,input().split())
flag=False
for i in range(b):
if a*i%b==c:
flag=True
print(['No','Yes'][flag]) | s891155383 | Accepted | 17 | 2,940 | 115 | a,b,c=map(int,input().split())
flag=False
for i in range(b):
if a*i%b==c:
flag=True
print(['NO','YES'][flag]) |
s072046348 | p04012 | u019996510 | 2,000 | 262,144 | Wrong Answer | 18 | 2,940 | 177 | Let w be a string consisting of lowercase letters. We will call w _beautiful_ if the following condition is satisfied: * Each lowercase letter of the English alphabet occurs even number of times in w. You are given the string w. Determine if w is beautiful. | def main():
w = input()
judge = 0
for i in w:
if w.count(i) %2 ==0:
judge = "yes"
else:
judge = "No"
print(judge)
main()
| s043362635 | Accepted | 18 | 2,940 | 215 | def main():
w = input()
judge = ""
for i in w:
if w.count(i) %2 == 0:
judge = "Yes"
elif w.count(i) %2 != 0:
judge = "No"
break
print(judge)
main() |
s737474792 | p02396 | u587288800 | 1,000 | 131,072 | Wrong Answer | 20 | 5,640 | 51 | In the online judge system, a judge file may include multiple datasets to check whether the submitted program outputs a correct answer for each test case. This task is to practice solving a problem with multiple datasets. Write a program which reads an integer x and print it as is. Note that multiple datasets are give... | for i in range(0,1000):
print("Hello World")
| s566122032 | Accepted | 130 | 5,612 | 111 |
i = 1
while True:
x = int(input())
if(x == 0):
break
print(f'Case {i}: {x}')
i += 1
|
s914904728 | p02694 | u895040371 | 2,000 | 1,048,576 | Wrong Answer | 24 | 9,164 | 112 | Takahashi has a deposit of 100 yen (the currency of Japan) in AtCoder Bank. The bank pays an annual interest rate of 1 % compounded annually. (A fraction of less than one yen is discarded.) Assuming that nothing other than the interest affects Takahashi's balance, in how many years does the balance reach X yen or abo... | X = int(input())
year = 0
deposit = 100
if deposit < X:
deposit = deposit*101//100
year += 1
print(year) | s957824697 | Accepted | 22 | 9,108 | 115 | X = int(input())
year = 0
deposit = 100
while deposit < X:
deposit = deposit*101//100
year += 1
print(year) |
s319383152 | p03997 | u834983620 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 74 | You are given a trapezoid. The lengths of its upper base, lower base, and height are a, b, and h, respectively. An example of a trapezoid Find the area of this trapezoid. | a = int(input())
b = int(input())
c = int(input())
print((a + b) * c / 2) | s423992021 | Accepted | 17 | 2,940 | 98 | a = int(input())
b = int(input())
c = int(input())
answer = int(((a + b) * c) / 2)
print(answer) |
s490351589 | p03478 | u538956308 | 2,000 | 262,144 | Wrong Answer | 18 | 2,940 | 162 | Find the sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive). | N,A,B = map(int,input().split())
s = 0
ans = 0
for i in range(N):
while N<10:
s += N%10
N = N//10
if s >=A and s <=B:
ans+=i
print(ans)
| s950678046 | Accepted | 27 | 2,940 | 227 | N,A,B = map(int,input().split())
s = 0
ans = 0
for i in range(1,N+1):
s=0
n = i
while True:
s += n%10
n = n//10
if n ==0:
break
if s >=A and s <=B:
ans+=i
print(ans)
|
s256816995 | p03494 | u883820415 | 2,000 | 262,144 | Wrong Answer | 18 | 2,940 | 218 | There are N positive integers written on a blackboard: A_1, ..., A_N. Snuke can perform the following operation when all integers on the blackboard are even: * Replace each integer X on the blackboard by X divided by 2. Find the maximum possible number of operations that Snuke can perform. | a = [int(x) for x in input().split()]
count = 0
while True:
for i in range(len(a)):
if(a[i]%2 == 0):
a[i] = a[i]/2
else:
print(count)
exit()
count = count + 1 | s248612682 | Accepted | 19 | 3,060 | 226 | input()
a = [int(x) for x in input().split()]
count = 0
while True:
for i in range(len(a)):
if(a[i]%2 == 0):
a[i] = a[i]/2
else:
print(count)
exit()
count = count + 1 |
s331740119 | p02744 | u531436689 | 2,000 | 1,048,576 | Wrong Answer | 144 | 15,124 | 1,040 | In this problem, we only consider strings consisting of lowercase English letters. Strings s and t are said to be **isomorphic** when the following conditions are satisfied: * |s| = |t| holds. * For every pair i, j, one of the following holds: * s_i = s_j and t_i = t_j. * s_i \neq s_j and t_i \neq t_j. F... | import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque
sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7
DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(... | s977200319 | Accepted | 145 | 15,188 | 1,022 | import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque
sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7
DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(... |
s168660230 | p03485 | u089376182 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 49 | You are given two positive integers a and b. Let x be the average of a and b. Print x rounded up to the nearest integer. | print(-eval('-'+input().replace(' ', '+')+'//2')) | s325043752 | Accepted | 17 | 2,940 | 52 | a, b = map(int, input().split())
print(-(-(a+b)//2)) |
s290816387 | p03563 | u243159381 | 2,000 | 262,144 | Wrong Answer | 25 | 9,044 | 46 | Takahashi is a user of a site that hosts programming contests. When a user competes in a contest, the _rating_ of the user (not necessarily an integer) changes according to the _performance_ of the user, as follows: * Let the current rating of the user be a. * Suppose that the performance of the user in the cont... | r=float(input())
g=float(input())
print(g*2-r) | s495594017 | Accepted | 24 | 9,100 | 42 | r=int(input())
g=int(input())
print(g*2-r) |
s037176767 | p03351 | u771167374 | 2,000 | 1,048,576 | Wrong Answer | 17 | 2,940 | 138 | Three people, A, B and C, are trying to communicate using transceivers. They are standing along a number line, and the coordinates of A, B and C are a, b and c (in meters), respectively. Two people can directly communicate when the distance between them is at most d meters. Determine if A and C can communicate, either ... | a, b, c, d = map(int, input().split())
if abs(c-a)<=d:
print('Yes')
elif abs(b-a)+abs(c-b)<=d:
print('Yes')
else :
print('No') | s122042146 | Accepted | 17 | 3,060 | 145 | a, b, c, d = map(int, input().split())
if abs(c-a)<=d:
print('Yes')
elif abs(b-a)<=d and abs(c-b)<=d:
print('Yes')
else :
print('No') |
s064374166 | p03338 | u516272298 | 2,000 | 1,048,576 | Wrong Answer | 17 | 2,940 | 140 | You are given a string S of length N consisting of lowercase English letters. We will cut this string at one position into two strings X and Y. Here, we would like to maximize the number of different letters contained in both X and Y. Find the largest possible number of different letters contained in both X and Y when ... | n = int(input())
s = str(input())
l = []
for i in range(1,n):
a = set(s[:i])
b = set(s[i:])
l.append(len(a and b))
print(max(l)) | s976057151 | Accepted | 17 | 2,940 | 136 | n = int(input())
s = str(input())
l = []
for i in range(1,n):
a = set(s[:i])
b = set(s[i:])
l.append(len(a&b))
print(max(l)) |
s762836555 | p03636 | u124762318 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 55 | The word `internationalization` is sometimes abbreviated to `i18n`. This comes from the fact that there are 18 letters between the first `i` and the last `n`. You are given a string s of length at least 3 consisting of lowercase English letters. Abbreviate s in the same way. | ls = list(input())
print(ls[0] + str(len(ls)) + ls[-1]) | s704024920 | Accepted | 17 | 2,940 | 57 | ls = list(input())
print(ls[0] + str(len(ls)-2) + ls[-1]) |
s547620188 | p03474 | u050708958 | 2,000 | 262,144 | Wrong Answer | 19 | 3,316 | 143 | The postal code in Atcoder Kingdom is A+B+1 characters long, its (A+1)-th character is a hyphen `-`, and the other characters are digits from `0` through `9`. You are given a string S. Determine whether it follows the postal code format in Atcoder Kingdom. | a,b = map(int, input().split())
s = input()
if len(s) == a + b + 1 and s[a] == '-' and not '-' in s[a:]:
print('Yes')
else:
print('No') | s722367455 | Accepted | 17 | 3,060 | 262 | a,b = map(int, input().split())
s = input()
d = 0
for i in list(s):
if i == '-':
d += 1
try:
map(int, s.split('-'))
if len(s) == a + b + 1 and s[a] == '-' and d < 2:
print('Yes')
else:
print('No')
except:
print('No') |
s733322627 | p03024 | u125348436 | 2,000 | 1,048,576 | Wrong Answer | 17 | 2,940 | 146 | Takahashi is competing in a sumo tournament. The tournament lasts for 15 days, during which he performs in one match per day. If he wins 8 or more matches, he can also participate in the next tournament. The matches for the first k days have finished. You are given the results of Takahashi's matches as a string S cons... | match=list(input())
lmatch=len(match)
cmaru=match.count("โ")
print(cmaru)
cnt=15-lmatch+cmaru
if cnt>=8:
print("YES")
else:
print("NO") | s515903810 | Accepted | 19 | 3,060 | 169 | match=input()
match=list(match)
lmatch=len(match)
cmaru=match.count("o")
#print(cmaru)
cnt=15-lmatch+cmaru
#print(cnt)
if cnt>=8:
print("YES")
else:
print("NO") |
s790617050 | p04043 | u642528832 | 2,000 | 262,144 | Wrong Answer | 27 | 9,000 | 116 | Iroha loves _Haiku_. Haiku is a short form of Japanese poetry. A Haiku consists of three phrases with 5, 7 and 5 syllables, in this order. To create a Haiku, Iroha has come up with three different phrases. These phrases have A, B and C syllables, respectively. Determine whether she can construct a Haiku by using each ... | ABC = list(map(int,input().split()))
if ABC.count('5')==2 and ABC.count('7')==1:
print('YES')
else:
print('NO')
| s445155498 | Accepted | 27 | 9,076 | 117 | ABC = list(map(int,input().split()))
if ABC.count(5)==2 and ABC.count(7)==1:
print('YES')
else:
print('NO')
|
s928772821 | p02408 | u435917115 | 1,000 | 131,072 | Wrong Answer | 20 | 7,396 | 123 | Taro is going to play a card game. However, now he has only n cards, even though there should be 52 cards (he has no Jokers). The 52 cards include 13 ranks of each of the four suits: spade, heart, club and diamond. | data = [
"{0} {1}".format(s, r)
for s in ('S', 'H', 'C', 'D')
for r in range(1, 13 + 1)
]
print(data) | s268278693 | Accepted | 30 | 7,676 | 220 | data = [
"{0} {1}".format(s, r)
for s in ('S', 'H', 'C', 'D')
for r in range(1, 13 + 1)
]
count = int(input())
for c in range(count):
card = input()
data.remove(card)
for c in data:
print(c) |
s217697804 | p02601 | u071695942 | 2,000 | 1,048,576 | Wrong Answer | 29 | 9,116 | 318 | M-kun has the following three cards: * A red card with the integer A. * A green card with the integer B. * A blue card with the integer C. He is a genius magician who can do the following operation at most K times: * Choose one of the three cards and multiply the written integer by 2. His magic is successfu... | import sys
A,B,C=map(int,input().split())
K=int(input())
for i in range(4):
if( A < B and B < C):
print('Yes')
sys.exit()
else:
if(i >= 3):
print('No')
sys.exit()
else:
print(K,A,B,C,i)
if(A >= B):
B *= 2
elif(B >= C):
C *= 2
else:
pass
| s909474196 | Accepted | 33 | 9,152 | 317 | import sys
A,B,C=map(int,input().split())
K=int(input())
for i in range(K+1):
if( A < B and B < C):
print('Yes')
sys.exit()
else:
if(i >= K):
print('No')
sys.exit()
else:
if(A >= B):
B *= 2
elif(B >= C):
C *= 2
else:
pass
|
s386996276 | p03605 | u586577600 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 92 | It is September 9 in Japan now. You are given a two-digit integer N. Answer the question: Is 9 contained in the decimal notation of N? | n = input()
for c in n:
if c == '9':
print('Yes')
else:
print('No')
| s740541421 | Accepted | 17 | 2,940 | 107 | n = input()
import sys
for c in n:
if c == '9':
print('Yes')
sys.exit(0)
print('No')
|
s910688726 | p03693 | u165268875 | 2,000 | 262,144 | Wrong Answer | 18 | 2,940 | 77 | AtCoDeer has three cards, one red, one green and one blue. An integer between 1 and 9 (inclusive) is written on each card: r on the red card, g on the green card and b on the blue card. We will arrange the cards in the order red, green and blue from left to right, and read them as a three-digit integer. Is this i... | r, g, b = map(int, input().split())
print("Yes" if r*g*b % 4 == 0 else "No")
| s958243465 | Accepted | 17 | 2,940 | 94 |
r, g, b = input().split()
A = "{}{}{}".format(r,g,b)
print("YES" if int(A)%4 == 0 else "NO")
|
s414526057 | p03494 | u308588791 | 2,000 | 262,144 | Wrong Answer | 17 | 3,060 | 316 | There are N positive integers written on a blackboard: A_1, ..., A_N. Snuke can perform the following operation when all integers on the blackboard are even: * Replace each integer X on the blackboard by X divided by 2. Find the maximum possible number of operations that Snuke can perform. | number = int(input())
num_list = list(map(int, input().split()))
count = 0
for i in num_list:
if i % 2 == 0:
count += 1
# print(count)
else:
print(0)
break
count_s = 0
if count == number:
num_min = min(num_list)
while num_min > 1:
num_min = num_min / 2
count_s += 1
print(count_s) | s735500960 | Accepted | 17 | 3,060 | 164 | import math
n = input()
a = list(map(int, input().split()))
ans = float("inf")
for i in a:
ans = min(ans, len(bin(i)) - bin(i).rfind("1") - 1)
print(round(ans)) |
s124558572 | p02744 | u612982371 | 2,000 | 1,048,576 | Wrong Answer | 457 | 23,516 | 280 | In this problem, we only consider strings consisting of lowercase English letters. Strings s and t are said to be **isomorphic** when the following conditions are satisfied: * |s| = |t| holds. * For every pair i, j, one of the following holds: * s_i = s_j and t_i = t_j. * s_i \neq s_j and t_i \neq t_j. F... | length = int(input())
nums = []
def f(level,already):
if level >= length:
nums.append(already)
return
else:
for i in range(0, max(already) + 2):
f(level + 1, already + [i])
f(1,[0])
for n in nums:
print("".join(list(map(str, n)))) | s554362370 | Accepted | 537 | 23,508 | 335 | length = int(input())
nums = []
def num_to_abc(n):
return chr(ord("a") + n)
def f(level,already):
if level >= length:
nums.append(already)
return
else:
for i in range(0, max(already) + 2):
f(level + 1, already + [i])
f(1,[0])
for n in nums:
print("".join(list(map(nu... |
s971641491 | p03854 | u198336369 | 2,000 | 262,144 | Wrong Answer | 33 | 9,592 | 490 | You are given a string S consisting of lowercase English letters. Another string T is initially empty. Determine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times: * Append one of the following at the end of T: `dream`, `dreamer`, `erase` and `eraser`. | s = str(input())
r = ''.join(list(reversed(s)))
flag = [0,0,0,0]
t = ['maerd', 'remaerd', 'esare', 'resare']
while len(r) >= 0:
if r[0:5] == t[0]:
r = r[5:]
flag[0] +=1
elif r[0:6] == t[1]:
r = r[6:]
flag[1] +=1
elif r[0:5] == t[2]:
r = r[5:]
flag[2] +=1
e... | s779895596 | Accepted | 65 | 9,584 | 492 | s = str(input())
r = ''.join(list(reversed(s)))
flag = [0,0,0,0]
t = ['maerd', 'remaerd', 'esare', 'resare']
while len(r) >= 0:
if r[0:5] == t[0]:
r = r[5:]
flag[0] +=1
elif r[0:7] == t[1]:
r = r[7:]
flag[1] +=1
elif r[0:5] == t[2]:
r = r[5:]
flag[2] +=1
e... |
s748747150 | p03068 | u065025264 | 2,000 | 1,048,576 | Wrong Answer | 17 | 2,940 | 172 | You are given a string S of length N consisting of lowercase English letters, and an integer K. Print the string obtained by replacing every character in S that differs from the K-th character of S, with `*`. | N = input()
S = input()
K = int(input())
target = S[K-1]
result = "*"
for i in S:
if target == i:
result += i
else:
result += '*'
print(result)
| s250197040 | Accepted | 17 | 2,940 | 171 | N = input()
S = input()
K = int(input())
target = S[K-1]
result = ""
for i in S:
if target == i:
result += i
else:
result += '*'
print(result)
|
s977008676 | p03387 | u032484849 | 2,000 | 262,144 | Wrong Answer | 17 | 3,064 | 195 | You are given three integers A, B and C. Find the minimum number of operations required to make A, B and C all equal by repeatedly performing the following two kinds of operations in any order: * Choose two among A, B and C, then increase both by 1. * Choose one among A, B and C, then increase it by 2. It can be ... | a,b,c=map(int,input().split())
A=[a,b,c]
A.sort()
print(A)
k=A[0]+(A[2]-A[1])
print(A[2]-A[1])
print(k)
if (A[2]-k)%2==0:
print(A[2]-A[1]+(A[2]-k)//2)
else:
print(A[2]-A[1]+(A[2]-k)//2+2) | s023254876 | Accepted | 17 | 3,060 | 160 | a,b,c=map(int,input().split())
A=[a,b,c]
A.sort()
k=A[0]+(A[2]-A[1])
if (A[2]-k)%2==0:
print(A[2]-A[1]+(A[2]-k)//2)
else:
print(A[2]-A[1]+(A[2]-k)//2+2) |
s241487298 | p03377 | u264681142 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 86 | There are a total of A + B cats and dogs. Among them, A are known to be cats, but the remaining B are not known to be either cats or dogs. Determine if it is possible that there are exactly X cats among these A + B animals. | A, B, X = map(int, input().split())
if B >= X - A:
print('Yes')
else:
print('No') | s688789611 | Accepted | 17 | 2,940 | 97 | a, b, x = map(int, input().split())
if a <= x and x - a <= b:
print('YES')
else:
print('NO') |
s754187817 | p03455 | u595600198 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 77 | AtCoDeer the deer found two positive integers, a and b. Determine whether the product of a and b is even or odd. | a,b = map(int,input().split())
if a*b%2:
print("Even")
else:
print("Odd") | s769372786 | Accepted | 17 | 2,940 | 77 | a,b = map(int,input().split())
if a*b%2:
print("Odd")
else:
print("Even") |
s610551049 | p02393 | u123669391 | 1,000 | 131,072 | Wrong Answer | 20 | 5,576 | 54 | Write a program which reads three integers, and prints them in ascending order. | x = list(map(int, input().split()))
print(sorted(x))
| s170619872 | Accepted | 20 | 5,588 | 70 | x = list(map(int, input().split()))
x.sort()
print(x[0], x[1], x[2])
|
s408981205 | p03471 | u626337957 | 2,000 | 262,144 | Wrong Answer | 1,274 | 3,572 | 252 | The commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word "bill" refers to only these. According to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for a total of Y yen, but he may be lying. Determine whether such a situat... | N, Y = map(int, input().split())
for i in range(0, N+1)[::-1]:
for j in range(0, N-i+1)[::-1]:
k = N - i - j
if 10000*i + 5000*j + 1000*k == Y:
print(i, j, k)
elif 10000*i + 5000*j + 1000*k < Y:
print(-1, -1, -1)
break
| s093375524 | Accepted | 806 | 3,064 | 208 | N, Y = map(int, input().split())
for i in range(0, N+1)[::-1]:
for j in range(0, N-i+1)[::-1]:
k = N - i - j
if 10000*i + 5000*j + 1000*k == Y:
print(i, j, k)
exit()
print(-1, -1, -1)
|
s336447586 | p02613 | u468597111 | 2,000 | 1,048,576 | Wrong Answer | 156 | 9,508 | 265 | Takahashi is participating in a programming contest called AXC002, and he has just submitted his code to Problem A. The problem has N test cases. For each test case i (1\leq i \leq N), you are given a string S_i representing the verdict for that test case. Find the numbers of test cases for which the verdict is `AC`,... | from collections import defaultdict
n=int(input())
dic=defaultdict(int)
for i in range(n):
x=input()
if x in dic:
dic[x]+=1
else:
dic[x]=1
print("AC X",dic["AC"])
print("WA X",dic["WA"])
print("TLE X",dic["TLE"])
print("RE X",dic["RE"])
| s987641871 | Accepted | 152 | 9,420 | 265 | from collections import defaultdict
n=int(input())
dic=defaultdict(int)
for i in range(n):
x=input()
if x in dic:
dic[x]+=1
else:
dic[x]=1
print("AC x",dic["AC"])
print("WA x",dic["WA"])
print("TLE x",dic["TLE"])
print("RE x",dic["RE"])
|
s064484237 | p02972 | u675757825 | 2,000 | 1,048,576 | Wrong Answer | 731 | 8,144 | 302 | There are N empty boxes arranged in a row from left to right. The integer i is written on the i-th box from the left (1 \leq i \leq N). For each of these boxes, Snuke can choose either to put a ball in it or to put nothing in it. We say a set of choices to put a ball or not in the boxes is good when the following con... | n = int(input())
a = [int(i) for i in input().split()]
l = [0] * n
cnt = 0
for i in range(1, n + 1)[::-1]:
s = sum([l[(j + 2) * i - 1] for j in range(n // i - 1)])
l[i - 1] = (s + a[i - 1]) % 2
cnt += l[i - 1]
print(cnt)
for i, k in enumerate(l):
if k != 0:
print(k, end=" ")
| s623879040 | Accepted | 848 | 8,784 | 430 | n = int(input())
a = [int(i) for i in input().split()]
l = [0] * n
cnt = 0
for i in range(1, n + 1)[::-1]:
s = sum([l[(j + 2) * i - 1] for j in range(n // i - 1)])
l[i - 1] = (s + a[i - 1]) % 2
cnt += l[i - 1]
print(cnt)
ju = 0
for i, k in enumerate(l):
if k != 0:
if (ju == 1):
pri... |
s623896082 | p02399 | u725391514 | 1,000 | 131,072 | Wrong Answer | 20 | 7,684 | 85 | Write a program which reads two integers a and b, and calculates the following values: * a รท b: d (in integer) * remainder of a รท b: r (in integer) * a รท b: f (in real number) | a, b=map(int, input().split())
x=a/b
y=a%b
z=a//b
print(str(z)+" "+str(y)+" "+str(x)) | s160496833 | Accepted | 30 | 7,688 | 81 | a, b=map(int, input().split())
x=a/b
y=a%b
z=a//b
print('%s %s %.5f' % (z, y, x)) |
s914908207 | p02972 | u528470578 | 2,000 | 1,048,576 | Wrong Answer | 208 | 16,036 | 400 | There are N empty boxes arranged in a row from left to right. The integer i is written on the i-th box from the left (1 \leq i \leq N). For each of these boxes, Snuke can choose either to put a ball in it or to put nothing in it. We say a set of choices to put a ball or not in the boxes is good when the following con... | N = int(input())
a = list(map(int, input().split()))
box = [0 for _ in range(N)]
for i in reversed(range(N)):
if a[i] == 1:
box[i] = 1
for i in range(1, N):
temp = sum(box[i:i])
if temp % 2 == a[i]:
continue
else:
print(-1)
exit()
print(sum(box))
for n, i in enumerate... | s800137224 | Accepted | 556 | 26,936 | 434 | import sys
N = int(sys.stdin.readline())
A = list(map(int, sys.stdin.readline().split()))
B = [-1 for _ in range(N)]
ans = []
for i in range(N, 0, -1):
tmp_sum = 0
tmp_i = 2 * i
while N >= tmp_i:
tmp_sum += B[tmp_i - 1]
tmp_i += i
if A[i-1] == tmp_sum % 2:
B[i-1] = 0
else... |
s684390285 | p02255 | u930806831 | 1,000 | 131,072 | Wrong Answer | 20 | 7,660 | 517 | Write a program of the Insertion Sort algorithm which sorts a sequence A in ascending order. The algorithm should be based on the following pseudocode: for i = 1 to A.length-1 key = A[i] /* insert A[i] into the sorted sequence A[0,...,j-1] */ j = i - 1 while j >= 0 and A[j] > key ... | n = int(input())
input_list = [int(x) for x in input().split()]
def sort_print(n, input_list):
for i in range(n):
index = i
num = input_list[index]
while index-1 >=0 and input_list[index-1] > num:
input_list[index] = input_list[index-1]
index -= 1
... | s269459275 | Accepted | 30 | 7,696 | 569 | n = int(input())
input_list = [int(x) for x in input().split()]
def sort_print(n, input_list):
for i in range(n):
index = i
num = input_list[index]
while index-1 >=0 and input_list[index-1] > num:
input_list[index] = input_list[index-1]
index -= 1
... |
s093450659 | p03130 | u089142196 | 2,000 | 1,048,576 | Wrong Answer | 17 | 3,064 | 191 | There are four towns, numbered 1,2,3 and 4. Also, there are three roads. The i-th road connects different towns a_i and b_i bidirectionally. No two roads connect the same pair of towns. Other than these roads, there is no way to travel between these towns, but any town can be reached from any other town using these roa... | a=[0]*3
b=[0]*3
a[0],b[0]=map(int,input().split())
a[1],b[1]=map(int,input().split())
a[2],b[2]=map(int,input().split())
c=a+b
if min(c)==1 and max(c)==2:
print("YES")
else:
print("NO") | s301565207 | Accepted | 17 | 3,064 | 331 | a=[0]*3
b=[0]*3
a[0],b[0]=map(int,input().split())
a[1],b[1]=map(int,input().split())
a[2],b[2]=map(int,input().split())
d=dict()
c=a+b
for i in c:
if i not in d:
d[i]=1
else:
d[i]+=1
mini=100
maxi=0
for j in d:
mini=min(mini,d[j])
maxi=max(maxi,d[j])
if mini==1 and maxi==2:
print("YES")
else:
... |
s451450022 | p03623 | u117348081 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 91 | Snuke lives at position x on a number line. On this line, there are two stores A and B, respectively at position a and b, that offer food for delivery. Snuke decided to get food delivery from the closer of stores A and B. Find out which store is closer to Snuke's residence. Here, the distance between two points s and... | x,a,b = map(int, input().split())
if abs(x-a)>abs(x-b):
print("A")
else:
print("B") | s820587304 | Accepted | 17 | 2,940 | 91 | x,a,b = map(int, input().split())
if abs(x-a)<abs(x-b):
print("A")
else:
print("B") |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.