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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
s941325843 | p03455 | u409254176 | 2,000 | 262,144 | Wrong Answer | 18 | 2,940 | 30 | 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()) | s624571190 | Accepted | 27 | 9,156 | 77 | a,b=map(int,input().split())
if a*b %2==0:
print("Even")
else:
print("Odd") |
s084784060 | p02402 | u227984374 | 1,000 | 131,072 | Wrong Answer | 20 | 5,580 | 82 | Write a program which reads a sequence of $n$ integers $a_i (i = 1, 2, ... n)$, and prints the minimum value, maximum value and sum of the sequence. | n = int(input())
A = list(map(int,input().split()))
print(max(A), min(A), sum(A))
| s638652854 | Accepted | 20 | 6,580 | 82 | n = int(input())
A = list(map(int,input().split()))
print(min(A), max(A), sum(A))
|
s683046950 | p03836 | u619458041 | 2,000 | 262,144 | Wrong Answer | 17 | 3,060 | 411 | Dolphin resides in two-dimensional Cartesian plane, with the positive x-axis pointing right and the positive y-axis pointing up. Currently, he is located at the point (sx,sy). In each second, he can move up, down, left or right by a distance of 1. Here, both the x\- and y-coordinates before and after each movement ... | import sys
def main():
input = sys.stdin.readline
X = list(map(int, input().split()))
diffx = X[2] - X[0]
diffy = X[3] - X[1]
f1 = 'U' * diffy + 'R' * diffx
b1 = 'D' * diffy + 'L' * diffx
f2 = 'L' + 'U' * (diffy + 1) + 'R' * (diffx + 1) + 'D'
b2 = 'R' + 'D' * (diffy + 1) + 'L' * (dif... | s544929622 | Accepted | 17 | 3,064 | 411 | import sys
def main():
input = sys.stdin.readline
X = list(map(int, input().split()))
diffx = X[2] - X[0]
diffy = X[3] - X[1]
f1 = 'U' * diffy + 'R' * diffx
b1 = 'D' * diffy + 'L' * diffx
f2 = 'L' + 'U' * (diffy + 1) + 'R' * (diffx + 1) + 'D'
b2 = 'R' + 'D' * (diffy + 1) + 'L' * (dif... |
s019037973 | p03861 | u265506056 | 2,000 | 262,144 | Wrong Answer | 31 | 9,048 | 83 | You are given nonnegative integers a and b (a ≤ b), and a positive integer x. Among the integers between a and b, inclusive, how many are divisible by x? | a,b,x=map(int,input().split())
A=a//x
B=b//x
ans=B-A
if a==0:
ans+=1
print(ans) | s752828033 | Accepted | 27 | 9,056 | 85 | a,b,x=map(int,input().split())
A=a//x
B=b//x
ans=B-A
if a%x==0:
ans+=1
print(ans) |
s166771302 | p04043 | u816265237 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 121 | 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 ... | ln = sorted(list(map(int, input().split())))
if ln[0] == ln[1] ==5 and ln[2] ==7:
print('Yes')
else:
print('No')
| s628783639 | Accepted | 18 | 2,940 | 121 | ln = sorted(list(map(int, input().split())))
if ln[0] == ln[1] ==5 and ln[2] ==7:
print('YES')
else:
print('NO')
|
s169190380 | p02389 | u389610071 | 1,000 | 131,072 | Wrong Answer | 20 | 7,512 | 70 | Write a program which calculates the area and perimeter of a given rectangle. | nums = input().split()
a = int(nums[0])
b = int(nums[1])
print(a * b) | s400296287 | Accepted | 20 | 7,704 | 85 | nums = input().split()
a = int(nums[0])
b = int(nums[1])
print(a * b, 2 * a + 2 * b) |
s759089488 | p03711 | u118147328 | 2,000 | 262,144 | Wrong Answer | 17 | 3,060 | 196 | Based on some criterion, Snuke divided the integers from 1 through 12 into three groups as shown in the figure below. Given two integers x and y (1 ≤ x < y ≤ 12), determine whether they belong to the same group. | x,y = map(int, input().split())
risuto1 = [1,3,5,7,8,10,12]
risuto2 = [4,6,9,11]
risuto3 = [2]
if x & y in risuto1:
print("yes")
elif x & y in risuto2:
print("yes")
else:
print("no") | s613399385 | Accepted | 17 | 3,064 | 222 | x,y = map(int, input().split())
risuto1 = [1,3,5,7,8,10,12]
risuto2 = [4,6,9,11]
risuto3 = [2]
if x in risuto1 and y in risuto1:
print("Yes")
elif x in risuto2 and y in risuto2:
print("Yes")
else:
print("No") |
s495506017 | p03160 | u698919163 | 2,000 | 1,048,576 | Wrong Answer | 140 | 13,980 | 333 | There are N stones, numbered 1, 2, \ldots, N. For each i (1 \leq i \leq N), the height of Stone i is h_i. There is a frog who is initially on Stone 1. He will repeat the following action some number of times to reach Stone N: * If the frog is currently on Stone i, jump to Stone i + 1 or Stone i + 2. Here, a cost of... | n = int(input())
h = list(map(int,input().split()))
cost1 = 0
cost2 = 0
cost = [0]
cost.append(abs(h[0]-h[1]))
print(cost)
for flog in range(2,len(h)):
cost1 = cost[flog-2] + abs(h[flog] - h[flog-2])
cost2 = cost[flog-1] + abs(h[flog] - h[flog-1])
cost.append(min(cost1,cost2))
#print(cost)
pr... | s016381032 | Accepted | 131 | 13,928 | 280 | N = int(input())
h = list(map(int,input().split()))
dp = [0]*N
dp[1] = abs(h[1]-h[0])
for i in range(2,N):
dp[i] = min(dp[i-1]+abs(h[i]-h[i-1]),dp[i-2]+abs(h[i]-h[i-2]))
print(dp[-1]) |
s193559912 | p00001 | u741801763 | 1,000 | 131,072 | Wrong Answer | 20 | 7,628 | 223 | There is a data which provides heights (in meter) of mountains. The data is only for ten mountains. Write a program which prints heights of the top three mountains in descending order. | if __name__=="__main__":
dataset = []
for i in range(10):
a = int(input())
dataset.append(a)
print(dataset)
for j in range(3):
print(max(dataset))
dataset.remove(max(dataset)) | s287354820 | Accepted | 20 | 7,760 | 204 | if __name__=="__main__":
dataset = []
for i in range(10):
a = int(input())
dataset.append(a)
for j in range(3):
print(max(dataset))
dataset.remove(max(dataset)) |
s266589839 | p03861 | u620157187 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 129 | You are given nonnegative integers a and b (a ≤ b), and a positive integer x. Among the integers between a and b, inclusive, how many are divisible by x? | a, b, x = map(int, input().split())
max_i = b//x
if a%x == 0:
min_i = a//x
else:
min_i = a//x+1
print(max_i-min_i) | s212201650 | Accepted | 17 | 2,940 | 131 | a, b, x = map(int, input().split())
max_i = b//x
if a%x == 0:
min_i = a//x
else:
min_i = a//x+1
print(max_i-min_i+1) |
s916863260 | p03139 | u969190727 | 2,000 | 1,048,576 | Wrong Answer | 17 | 2,940 | 61 | We conducted a survey on newspaper subscriptions. More specifically, we asked each of the N respondents the following two questions: * Question 1: Are you subscribing to Newspaper X? * Question 2: Are you subscribing to Newspaper Y? As the result, A respondents answered "yes" to Question 1, and B respondents answ... | n,a,b=map(int,input().split())
if a>b:
a,b=b,a
print(b,n-a) | s455844118 | Accepted | 17 | 2,940 | 61 | n,a,b=map(int,input().split())
print(min(a,b),max(0,(a+b)-n)) |
s814732220 | p03130 | u167908302 | 2,000 | 1,048,576 | Wrong Answer | 18 | 2,940 | 198 | 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... | #coding:utf-8
ans = [0] * 4
for i in range(3):
a, b = map(int, input().split())
ans[a-1] += 1
ans[b-1] += 1
for i in range(4):
if ans[i] >= 3:
print("No")
exit()
print("Yes")
| s132888375 | Accepted | 17 | 2,940 | 189 | #coding:utf-8
ans = [0] * 4
for i in range(3):
a, b = map(int, input().split())
ans[a-1] += 1
ans[b-1] += 1
for i in ans:
if i >= 3:
print("NO")
exit()
print("YES")
|
s678734094 | p03549 | u829249049 | 2,000 | 262,144 | Wrong Answer | 167 | 24,172 | 252 | Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of th... | N,M=map(int,input().split())
p=(1/2)**M
listP=[p]
listP+=[0]*(10**6)
sumP=[0]*(10**6)
sumP[0]=p
ans=0
time=1900*M+100*(N-M)
for i in range(10**5):
ans+=time*listP[i]*(i+1)
sumP[i+1]=sumP[i]+p*(1-sumP[i])
listP[i+1]=p*(1-sumP[i])
print(int(ans)) | s072294848 | Accepted | 17 | 2,940 | 75 | N,M=map(int,input().split())
time=1900*M+100*(N-M)
ans=time*2**M
print(ans) |
s708587049 | p02578 | u551967750 | 2,000 | 1,048,576 | Wrong Answer | 154 | 31,988 | 187 | 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 = input()
l = [int(i) for i in input().split()]
max = 0
sum = 0
print(l)
for i in range(1,len(l)):
if l[i-1] > max:
max = l[i-1]
if l[i] < max:
sum += max - l[i]
print(sum) | s124391673 | Accepted | 138 | 32,156 | 178 | n = input()
l = [int(i) for i in input().split()]
max = 0
sum = 0
for i in range(1,len(l)):
if l[i-1] > max:
max = l[i-1]
if l[i] < max:
sum += max - l[i]
print(sum) |
s267794873 | p03338 | u598009172 | 2,000 | 1,048,576 | Wrong Answer | 18 | 2,940 | 167 | 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())
ans=0
for i in range(N):
X = S[:i]
Y = S[i+1:]
Z = set(X) & set(Y)
if len(Z) > ans :
ans = len(Z)
print(ans)
| s606665488 | Accepted | 18 | 3,060 | 168 | N = int(input())
S = str(input())
ans=0
for i in range(1,N-1):
X = S[:i]
Y = S[i:]
Z = set(X) & set(Y)
if len(Z) > ans :
ans = len(Z)
print(ans) |
s282161260 | p03095 | u802772880 | 2,000 | 1,048,576 | Wrong Answer | 22 | 3,572 | 104 | You are given a string S of length N. Among its subsequences, count the ones such that all characters are different, modulo 10^9+7. Two subsequences are considered different if their characters come from different positions in the string, even if they are the same as strings. Here, a subsequence of a string is a conca... | n=int(input())
s=input()
m=list(set(s))
ans=1
for i in m:
ans*=s.count(i)-1
print((ans-1)%(10**9+7)) | s241278190 | Accepted | 22 | 3,444 | 104 | n=int(input())
s=input()
m=list(set(s))
ans=1
for i in m:
ans*=s.count(i)+1
print((ans-1)%(10**9+7)) |
s469561909 | p04029 | u055687574 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 37 | 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(sum(range(n))) | s489307804 | Accepted | 17 | 2,940 | 40 | n = int(input())
print(sum(range(n+1)))
|
s618309458 | p03502 | u363407238 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 142 | 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 = input()
digits_sum = sum(map(int, n.split()))
print(n)
print(digits_sum)
if int(n) == digits_sum:
print('YES')
else:
print('NO')
| s425527366 | Accepted | 17 | 2,940 | 113 | n = input()
digit_sum = sum(map(int, list(n)))
if int(n) % digit_sum == 0:
print('Yes')
else:
print('No') |
s200552925 | p03139 | u163320134 | 2,000 | 1,048,576 | Wrong Answer | 18 | 2,940 | 109 | We conducted a survey on newspaper subscriptions. More specifically, we asked each of the N respondents the following two questions: * Question 1: Are you subscribing to Newspaper X? * Question 2: Are you subscribing to Newspaper Y? As the result, A respondents answered "yes" to Question 1, and B respondents answ... | n,x,y=map(int,input().split())
if (x+y)>n:
mn=(x+y)-n
else:
mn=0
mx=max(x,y)
print('{} {}'.format(mx,mn)) | s134708215 | Accepted | 17 | 3,060 | 109 | n,x,y=map(int,input().split())
if (x+y)>n:
mn=(x+y)-n
else:
mn=0
mx=min(x,y)
print('{} {}'.format(mx,mn)) |
s111908327 | p03729 | u280512618 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 83 | You are given three strings A, B and C. Check whether they form a _word chain_. More formally, determine whether both of the following are true: * The last character in A and the initial character in B are the same. * The last character in B and the initial character in C are the same. If both are true, print `Y... | s=input().split()
print("YES" if s[0][-1]==s[0][0] and s[1][-1]==s[2][0] else 'NO') | s784802787 | Accepted | 17 | 2,940 | 84 | s=input().split()
print("YES" if s[0][-1]==s[1][0] and s[1][-1]==s[2][0] else 'NO')
|
s033458628 | p03861 | u427344224 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 151 | You are given nonnegative integers a and b (a ≤ b), and a positive integer x. Among the integers between a and b, inclusive, how many are divisible by x? | a, b, x = map(int, input().split())
def cal(n, x):
if a == 0:
return 0
else:
return n / x + 1
print(str(cal(b, x) - cal(a, x))) | s935240840 | Accepted | 17 | 2,940 | 77 | a, b, x = map(int, input().split())
A = (a - 1) // x
B = b // x
print(B - A)
|
s862840145 | p01713 | u352394527 | 2,000 | 131,072 | Wrong Answer | 20 | 5,532 | 775 | 日本では防災研究が盛んに行われており,近年その重要性がますます増している. 避難経路の評価も重要な研究のひとつである. 今回は直線状の通路の安全評価を行う. 通路は W 個のユニットに分けられており,一方の端のユニットからもう一方の端のユニットまで 0, 1, 2, … , W-1 の番号がつけられている. 通路内の各ユニットには,入口の扉,出口の扉,防火扉のいずれか1つが存在する. 入り口の扉,出口の扉,防火扉はそれぞれ通路内に複数個存在しうる. この問題では時刻 t=0 で火災が発生したと想定する. それにより,通路の外部にいて避難しようとしている人々が入口の扉を通じて通路へ入り,より安全な場所へ出るために出口の扉へ... | def search_left(ind):
doors = []
for j in range(ind - 1, -1, -1):
if alst[j] < 0:
doors.append((j, -alst[j]))
if alst[j] == 0:
ret = alst[ind]
for pos, lim in doors:
ret = min(ret, lim - (ind - pos))
ret = max(0, ret)
return ret
return 0
def search_right(ind):
doors... | s314936449 | Accepted | 320 | 20,404 | 513 | w = int(input())
alst = list(map(int, input().split()))
INF = 10 ** 20
acc = -INF
left = []
for i in range(w):
a = alst[i]
if a == 0:
acc = INF
elif a > 0:
acc -= 1
elif a < 0:
acc = min(acc - 1, -a)
left.append(acc)
acc = -INF
right = []
for i in range(w):
a = alst[w - i - 1]
if a == 0:
... |
s890583725 | p03636 | u241234955 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 97 | 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. | s = input()
s_mid_len = len(s) - 2
print(s_mid_len)
T = s[0] + str(s_mid_len) + s[-1]
print(T)
| s281713006 | Accepted | 17 | 2,940 | 106 | s = input()
s_mid_len = len(s) - 2
T = s[0] + str(s_mid_len) + s[-1]
print(T)
|
s081148284 | p03151 | u825027400 | 2,000 | 1,048,576 | Wrong Answer | 124 | 18,292 | 554 | A university student, Takahashi, has to take N examinations and pass all of them. Currently, his _readiness_ for the i-th examination is A_{i}, and according to his investigation, it is known that he needs readiness of at least B_{i} in order to pass the i-th examination. Takahashi thinks that he may not be able to pa... | N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
total = 0
diff_list = []
smaller_num = 0
for n in range(N):
if A[n] < B[n]:
total += B[n] - A[n]
smaller_num += 1
else:
diff_list.append(A[n] - B[n])
diff_list = sorted(diff_list, reverse = True)
d... | s934408461 | Accepted | 122 | 19,060 | 594 | N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
total = 0
diff_list = []
smaller_num = 0
for n in range(N):
if A[n] < B[n]:
total += B[n] - A[n]
smaller_num += 1
else:
diff_list.append(A[n] - B[n])
diff_list = sorted(diff_list, reverse = True)
d... |
s911620993 | p03548 | u217627525 | 2,000 | 262,144 | Wrong Answer | 33 | 2,940 | 94 | We have a long seat of width X centimeters. There are many people who wants to sit here. A person sitting on the seat will always occupy an interval of length Y centimeters. We would like to seat as many people as possible, but they are all very shy, and there must be a gap of length at least Z centimeters between two... | x,y,z=map(int,input().split())
w=y+2*z
ans=1
while w<x-(y+z):
w+=y+z
ans+=1
print(ans) | s746654505 | Accepted | 17 | 2,940 | 58 | x,y,z=map(int,input().split())
ans=(x-z)//(y+z)
print(ans) |
s798662730 | p03478 | u022269787 | 2,000 | 262,144 | Wrong Answer | 21 | 3,064 | 273 | 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())
array = []
for i in range(0,1,1):
for j in range(0,9,1):
for k in range(0,9,1):
for l in range(0,9,1):
for m in range(0,9,1):
if A < i+j+k+l+m < B:
array.append(i+j+k+l+m)
sum(array)
print(array) | s488695731 | Accepted | 37 | 3,060 | 143 | N, A, B = map(int, input().split())
num = 0
for i in range(N+1):
if A <= sum(list(map(int, list(str(i))))) <= B:
num += i
print(num)
|
s659137492 | p03814 | u104922648 | 2,000 | 262,144 | Wrong Answer | 19 | 3,560 | 85 | Snuke has decided to construct a string that starts with `A` and ends with `Z`, by taking out a substring of a string s (that is, a consecutive part of s). Find the greatest length of the string Snuke can construct. Here, the test set guarantees that there always exists a substring of s that starts with `A` and ends w... | word = input()
start = word.index('A')
end = word.index('Z')
print(word[start:end+1]) | s019654215 | Accepted | 59 | 11,308 | 197 | word = input()
start = []
end = []
for idx, w in enumerate(word):
if w == 'A':
start.append(idx)
elif w == 'Z':
end.append(idx)
else:
continue
print(len(word[start[0]:end[-1]+1])) |
s030475482 | p03377 | u973013625 | 2,000 | 262,144 | Wrong Answer | 18 | 2,940 | 85 | 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())
print('Yes' if a <= x and (a + b) >= x else 'No') | s367322554 | Accepted | 17 | 2,940 | 77 | a, b, x = map(int, input().split())
print('YES' if a <= x <= a + b else 'NO') |
s816120197 | p03607 | u816428863 | 2,000 | 262,144 | Time Limit Exceeded | 2,117 | 193,816 | 248 | You are playing the following game with Joisino. * Initially, you have a blank sheet of paper. * Joisino announces a number. If that number is written on the sheet, erase the number from the sheet; if not, write the number on the sheet. This process is repeated N times. * Then, you are asked a question: How many... | # coding: utf-8
# Here your code !
list = []
for i in range(1000000000):
list.append(0)
N = int(input())
for i in range(N):
a = int(input())
if list[a - 1] == 0:
list[a-1] = 1
else:
list[a-1] = 0
print(list.count(1)) | s317923571 | Accepted | 211 | 11,884 | 158 | N = int(input())
card = set()
for i in range(N):
A = int(input())
if A in card:
card.remove(A)
else:
card.add(A)
print(len(card)) |
s714925361 | p00015 | u661290476 | 1,000 | 131,072 | Wrong Answer | 20 | 7,584 | 126 | A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers. If given integers or t... | n=int(input())
for _ in range(n):
a=int(input())
b=int(input())
ab=a+b
print(ab if ab<=10**80 else "overflow") | s190220426 | Accepted | 30 | 7,512 | 125 | n=int(input())
for _ in range(n):
a=int(input())
b=int(input())
ab=a+b
print(ab if ab<10**80 else "overflow") |
s625574605 | p02842 | u274635633 | 2,000 | 1,048,576 | Wrong Answer | 24 | 5,016 | 95 | Takahashi bought a piece of apple pie at ABC Confiserie. According to his memory, he paid N yen (the currency of Japan) for it. The consumption tax rate for foods in this shop is 8 percent. That is, to buy an apple pie priced at X yen before tax, you have to pay X \times 1.08 yen (rounded down to the nearest integer).... | n=int(input())
x=[(i*108)//100 for i in range(1,n+1)]
if n in x:
print(n)
else:
print(':(') | s325830999 | Accepted | 24 | 5,016 | 133 | import bisect
n=int(input())
x=[(i*108)//100 for i in range(1,n+1)]
if n in x:
print(bisect.bisect_left(x,n)+1)
else:
print(':(') |
s476848479 | p03943 | u172873334 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 87 | 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=[int(i) for i in input().split()]
a.sort()
print('YES' if a[0]+a[1]==a[2] else 'NO')
| s401994130 | Accepted | 20 | 2,940 | 87 | a=[int(i) for i in input().split()]
a.sort()
print('Yes' if a[0]+a[1]==a[2] else 'No')
|
s259492242 | p03478 | u615850856 | 2,000 | 262,144 | Wrong Answer | 34 | 3,060 | 163 | 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 = (int(x) for x in input().split())
ans = 0
for n in range(1,N+1):
temp = [int(x) for x in str(n)]
if A <= sum(temp) <= B:
ans+= sum(temp)
print(ans) | s544411559 | Accepted | 33 | 3,060 | 155 | N,A,B = (int(x) for x in input().split())
ans = 0
for n in range(1,N+1):
temp = [int(x) for x in str(n)]
if A <= sum(temp) <= B:
ans+= n
print(ans) |
s086213670 | p03157 | u619819312 | 2,000 | 1,048,576 | Wrong Answer | 509 | 7,008 | 1,242 | There is a grid with H rows and W columns, where each square is painted black or white. You are given H strings S_1, S_2, ..., S_H, each of length W. If the square at the i-th row from the top and the j-th column from the left is painted black, the j-th character in the string S_i is `#`; if that square is painted whi... | h,w=map(int,input().split())
s=[[0]+list(input())+[0]for i in range(h)]
s.insert(0,[0]*(w+2))
s.append([0]*(w+2))
c=["#","."]
n=0
print(s)
for i in range(1,h+1):
for j in range(1,w+1):
g=[0,0]
if s[i][j]!=0:
p=c.index(s[i][j])
g[c.index(s[i][j])]+=1
k=[[i,j]]
... | s366168237 | Accepted | 496 | 4,468 | 1,233 | h,w=map(int,input().split())
s=[[0]+list(input())+[0]for i in range(h)]
s.insert(0,[0]*(w+2))
s.append([0]*(w+2))
c=["#","."]
n=0
for i in range(1,h+1):
for j in range(1,w+1):
g=[0,0]
if s[i][j]!=0:
p=c.index(s[i][j])
g[c.index(s[i][j])]+=1
k=[[i,j]]
s... |
s128093951 | p03844 | u816631826 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 275 | Joisino wants to evaluate the formula "A op B". Here, A and B are integers, and the binary operator op is either `+` or `-`. Your task is to evaluate the formula instead of her. | # python
user_input = input("Input in format A op B")
input_sep = user_input.split()
input_a = int(input_sep[0])
operator = input_sep[1]
input_b = int(input_sep[2])
if operator is '+':
print(int(input_a + input_b))
elif operator is '-':
print(int(input_a - input_b)) | s816754038 | Accepted | 17 | 2,940 | 109 | a=list(input().split(" "))
if a[1]=='+':
print(int(a[0])+int(a[2]))
else:
print(int(a[0])-int(a[2]))
|
s907698811 | p03696 | u248670337 | 2,000 | 262,144 | Wrong Answer | 29 | 9,128 | 96 | You are given a string S of length N consisting of `(` and `)`. Your task is to insert some number of `(` and `)` into S to obtain a _correct bracket sequence_. Here, a correct bracket sequence is defined as follows: * `()` is a correct bracket sequence. * If X is a correct bracket sequence, the concatenation of... | input()
s=t=input()
l,r=o="()"
exec('s=s'+'.replace(o,"")'*50)
print(l*(c:=s.count)(l)+t+r*c(r)) | s038377839 | Accepted | 26 | 9,200 | 96 | input()
s=t=input()
l,r=o="()"
exec('s=s'+'.replace(o,"")'*50)
print(l*(c:=s.count)(r)+t+r*c(l)) |
s882378695 | p03160 | u816265237 | 2,000 | 1,048,576 | Wrong Answer | 141 | 14,672 | 317 | There are N stones, numbered 1, 2, \ldots, N. For each i (1 \leq i \leq N), the height of Stone i is h_i. There is a frog who is initially on Stone 1. He will repeat the following action some number of times to reach Stone N: * If the frog is currently on Stone i, jump to Stone i + 1 or Stone i + 2. Here, a cost of... | n = int(input())
ln = list(map(int, input().split()))
min_ln = []
for i in range(n):
if i == 0:
min_ln.append(0)
elif i == 1:
min_ln.append(abs(ln[1] - ln[0]))
else:
min_ln.append(min(abs(ln[i] - ln[i-1]) + min_ln[i-1], abs(ln[i] - ln[i-2]) + min_ln[i-2]))
print(min_ln,min_ln[-1]) | s593131843 | Accepted | 132 | 13,980 | 310 | n = int(input())
ln = list(map(int, input().split()))
min_ln = []
for i in range(n):
if i == 0:
min_ln.append(0)
elif i == 1:
min_ln.append(abs(ln[1] - ln[0]))
else:
min_ln.append(min(abs(ln[i] - ln[i-1]) + min_ln[i-1], abs(ln[i] - ln[i-2]) + min_ln[i-2]))
print(min_ln[-1]) |
s017987547 | p03524 | u818349438 | 2,000 | 262,144 | Wrong Answer | 18 | 3,188 | 136 | Snuke has a string S consisting of three kinds of letters: `a`, `b` and `c`. He has a phobia for palindromes, and wants to permute the characters in S so that S will not contain a palindrome of length 2 or more as a substring. Determine whether this is possible. | s = input()
a = s.count('a')
b = s.count('b')
c = s.count('c')
p = [a,b,c]
if max(p) - min(p) <=1:
print('Yes')
else:print('No') | s189632435 | Accepted | 18 | 3,188 | 136 | s = input()
a = s.count('a')
b = s.count('b')
c = s.count('c')
p = [a,b,c]
if max(p) - min(p) <=1:
print('YES')
else:print('NO') |
s928785153 | p03759 | u569272329 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 94 | Three poles stand evenly spaced along a line. Their heights are a, b and c meters, from left to right. We will call the arrangement of the poles _beautiful_ if the tops of the poles lie on the same line, that is, b-a = c-b. Determine whether the arrangement of the poles is beautiful. | a, b, c = map(int, input().split())
if a - b == b - c:
print("Yes")
else:
print("No")
| s565176627 | Accepted | 18 | 2,940 | 94 | a, b, c = map(int, input().split())
if b - a == c - b:
print("YES")
else:
print("NO")
|
s967932803 | p03140 | u762424840 | 2,000 | 1,048,576 | Wrong Answer | 17 | 3,060 | 224 | You are given three strings A, B and C. Each of these is a string of length N consisting of lowercase English letters. Our objective is to make all these three strings equal. For that, you can repeatedly perform the following operation: * Operation: Choose one of the strings A, B and C, and specify an integer i bet... | # -*- coding: utf-8 -*-
N = int(input())
A = input()
B = input()
C = input()
cnt = 0
for i in range(N):
if A[i] != B[i]:
cnt+=1
for i in range(N):
if A[i] != C[i]:
cnt+=1
print("{}".format(cnt))
| s420603768 | Accepted | 17 | 3,060 | 338 | # -*- coding: utf-8 -*-
N = int(input())
A = input()
B = input()
C = input()
min = 0
for i in range(N):
if A[i] == B[i]:
if A[i] != C[i]:
min += 1
else:
if A[i] == C[i]:
min += 1
elif C[i] == B[i]:
min += 1
else:
min += 2
print(... |
s679283840 | p03470 | u186893542 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 71 | 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... | d = {}
for i in range(int(input())):
d[i] = i
print(len(d.keys())) | s365639813 | Accepted | 18 | 2,940 | 90 | d = {}
for i in range(int(input())):
k = int(input())
d[k] = 1
print(len(d.keys())) |
s613627670 | p02844 | u282657760 | 2,000 | 1,048,576 | Wrong Answer | 2,104 | 5,236 | 455 | AtCoder Inc. has decided to lock the door of its office with a 3-digit PIN code. The company has an N-digit lucky number, S. Takahashi, the president, will erase N-3 digits from S and concatenate the remaining 3 digits without changing the order to set the PIN code. How many different PIN codes can he set this way? ... | import re
N = int(input())
S = input()
ans = 0
tmp = [[m.start() for m in re.finditer(str(i), S)] for i in range(10)]
print(tmp)
for i in range(10):
if len(tmp[i]) == 0:
continue
for j in range(10):
if len(tmp[j]) == 0:
continue
for k in range(10):
if len(tmp[k]) == 0:
continue
... | s191278427 | Accepted | 136 | 4,552 | 540 | import re
N = int(input())
S = input()
ans = 0
tmp = [[m.start() for m in re.finditer(str(i), S)] for i in range(10)]
for i in range(10):
if len(tmp[i]) == 0:
continue
for j in range(10):
if len(tmp[j]) == 0:
continue
for k in range(10):
if len(tmp[k]) == 0:
continue
l = tmp[i]... |
s093362765 | p03636 | u106778233 | 2,000 | 262,144 | Wrong Answer | 24 | 9,036 | 71 | 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. | s =input()
length = len(s)
ans = s[0] + str(length) + s[-1]
print(ans) | s561031446 | Accepted | 29 | 8,996 | 74 | s =input()
length = len(s)- 2
ans = s[0] + str(length) + s[-1]
print(ans) |
s641500854 | p02603 | u695197008 | 2,000 | 1,048,576 | Wrong Answer | 30 | 8,940 | 348 | To become a millionaire, M-kun has decided to make money by trading in the next N days. Currently, he has 1000 yen and no stocks - only one kind of stock is issued in the country where he lives. He is famous across the country for his ability to foresee the future. He already knows that the price of one stock in the n... | N = int(input())
A = list(map(int, input().split()))
yen = 1000
stocks = 0
for i in range(N):
if i == N-1:
yen += stocks * A[i]
stocks = 0
break
if A[i] > A[i-1]:
# sell everything
yen += stocks * A[i]
stocks = 0
else:
# buy everything
num = yen // A[i]
stocks += num
y... | s648307161 | Accepted | 31 | 9,188 | 349 | N = int(input())
A = list(map(int, input().split()))
yen = 1000
stocks = 0
for i in range(N):
if i == N-1:
yen += stocks * A[i]
stocks = 0
break
if A[i] > A[i+1]:
# sell everything
yen += stocks * A[i]
stocks = 0
else:
# buy everything
num = yen // A[i]
stocks += num
y... |
s559657181 | p02603 | u276686572 | 2,000 | 1,048,576 | Wrong Answer | 31 | 9,228 | 321 | To become a millionaire, M-kun has decided to make money by trading in the next N days. Currently, he has 1000 yen and no stocks - only one kind of stock is issued in the country where he lives. He is famous across the country for his ability to foresee the future. He already knows that the price of one stock in the n... | days = int(input())
yen = 1000
prices = list(map(int, input().split()))
stocks = 0
for i in range(0, days-1):
if prices[i] < prices[i+1]:
yen %= prices[i]
stocks = yen // prices[i]
elif prices[i] > prices[i+1]:
yen += stocks*prices[i]
stocks = 0
print(yen)
yen += stocks*prices[days-1]
print(yen... | s681930741 | Accepted | 30 | 9,032 | 311 | days = int(input())
yen = 1000
prices = list(map(int, input().split()))
stocks = 0
for i in range(0, days-1):
if prices[i] < prices[i+1]:
stocks += yen // prices[i]
yen %= prices[i]
elif prices[i] > prices[i+1]:
yen += stocks*prices[i]
stocks = 0
yen += stocks*prices[days-1]
print(yen)
|
s409726518 | p03129 | u223646582 | 2,000 | 1,048,576 | Wrong Answer | 17 | 2,940 | 79 | 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') | s937587531 | Accepted | 20 | 2,940 | 79 | N,K=map(int,input().split())
if K<=(N+1)//2:
print('YES')
else:
print('NO') |
s316426353 | p03455 | u511421299 | 2,000 | 262,144 | Wrong Answer | 18 | 3,064 | 72 | 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())
print('even' if a*b%2 == 0 else 'odd')
| s573768171 | Accepted | 17 | 2,940 | 71 | a, b = map(int, input().split())
print('Even' if a*b%2 == 0 else 'Odd') |
s708893690 | p03578 | u999449420 | 2,000 | 262,144 | Wrong Answer | 2,105 | 35,420 | 558 | Rng is preparing a problem set for a qualification round of CODEFESTIVAL. He has N candidates of problems. The difficulty of the i-th candidate is D_i. There must be M problems in the problem set, and the difficulty of the i-th problem must be T_i. Here, one candidate of a problem cannot be used as multiple problems.... | # N, M, K = map(int, input().split())
# N = int(input())
N = int(input())
D = list(map(int, input().split()))
M = int(input())
T = list(map(int, input().split()))
flag = False
ans_flag = True
for i in T:
for n, j in enumerate(D):
if i == j:
D.pop(n)
# print(D)
flag ... | s608735393 | Accepted | 323 | 57,056 | 429 | import collections
N = int(input())
D = list(map(int, input().split()))
M = int(input())
T = list(map(int, input().split()))
flag = False
ans_flag = True
d = collections.Counter(D)
t = collections.Counter(T)
# print(d.most_common())
# print(t.most_common())
for i in t:
i_str = str(i)
d_count = d[i]
if d_co... |
s244654200 | p02390 | u505411588 | 1,000 | 131,072 | Wrong Answer | 50 | 7,568 | 95 | Write a program which reads an integer $S$ [second] and converts it to $h:m:s$ where $h$, $m$, $s$ denote hours, minutes (less than 60) and seconds (less than 60) respectively. | S = int(input())
h = str(S//360)
M = S%360
m = str(M//60)
s = str(M%60)
print(h+":"+m+":"+s) | s698313340 | Accepted | 30 | 7,648 | 97 | S = int(input())
h = str(S//3600)
M = S%3600
m = str(M//60)
s = str(M%60)
print(h+":"+m+":"+s) |
s108074663 | p03861 | u369212307 | 2,000 | 262,144 | Wrong Answer | 18 | 3,064 | 103 | You are given nonnegative integers a and b (a ≤ b), and a positive integer x. Among the integers between a and b, inclusive, how many are divisible by x? | a, b, x = map(int, input().split())
ans = 0
if a == 0:
ans = 1
ans += int((b - a) / x )
print(ans) | s839258348 | Accepted | 18 | 2,940 | 254 | a, b, x = map(int, input().split())
ans = 0
def fanc(n, x):
if n == -1:
f = 0
else:
f = n // x + 1
return f
print(fanc(b, x) - fanc(a - 1, x)) |
s272963357 | p03609 | u023229441 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 46 | We have a sandglass that runs for X seconds. The sand drops from the upper bulb at a rate of 1 gram per second. That is, the upper bulb initially contains X grams of sand. How many grams of sand will the upper bulb contains after t seconds? | a,b=map(int,input().split())
print(max(0,b-a)) | s036911314 | Accepted | 18 | 2,940 | 46 | a,b=map(int,input().split())
print(max(0,a-b)) |
s687913332 | p04031 | u492447501 | 2,000 | 262,144 | Wrong Answer | 18 | 3,060 | 212 | Evi has N integers a_1,a_2,..,a_N. His objective is to have N equal **integers** by transforming some of them. He may transform each integer at most once. Transforming an integer x into another integer y costs him (x-y)^2 dollars. Even if a_i=a_j (i≠j), he has to pay the cost separately for transforming each of them (... | n = int(input())
*a, = map(int, input().split())
stack = []
for i in range(n):
stack.append(a[i])
stack.reverse()
st = ""
for i in range(len(stack)):
st = st + str(stack[i])
print(" ".join(st)) | s482762352 | Accepted | 25 | 3,060 | 235 | N = int(input())
*A, = map(int, input().split())
min = float("inf")
for y in range(-100, 101, 1):
sum = 0
for a in range(len(A)):
sum = sum + (A[a]-y)**2
if min > sum:
min = sum
ans = y
print(min) |
s932900851 | p02397 | u403901064 | 1,000 | 131,072 | Wrong Answer | 20 | 7,700 | 168 | Write a program which reads two integers x and y, and prints them in ascending order. | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
def main():
nums = input().split(" ")
nums.sort(key = int)
print(" ".join(nums))
if __name__ == '__main__':
main() | s617648903 | Accepted | 40 | 8,312 | 249 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
def main():
nums = []
while True:
x = input().split(" ")
if x == ["0","0"]:
break
x.sort(key = int)
nums.append(x)
for i in nums:
print(" ".join(i))
if __name__ == '__main__':
main() |
s055251086 | p02831 | u183422236 | 2,000 | 1,048,576 | Wrong Answer | 2,103 | 2,940 | 151 | Takahashi is organizing a party. At the party, each guest will receive one or more snack pieces. Takahashi predicts that the number of guests at this party will be A or B. Find the minimum number of pieces that can be evenly distributed to the guests in both of the cases predicted. We assume that a piece cannot be ... | a, b = map(int, input().split())
c = min(a, b)
print(c)
for i in range(c, a * b + 1):
if i % a == 0 and i % b == 0:
print(i)
exit() | s472862959 | Accepted | 38 | 2,940 | 204 | a, b = map(int, input().split())
c = a * b
d = min(a, b)
j = 1
for i in range(2, d + 1):
j += 1
if a % j == 0 and b % j == 0:
c //= j
a //= j
b //= j
j = 1
print(c) |
s656421900 | p02417 | u256678932 | 1,000 | 131,072 | Wrong Answer | 30 | 7,916 | 193 | Write a program which counts and reports the number of each alphabetical letter. Ignore the case of characters. | import string
chs = dict([(ch, 0) for ch in string.ascii_lowercase])
for ch in input():
if ch not in chs:
continue
chs[ch] += 1
for k, v in chs.items():
print(k, ':', v) | s310646296 | Accepted | 40 | 6,684 | 340 | import string
dic = { ch:0 for ch in string.ascii_lowercase }
while True:
try:
line = input()
for ch in line:
c = ch.lower()
if c not in dic:
continue
dic[c] += 1
except EOFError:
break
for ch in string.ascii_lowercase:
print... |
s657234034 | p02747 | u572012241 | 2,000 | 1,048,576 | Wrong Answer | 18 | 2,940 | 220 | A Hitachi string is a concatenation of one or more copies of the string `hi`. For example, `hi` and `hihi` are Hitachi strings, while `ha` and `hii` are not. Given a string S, determine whether S is a Hitachi string. | s = input()
for i in range(len(s)-1):
if (s[i]== "h" and s[i+1] == "i"):
if i+1 == len(s)-1:
print("Yes")
elif s[i+2] != "i":
print("No")
else:
print("Yes")
else:
print("No")
| s220592223 | Accepted | 58 | 5,732 | 451 | from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
s = in... |
s808652396 | p03067 | u813450934 | 2,000 | 1,048,576 | Wrong Answer | 17 | 2,940 | 108 | There are three houses on a number line: House 1, 2 and 3, with coordinates A, B and C, respectively. Print `Yes` if we pass the coordinate of House 3 on the straight way from House 1 to House 2 without making a detour, and print `No` otherwise. | a,b,c = map(int,input().split())
if min(a,c)<= b and max(a,c) >= b:
print("Yes")
else :
print("No")
| s195464566 | Accepted | 17 | 2,940 | 108 | a,b,c = map(int,input().split())
if min(a,b)<= c and max(a,b) >= c:
print("Yes")
else :
print("No")
|
s647314565 | p03493 | u254871849 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 100 | 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. | ls = list(map(int, input().split()))
count = 0
for i in ls:
if i == 1:
count += 1
print(count) | s025728749 | Accepted | 21 | 3,316 | 174 | import sys
from collections import Counter
s = sys.stdin.readline().rstrip()
def main():
c = Counter(s)
print(c.get('1', 0))
if __name__ == '__main__':
main() |
s298986865 | p03434 | u197078193 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 132 | We have N cards. A number a_i is written on the i-th card. Alice and Bob will play a game using these cards. In this game, Alice and Bob alternately take one card. Alice goes first. The game ends when all the cards are taken by the two players, and the score of each player is the sum of the numbers written on the c... | N = int(input())
A = [int(a) for a in input().split()]
A.sort()
d = 0
for a in A[::2]:
d += a
for a in A[1::2]:
d -= a
print(d)
| s380020416 | Accepted | 17 | 2,940 | 144 | N = int(input())
A = [int(a) for a in input().split()]
A.sort()
A.reverse()
d = 0
for a in A[::2]:
d += a
for a in A[1::2]:
d -= a
print(d)
|
s625601563 | p04043 | u622045059 | 2,000 | 262,144 | Wrong Answer | 20 | 3,316 | 122 | 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 ... | import collections
abc = collections.Counter(input().split())
print('Yes' if abc['5'] == 2 and abc['7'] == 1 else 'No')
| s561787483 | Accepted | 20 | 3,316 | 122 | import collections
abc = collections.Counter(input().split())
print('YES' if abc['5'] == 2 and abc['7'] == 1 else 'NO')
|
s207182963 | p03162 | u905582793 | 2,000 | 1,048,576 | Wrong Answer | 655 | 55,008 | 507 | Taro's summer vacation starts tomorrow, and he has decided to make plans for it now. The vacation consists of N days. For each i (1 \leq i \leq N), Taro will choose one of the following activities and do it on the i-th day: * A: Swim in the sea. Gain a_i points of happiness. * B: Catch bugs in the mountains. Gain... | import sys
N = int(input())
summer = []
for i in range(N):
summer.append(list(map(int, sys.stdin.readline().rstrip().split(" "))))
print(summer)
INF = float('inf')
DP = [[-INF for i in range(3)] for i in range(N)]
print(DP)
for i in range(N):
if i == 0:
DP[i] = summer[i]
else:
DP[i][0] = ... | s254610747 | Accepted | 520 | 47,280 | 482 | import sys
N = int(input())
summer = []
for i in range(N):
summer.append(list(map(int, sys.stdin.readline().rstrip().split(" "))))
INF = float('inf')
DP = [[-INF for i in range(3)] for i in range(N)]
for i in range(N):
if i == 0:
DP[i] = summer[i]
else:
DP[i][0] = max(DP[i-1][1], DP[i-1][2... |
s839302832 | p02613 | u243312682 | 2,000 | 1,048,576 | Wrong Answer | 146 | 17,732 | 488 | 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 Counter
def main():
n = int(input())
s = [input() for i in range(n)]
print(s)
ac = 0
wa = 0
tle = 0
re = 0
for i in s:
if i == 'AC':
ac += 1
elif i == 'WA':
wa += 1
elif i == 'TLE':
tle += 1
... | s179711587 | Accepted | 144 | 16,204 | 115 | n = int(input())
s = [input() for i in range(n)]
for i in ['AC', 'WA', 'TLE', 'RE']:
print(i, 'x', s.count(i)) |
s677201892 | p03599 | u607074939 | 3,000 | 262,144 | Time Limit Exceeded | 3,184 | 433,900 | 626 | Snuke is making sugar water in a beaker. Initially, the beaker is empty. Snuke can perform the following four types of operations any number of times. He may choose not to perform some types of operations. * Operation 1: Pour 100A grams of water into the beaker. * Operation 2: Pour 100B grams of water into the bea... | A,B,C,D,E,F = map(int,input().split())
W = []
S = []
for i in range(F+1):
for j in range(F+1):
x = 100*A*i + 100*B*j
W.append(x)
for i in range(F+1):
for j in range(F+1):
y = C*i + D*j
S.append(y)
maxcon = 0
limitcon = 100*E/(100+E)
ans1 = 0
ans2 = 0
for i in range(1,len(... | s300537508 | Accepted | 753 | 3,064 | 742 | A,B,C,D,E,F=map(int,input().split())
best_sugarwater = 100*A
best_sugar = 0
best_con = 0
max_con = E/(100+E)
maxA = F//(100*A)
for i in range(maxA+1):
maxB = (F-100*A*i)//(100*B)
for j in range(maxB+1):
water = 100*A*i+100*B*j
maxC = (F-100*A*i-100*B*j)//C
for k in range(maxC+1):
... |
s359823904 | p03997 | u278143034 | 2,000 | 262,144 | Wrong Answer | 30 | 9,156 | 133 | 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())
h = int(input())
area = (a + b) * h / 0.5
print(area) | s324984536 | Accepted | 26 | 9,168 | 137 |
a = int(input())
b = int(input())
h = int(input())
area = int((a + b) * h / 2)
print(area) |
s390685025 | p03672 | u407730443 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 142 | We will call a string that can be obtained by concatenating two equal strings an _even_ string. For example, `xyzxyz` and `aaaaaa` are even, while `ababab` and `xyzxy` are not. You are given an even string S consisting of lowercase English letters. Find the length of the longest even string that can be obtained by del... | s = input()
for i in range(len(s)):
s = s[:-1]
if len(s) % 2 == 0 and s[:len(s)//2] == s[-len(s)//2:]:
print(s)
break | s953912492 | Accepted | 17 | 2,940 | 147 | s = input()
for i in range(len(s)):
s = s[:-1]
if len(s) % 2 == 0 and s[:len(s)//2] == s[-len(s)//2:]:
print(len(s))
break |
s818630919 | p03149 | u225254556 | 2,000 | 1,048,576 | Wrong Answer | 17 | 2,940 | 209 | You are given four digits N_1, N_2, N_3 and N_4. Determine if these can be arranged into the sequence of digits "1974". | # B_KEYENCE String
import sys
S = list(input())
key = ['k','e','y','e','n','c','e']
i = 0
for _ in range(len(S)) :
if S[_] == key[i] :
i += 1
if i > 6 :
print("YES")
else :
print("NO")
| s510478713 | Accepted | 18 | 3,064 | 513 | #A_Beginning
import sys
N = list(map(int, input().split()))
wk = [99 for _ in range(len(N))]
flg = True
for i in range(len(N)) :
if N[i] == 1 or N[i] == 9 or N[i] == 7 or N[i] == 4 :
for _ in range(len(wk)) :
if wk[_] == N[i] :
flg = False
break
if flg =... |
s823957903 | p03229 | u621100542 | 2,000 | 1,048,576 | Wrong Answer | 316 | 8,288 | 1,288 | You are given N integers; the i-th of them is A_i. Find the maximum possible sum of the absolute differences between the adjacent elements after arranging these integers in a row in any order you like. | # coding: utf-8
# Your code here!
S = int(input())
lis = []
for item in range(0,int(S)):
tmp = input()
lis.append(int(tmp))
ls = sorted(lis)
#print(ls)
#print(ls[int(S/2)])
i = 0
lo = 0
hg = int(S)-1
ans = ls[hg]- ls[int(S/2)]
#print("first",ans)
if S % 2 == 1 or S % 2 == 0:
for k in range(0,int(S/2)+1):
... | s507518068 | Accepted | 1,825 | 8,928 | 682 | # coding: utf-8
# Your code here!
S = int(input())
lis = []
for item in range(0,int(S)):
tmp = input()
lis.append(int(tmp))
ls = sorted(lis)
lsb = sorted(lis)
center = ls[int(S/2-0.5)]
ans1 = ls[-1] - center
ls.remove(center)
for k in range(0,int(S/2)):
try:
ans1 = ans1 + ls.pop(-1) - ls[... |
s872989577 | p03139 | u670180528 | 2,000 | 1,048,576 | Wrong Answer | 17 | 2,940 | 61 | We conducted a survey on newspaper subscriptions. More specifically, we asked each of the N respondents the following two questions: * Question 1: Are you subscribing to Newspaper X? * Question 2: Are you subscribing to Newspaper Y? As the result, A respondents answered "yes" to Question 1, and B respondents answ... | n,a,b=map(int,input().split());print(min(n,a+b),max(0,a+b-n)) | s823393574 | Accepted | 17 | 2,940 | 59 | n,a,b=map(int,input().split());print(min(a,b),max(0,a+b-n)) |
s335676683 | p03854 | u989074104 | 2,000 | 262,144 | Wrong Answer | 18 | 3,188 | 236 | 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=input()
str_list=["dream","dreamer","erase","eraser"]
S_tmp=""
while True:
S_tmp=S
for str in str_list:
S=S.replace(str,"")
if S_tmp==S:
break
if S=="":
print("Yes")
if S!="":
print("No") | s194836630 | Accepted | 100 | 3,340 | 260 | S=input()
str_list=["dreamer","eraser","dream","erase"]
while True:
S_tmp=S
for str in str_list:
if S[-len(str):]==str:
S=S[0:len(S)-len(str)]
if S_tmp==S:
break
if S=="":
print("YES")
if S!="":
print("NO") |
s597896463 | p02261 | u831244171 | 1,000 | 131,072 | Wrong Answer | 20 | 7,672 | 1,297 | 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... | def selectionSort(a,b):
for i in range(len(a)):
mini = i
for j in range(i,len(a)):
if a[j] < a[mini]:
mini = j
if i != mini:
ret = a[i]
a[i] = a[mini]
a[mini] = ret
ret = b[i]
b[i] =b[mini]
b[... | s252578315 | Accepted | 20 | 7,792 | 1,386 | def selectionSort(a,b):
for i in range(len(a)):
mini = i
for j in range(i,len(a)):
if a[j] < a[mini]:
mini = j
if i != mini:
ret = a[i]
a[i] = a[mini]
a[mini] = ret
ret = b[i]
b[i] =b[mini]
b[... |
s744702413 | p03385 | u710282484 | 2,000 | 262,144 | Wrong Answer | 30 | 8,772 | 85 | You are given a string S of length 3 consisting of `a`, `b` and `c`. Determine if S can be obtained by permuting `abc`. | s=input()
s=sorted(s)
l=['a','b','c']
if s==l:
print('YES')
else:
print('NO') | s953699815 | Accepted | 26 | 8,940 | 103 | s=input()
s=sorted(s)
if s[0]=='a' and s[1]=='b' and s[2]=='c':
print('Yes')
else:
print('No') |
s228711161 | p03455 | u220870679 | 2,000 | 262,144 | Wrong Answer | 18 | 2,940 | 85 | AtCoDeer the deer found two positive integers, a and b. Determine whether the product of a and b is even or odd. | n, m = map(int, input().split())
if (n*m)%2:
print("Even")
else:
print("Odd") | s249790589 | Accepted | 17 | 2,940 | 101 | a, b = map(int, input() .split())
c = (a * b) % 2
if c == 0:
print("Even")
else:
print("Odd") |
s215511232 | p03854 | u065578867 | 2,000 | 262,144 | Wrong Answer | 21 | 4,724 | 452 | 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_init = input()
s_list = list(reversed(s_init))
s = ''.join(s_list)
t = ""
words = ["maerd", "remaerd", 'esare', 'resare']
s_list = list(s)
t_list = list(t)
while s != t:
if len(s_list) < len(t_list):
break
elif t == 'gameover':
break
for word in words:
if s.startswith(t + word):
... | s270149890 | Accepted | 236 | 4,724 | 505 | s_init = input()
s_list = list(reversed(s_init))
s = ''.join(s_list)
t = ""
words = ["maerd", "remaerd", 'esare', 'resare']
s_list = list(s)
t_list = list(t)
while s != t:
t_fixed = t
if len(s_list) < len(t_list):
break
elif t == 'gameover':
break
else:
for word in words:
... |
s069329418 | p03739 | u652057333 | 2,000 | 262,144 | Wrong Answer | 185 | 14,500 | 926 | You are given an integer sequence of length N. The i-th term in the sequence is a_i. In one operation, you can select a term and either increment or decrement it by one. At least how many operations are necessary to satisfy the following conditions? * For every i (1≤i≤n), the sum of the terms from the 1-st through ... | n = int(input())
a = list(map(int, input().split()))
ans = 10**10
# 1 -1 1 -1...
cost1 = 0
s = 0
for i in range(n):
t = 1 if i % 2 == 0 else -1
c = 0
if i % 2 == 0:
if s + a[i] > 0:
s += a[i]
else:
c = abs(s - t)
s += c
cost1 += abs(c - a[i])... | s890568792 | Accepted | 186 | 14,332 | 908 | n = int(input())
a = list(map(int, input().split()))
ans = 10**10
# 1 -1 1 -1...
cost1 = 0
s = 0
for i in range(n):
t = 1 if i % 2 == 0 else -1
c = 0
if i % 2 == 0:
if s + a[i] > 0:
s += a[i]
else:
c = abs(s - t)
s += c
cost1 += abs(c - a[i])... |
s628898090 | p03359 | u969848070 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 93 | 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 = map(int, input().split())
c = 0
for i in range(1,a+1):
if i == b:
c +=1
print(c) | s464721803 | Accepted | 17 | 2,940 | 79 | a, b = map(int, input().split())
if a < b:
print(a)
else:
print(max(a-1,b)) |
s235618486 | p03679 | u788856752 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 135 | Takahashi has a strong stomach. He never gets a stomachache from eating something whose "best-by" date is at most X days earlier. He gets a stomachache if the "best-by" date of the food is X+1 or more days earlier, though. Other than that, he finds the food delicious if he eats it not later than the "best-by" date. Ot... | X, A, B = map(int, input().split())
if A <= B:
print("delicious")
elif (A - B) > X:
print("dagerous")
else:
print("safe")
| s966728885 | Accepted | 17 | 2,940 | 137 | X, A, B = map(int, input().split())
if A >= B:
print("delicious")
elif (B - A) <= X:
print("safe")
else:
print("dangerous")
|
s221424591 | p03351 | u302292660 | 2,000 | 1,048,576 | Wrong Answer | 19 | 2,940 | 89 | 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 b-a<d and c-b<d:
print("Yes")
else:
print("No") | s730738663 | Accepted | 17 | 3,060 | 135 | a,b,c,d = map(int,input().split())
if abs(b-a)<=d and abs(c-b)<=d:
print("Yes")
elif abs(c-a) <=d:
print("Yes")
else:
print("No") |
s629009006 | p03759 | u835575472 | 2,000 | 262,144 | Wrong Answer | 24 | 9,148 | 89 | Three poles stand evenly spaced along a line. Their heights are a, b and c meters, from left to right. We will call the arrangement of the poles _beautiful_ if the tops of the poles lie on the same line, that is, b-a = c-b. Determine whether the arrangement of the poles is beautiful. | a, b, c = map(int, input().split())
if a - b == c - b:
print("YES")
else:
print("NO") | s944421492 | Accepted | 32 | 9,132 | 90 | a, b, c = map(int, input().split())
if b - a == c - b:
print("YES")
else:
print("NO")
|
s189448543 | p03545 | u576432509 | 2,000 | 262,144 | Wrong Answer | 17 | 3,064 | 517 | 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... | import itertools
a=list(map(int,list(input())))
#print(a)
for i in itertools.product([0,1], repeat=3):
r=list(i)
sump=a[0]
for ii in range(3):
if r[ii]==0:
sump=sump-a[ii+1]
else:
sump=sump+a[ii+1]
# print(sump,r)
if sump==7:
stra=str(a[0])
... | s950810280 | Accepted | 17 | 3,064 | 389 | import itertools
a=list(map(int,list(input())))
ans=0
for i in itertools.product([0,1], repeat=3):
asum=a[0]
astr=str(a[0])
for ii in range(len(i)):
if i[ii]==0:
asum+=a[ii+1]
astr=astr +"+" + str(a[ii+1])
else:
asum-=a[ii+1]
astr=astr +"-" +... |
s257614908 | p03609 | u540631540 | 2,000 | 262,144 | Wrong Answer | 26 | 9,068 | 53 | We have a sandglass that runs for X seconds. The sand drops from the upper bulb at a rate of 1 gram per second. That is, the upper bulb initially contains X grams of sand. How many grams of sand will the upper bulb contains after t seconds? | x, t = map(int, input().split())
print(min(0, x - t)) | s087675514 | Accepted | 28 | 8,992 | 53 | x, t = map(int, input().split())
print(max(0, x - t)) |
s827117269 | p03433 | u879761680 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 102 | E869120 has A 1-yen coins and infinitely many 500-yen coins. Determine if he can pay exactly N yen using only these coins. | a = int(input())
c = int(input())
b = 0
b = c % 500
if c >= b:
print('YES')
else:
print("NO") | s246374901 | Accepted | 17 | 2,940 | 102 | a = int(input())
c = int(input())
b = 0
b = a% 500
if c >= b:
print('Yes')
else:
print("No") |
s790064649 | p03693 | u675073679 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 115 | 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())
RGB = int(str(r+g+b))
if RGB % 4 == 0:
print("YES")
else:
print("NO") | s038002567 | Accepted | 17 | 2,940 | 121 | r, g, b = map(int, input().split())
RGB = int(r*100 + g*10 + b)
if RGB % 4 == 0:
print("YES")
else:
print("NO") |
s412539038 | p03493 | u164261323 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 37 | 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. | n = input().split()
print(n.count(1)) | s005839784 | Accepted | 17 | 2,940 | 31 | n = input()
print(n.count("1")) |
s293688848 | p03005 | u271384833 | 2,000 | 1,048,576 | Wrong Answer | 17 | 2,940 | 100 | Takahashi is distributing N balls to K persons. If each person has to receive at least one ball, what is the maximum possible difference in the number of balls received between the person with the most balls and the person with the fewest balls? | if __name__ == "__main__":
n,k = input().split()
n = int(n)
k = int(k)
print(n-k+1)
| s070168909 | Accepted | 17 | 2,940 | 143 | if __name__ == "__main__":
n,k = input().split()
n = int(n)
k = int(k)
if k == 1:
print(0)
else:
print(n-k) |
s921743680 | p03605 | u163874353 | 2,000 | 262,144 | Wrong Answer | 18 | 2,940 | 116 | 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 = str(input())
cnt = 0
for i in n:
if n == "9":
cnt += 1
if cnt >= 1:
print("Yes")
else:
print("No") | s872961247 | Accepted | 17 | 2,940 | 121 | n = str(input())
cnt = 0
for i in n:
if i == "9":
cnt += 1
if cnt >= 1:
print("Yes")
else:
print("No") |
s469467880 | p02608 | u688649934 | 2,000 | 1,048,576 | Time Limit Exceeded | 2,206 | 9,160 | 315 | Let f(n) be the number of triples of integers (x,y,z) that satisfy both of the following conditions: * 1 \leq x,y,z * x^2 + y^2 + z^2 + xy + yz + zx = n Given an integer N, find each of f(1),f(2),f(3),\ldots,f(N). | max_number = int(input())
list_numbers = [i+1 for i in range(max_number)]
count = 0
for i in list_numbers:
count = 0
for x in range(1,100):
for y in range(1,100):
for z in range(1,100):
tot = x**2 + y**2 + z**2 + x * y + y * z + z * x
if (tot == i):
count += 1
print(count) | s472808412 | Accepted | 832 | 9,432 | 241 | N=int(input())
a=[0]*10**4
for j in range(1,101):
for k in range(1,101):
for h in range(1,101):
tmp=h**2+j**2+k**2+h*j+j*k+k*h
if tmp<=10000:
a[tmp-1]+=1
for i in range(N):
print(a[i])
|
s476998716 | p03598 | u340781749 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 125 | There are N balls in the xy-plane. The coordinates of the i-th of them is (x_i, i). Thus, we have one ball on each of the N lines y = 1, y = 2, ..., y = N. In order to collect these balls, Snuke prepared 2N robots, N of type A and N of type B. Then, he placed the i-th type-A robot at coordinates (0, i), and the i-th t... | n = int(input())
k = int(input())
xxx = list(map(int, input().split()))
ans = sum(min(x, abs(k - x)) for x in xxx)
print(ans) | s305911883 | Accepted | 18 | 2,940 | 130 | n = int(input())
k = int(input())
xxx = list(map(int, input().split()))
ans = sum(min(x, abs(k - x)) for x in xxx) * 2
print(ans)
|
s840540027 | p03588 | u225388820 | 2,000 | 262,144 | Wrong Answer | 475 | 28,652 | 92 | 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=sorted([list(map(int,input().split())) for i in range(n)])
print(sum(a[0])) | s728137987 | Accepted | 482 | 28,652 | 93 | n=int(input())
a=sorted([list(map(int,input().split())) for i in range(n)])
print(sum(a[-1])) |
s577567845 | p03563 | u788856752 | 2,000 | 262,144 | Wrong Answer | 18 | 2,940 | 56 | 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(2 * G - R)
| s188094420 | Accepted | 18 | 2,940 | 52 | R = int(input())
G = int(input())
print(2 * G - R)
|
s218353352 | p03493 | u248192265 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 75 | 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 = input()
count = 0
for i in s:
if i == 0:
count += 0
print(count) | s332886922 | Accepted | 18 | 2,940 | 77 | s = input()
count = 0
for i in s:
if i == "1":
count += 1
print(count) |
s927775816 | p03844 | u353919145 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 103 | Joisino wants to evaluate the formula "A op B". Here, A and B are integers, and the binary operator op is either `+` or `-`. Your task is to evaluate the formula instead of her. | s = input()
if s[2]== "-":
print(int(s[0])-int(s[4]))
if s[1]== "+":
print(int(s[0])+int(s[4])) | s126924158 | Accepted | 30 | 9,000 | 128 | inputs = list(map(str,input().split()))
a=int(inputs[0])
b=int(inputs[2])
if inputs[1]=="-":
print(a-b)
else:
print(a+b) |
s226829572 | p03814 | u148471096 | 2,000 | 262,144 | Wrong Answer | 37 | 4,840 | 266 | Snuke has decided to construct a string that starts with `A` and ends with `Z`, by taking out a substring of a string s (that is, a consecutive part of s). Find the greatest length of the string Snuke can construct. Here, the test set guarantees that there always exists a substring of s that starts with `A` and ends w... | N=list(input())
N_num=len(N)
for i in range(N_num):
if N[i] == "A":
min_num=i
break
N.reverse()
for i in range(N_num):
if N[i] == "Z":
max_num=i
break
print(N_num-max_num-min_num+1) | s376727915 | Accepted | 39 | 4,840 | 284 | N=list(input())
N_num=len(N)
max_num=0
min_num=0
for i in range(N_num):
if N[i] == "A":
min_num=i
break
N.reverse()
for i in range(N_num):
if N[i] == "Z":
max_num=i
break
print(N_num-max_num-min_num)
|
s510872631 | p03067 | u918845030 | 2,000 | 1,048,576 | Wrong Answer | 19 | 2,940 | 136 | There are three houses on a number line: House 1, 2 and 3, with coordinates A, B and C, respectively. Print `Yes` if we pass the coordinate of House 3 on the straight way from House 1 to House 2 without making a detour, and print `No` otherwise. | a, b, c = map(int, input().split())
p_min = min(a, b)
p_max = min(a, b)
if p_min <= c <= p_max:
print('Yes')
else:
print('No')
| s127417676 | Accepted | 17 | 2,940 | 157 | a, b, c = map(int, input().split())
p_min = min(a, b)
p_max = max(a, b)
# print(p_min, p_max)
if p_min <= c <= p_max:
print('Yes')
else:
print('No') |
s850568732 | p00001 | u587151698 | 1,000 | 131,072 | Wrong Answer | 20 | 7,572 | 124 | There is a data which provides heights (in meter) of mountains. The data is only for ten mountains. Write a program which prints heights of the top three mountains in descending order. | hight = []
for i in range(10):
hight.append(int(input()))
hight.sort()
print(hight[0])
print(hight[1])
print(hight[2]) | s836858025 | Accepted | 30 | 7,664 | 136 | hight = []
for i in range(10):
hight.append(int(input()))
hight.sort(reverse=True)
print(hight[0])
print(hight[1])
print(hight[2]) |
s422890488 | p02396 | u234508244 | 1,000 | 131,072 | Wrong Answer | 50 | 6,296 | 145 | 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... | import sys
for i, x in enumerate(sys.stdin.readlines(), 1):
if x == "0":
break
print("Case {0}: {1}".format(i, x.rstrip()))
| s648921199 | Accepted | 140 | 5,560 | 121 | i = 1
while True:
x = input()
if x == "0":
break
print("Case {0}: {1}".format(i, x))
i += 1
|
s207767363 | p02240 | u112247126 | 1,000 | 131,072 | Wrong Answer | 30 | 7,944 | 968 | Write a program which reads relations in a SNS (Social Network Service), and judges that given pairs of users are reachable each other through the network. | from collections import deque
def bfs(root):
global time
Q = deque()
distance[root] = 0
Q.append(root)
i = root
while len(Q) > 0:
label[i] = time
i = Q.popleft()
for v in range(n):
if v in adjDict[i] and color[v] == 'white':
Q.append(v)
... | s402786180 | Accepted | 760 | 46,412 | 985 | from collections import deque
def bfs(root):
global time
Q = deque()
distance[root] = 0
Q.append(root)
i = root
while len(Q) > 0:
i = Q.popleft()
for v in adjDict[i]:
if color[v] == 'white':
Q.append(v)
color[v] = 'gray'
... |
s768407074 | p00004 | u299798926 | 1,000 | 131,072 | Wrong Answer | 20 | 7,592 | 230 | 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. | while 1:
try:
a,b,c,d,e,f=[int(i) for i in input().split()]
y=float((c*d-f*a)/(b*d-e*a))
x=float((c-b*y)/a)
print("{0:.4f}".format(x)," ","{0:.4f}".format(y))
except EOFError:
break | s056732007 | Accepted | 30 | 7,604 | 226 | while 1:
try:
a,b,c,d,e,f=[int(i) for i in input().split()]
y=float((c*d-f*a)/(b*d-e*a))
x=float((c-b*y)/a)
print("{0:.3f}".format(x),"{0:.3f}".format(y))
except EOFError:
break |
s754756479 | p00780 | u078042885 | 8,000 | 131,072 | Wrong Answer | 2,130 | 8,924 | 327 | **Goldbach's Conjecture:** For any even number _n_ greater than or equal to 4, there exists at least one pair of prime numbers _p_ 1 and _p_ 2 such that _n_ = _p_ 1 \+ _p_ 2. This conjecture has not been proved nor refused yet. No one is sure whether this conjecture actually holds. However, one can find such a pair of... | N=32768
p=[i for i in range(N)]
for i in range(2,int(N**0.5)+1):
if p[i]:
for j in range(i*i,N,i):p[j]=0
p=sorted(set(p))[2:]
print(p)
while 1:
n=int(input())
if n==0:break
c=0
if n&1:c=int(n-2 in p)
else:
for x in p:
if x>n//2:break
if n-x in p:c+=1
p... | s823809850 | Accepted | 2,120 | 8,900 | 318 | N=32768
p=[i for i in range(N)]
for i in range(2,int(N**0.5)+1):
if p[i]:
for j in range(i*i,N,i):p[j]=0
p=sorted(set(p))[2:]
while 1:
n=int(input())
if n==0:break
c=0
if n&1:c=int(n-2 in p)
else:
for x in p:
if x>n//2:break
if n-x in p:c+=1
print(c) |
s766838428 | p00330 | u350064373 | 1,000 | 262,144 | Wrong Answer | 30 | 7,284 | 23 | コンピュータで扱われるデータの最小単位をビット(bit)と呼び、複数のビットをまとめて表した情報量をワード(word)と呼びます。現在、多くのコンピュータでは1ワードを32ビットとして処理しています。 1ワードを32ビットで表すコンピュータについて、ワード単位で与えられたデータ量 W をビット単位で出力するプログラムを作成せよ。 | W = input()
print(W*32) | s936921987 | Accepted | 20 | 7,640 | 26 | print( int( input()) * 32) |
s924421242 | p02255 | u870370075 | 1,000 | 131,072 | Wrong Answer | 30 | 5,588 | 191 | 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())
arr=list(map(int,input().split()))
for i in range(1,n):
v=arr[i]
j=i-1
while j>=0 and arr[j]>v:
arr[j+1]=arr[j]
j-=1
arr[j+1]=v
print(' '.join(map(str,arr)))
| s562840371 | Accepted | 20 | 5,596 | 221 | n=int(input())
arr=list(map(int,input().split()))
print(' '.join(map(str,arr)))
for i in range(1,n):
v=arr[i]
j=i-1
while j>=0 and arr[j]>v:
arr[j+1]=arr[j]
j-=1
arr[j+1]=v
print(' '.join(map(str,arr)))
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.