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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
s159371039 | p02412 | u104931506 | 1,000 | 131,072 | Wrong Answer | 30 | 7,556 | 270 | Write a program which identifies the number of combinations of three integers which satisfy the following conditions: * You should select three distinct integers from 1 to n. * A total sum of the three integers is x. For example, there are two combinations for n = 5 and x = 9. * 1 + 3 + 5 = 9 * 2 + 3 + 4 = 9 | while True:
n, x = map(int, input().split())
if n == x == 0:
break
result = 0
for a in range(1, x // 3):
for b in range(a + 1, x // 2):
c = x - a - b
if b < c <= n:
result += 1
print(result) | s163874799 | Accepted | 30 | 7,656 | 266 | while True:
n, x = map(int, input().split())
if n == x == 0:
break
result = 0
for a in range(1, x // 3):
for b in range(a + 1, x // 2):
c = x - a - b
if b < c <= n:
result += 1
print(result) |
s957136479 | p03737 | u516447519 | 2,000 | 262,144 | Wrong Answer | 28 | 9,024 | 80 | 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 = [str(i) for i in input().split()]
s = a[0]+b[0]+c[0]
print(a.upper())
| s745378070 | Accepted | 29 | 8,960 | 79 | a,b,c = [str(i) for i in input().split()]
s = a[0]+b[0]+c[0]
print(s.upper()) |
s841161713 | p02612 | u549161102 | 2,000 | 1,048,576 | Wrong Answer | 31 | 9,148 | 52 | 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())
ans = N - (N//1000)*1000
print(ans) | s199022175 | Accepted | 30 | 9,160 | 94 | N = int(input())
if N%1000==0:
print('0')
exit()
ans = ((N//1000)+1)*1000-N
print(ans) |
s777592075 | p03471 | u257226830 | 2,000 | 262,144 | Wrong Answer | 1,440 | 3,064 | 303 | 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())
count = 0
for l in range(N+1):
for m in range(N+1):
n = N-l-m
if 0<=n<=N:
y = 10000*l+5000*m+1000*n
if y==Y:
list = [l,m,n]
count = count+1
if count>=1:
print(list)
else:
print([-1,-1,-1]) | s552659975 | Accepted | 1,385 | 3,064 | 324 | N,Y = map(int,input().split())
count = 0
for l in range(N+1):
for m in range(N+1):
n = N-l-m
if 0<=n<=N:
y = 10000*l+5000*m+1000*n
if y==Y:
list = [l,m,n]
count = count+1
if count>=1:
print(list[0], list[1], list[2])
else:
print(-1, -1,... |
s656612163 | p03700 | u894844146 | 2,000 | 262,144 | Wrong Answer | 264 | 7,512 | 244 | You are going out for a walk, when you suddenly encounter N monsters. Each monster has a parameter called _health_ , and the health of the i-th monster is h_i at the moment of encounter. A monster will vanish immediately when its health drops to 0 or below. Fortunately, you are a skilled magician, capable of causing e... | import math
x=list(map(int,input().split(" ")))
n=x[0]
y=x[1]
z=x[2]
a =[]
for i in range(n):
a.append(int(input()))
a.sort(reverse=True)
count=0
for c in a:
if c>=count*z:
count+=math.ceil((c-count*z)/y)
print(count)
| s953093358 | Accepted | 1,187 | 7,400 | 559 | import math
n, a, b = map(int, input().split(" "))
h = []
for i in range(n):
h.append(int(input()))
h.sort(reverse=True)
def check(count_target, h, a, b):
count = 0
for i in h:
if i >= count_target * b:
count += math.ceil((i - count_target * b) / (a - b))
return count_target - ... |
s371526656 | p02390 | u382692819 | 1,000 | 131,072 | Wrong Answer | 20 | 7,600 | 73 | 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 = input()
S = int(s)
h=S//3600
m=S%3600//60
s=m%60
print(h,":",m,":",s) | s248690967 | Accepted | 20 | 7,668 | 117 | s = input()
S = int(s)
h=S//3600
m=S%3600//60
s=S-(h*3600+m*60)
a=[h,m,s]
a_str = map(str,a)
print (":".join(a_str)) |
s827358177 | p02669 | u749742659 | 2,000 | 1,048,576 | Wrong Answer | 455 | 34,728 | 1,427 | You start with the number 0 and you want to reach the number N. You can change the number, paying a certain amount of coins, with the following operations: * Multiply the number by 2, paying A coins. * Multiply the number by 3, paying B coins. * Multiply the number by 5, paying C coins. * Increase or decrease... | import sys
from functools import lru_cache
sys.setrecursionlimit(10000)
t = int(input())
l = [list(map(int, input().split())) for i in range(t)]
@lru_cache(maxsize=10**18)
def min_coin(n,i):
if(n == 1):
return l[i][4]
else:
if(n%2 == 0):
a = min_coin(n//2,i)
else:
... | s943456894 | Accepted | 215 | 12,204 | 1,019 | import sys
from functools import lru_cache
sys.setrecursionlimit(1000000)
t = int(input())
l = [list(map(int, input().split())) for i in range(t)]
for i in range(t):
N = l[i][0]
A = l[i][1]
B = l[i][2]
C = l[i][3]
D = l[i][4]
@lru_cache(maxsize=10**18)
def min_coin(n):
if(n == 0)... |
s016066785 | p03555 | u735069283 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 96 | 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. | a=str(input())
b=str(input())
print('Yes' if a[0]==b[2] and a[1]==b[1] and a[2]==b[0] else 'No') | s399750215 | Accepted | 17 | 2,940 | 96 | a=str(input())
b=str(input())
print('YES' if a[0]==b[2] and a[1]==b[1] and a[2]==b[0] else 'NO') |
s276764355 | p02606 | u853728588 | 2,000 | 1,048,576 | Wrong Answer | 28 | 9,116 | 102 | How many multiples of d are there among the integers between L and R (inclusive)? | l, r, d = map(int,input().split())
count = 0
for i in range(l,r):
i%d == 0
count += 1
print(count) | s938043596 | Accepted | 28 | 9,060 | 111 | l, r, d = map(int,input().split())
count = 0
for i in range(l,r+1):
if i%d == 0:
count += 1
print(count) |
s714971133 | p02409 | u518824954 | 1,000 | 131,072 | Wrong Answer | 20 | 5,624 | 1,225 | You manage 4 buildings, each of which has 3 floors, each of which consists of 10 rooms. Write a program which reads a sequence of tenant/leaver notices, and reports the number of tenants for each room. For each notice, you are given four integers b, f, r and v which represent that v persons entered to room r of fth fl... | n=int(input())
build,story,room,people=[],[],[],[]
for i in range(n):
date=list(map(int,input().split(' ')))
build.append(date[0])
story.append(date[1])
room.append(date[2])
people.append(date[3])
build1=[[0 for i in range(10)] for j in range(3)]
build2=[[0 for i in range(10)] for j in range(3)]
bui... | s379612832 | Accepted | 20 | 5,632 | 1,216 | n=int(input())
build,story,room,people=[],[],[],[]
for i in range(n):
date=list(map(int,input().split(' ')))
build.append(date[0])
story.append(date[1])
room.append(date[2])
people.append(date[3])
build1=[[0 for i in range(10)] for j in range(3)]
build2=[[0 for i in range(10)] for j in range(3)]
bui... |
s489872839 | p03140 | u227082700 | 2,000 | 1,048,576 | Wrong Answer | 17 | 3,060 | 171 | 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... | n=int(input());aa=[input()for i in range(3)];ans=0
for i in range(n):
a,b,c=aa[0][i],aa[1][i],aa[2][i]
if not a==b==c:
if a!=b!=c:ans+=2
else:ans+=1
print(ans) | s028113220 | Accepted | 17 | 3,060 | 174 | n=int(input());aa=[input()for i in range(3)];ans=0
for i in range(n):
a,b,c=aa[0][i],aa[1][i],aa[2][i]
if not a==b==c:
if a!=b!=c!=a:ans+=2
else:ans+=1
print(ans) |
s851051647 | p03501 | u453526259 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 80 | You are parking at a parking lot. You can choose from the following two fee plans: * Plan 1: The fee will be A×T yen (the currency of Japan) when you park for T hours. * Plan 2: The fee will be B yen, regardless of the duration. Find the minimum fee when you park for N hours. | a,b,c = map(int, input().split())
if a*b > c:
print(a*b)
else:
print(c) | s273594011 | Accepted | 17 | 2,940 | 80 | a,b,c = map(int, input().split())
if a*b < c:
print(a*b)
else:
print(c) |
s574315654 | p03505 | u905715926 | 2,000 | 262,144 | Wrong Answer | 18 | 2,940 | 111 | _ButCoder Inc._ runs a programming competition site called _ButCoder_. In this site, a user is given an integer value called rating that represents his/her skill, which changes each time he/she participates in a contest. The initial value of a new user's rating is 0, and a user whose rating reaches K or higher is calle... | p,a,b = map(int,input().split())
if(a<=b):
print(-1)
else:
p-=a
up=a-b
num=int(p/up+0.5)
print(num+1) | s666200345 | Accepted | 17 | 2,940 | 185 | p,a,b = map(int,input().split())
if(a<=b):
if(a>=p):
print(1)
else:
print(-1)
else:
p-=a
up=a-b
if(p<=0):
print(1)
else:
num=p//up+(p%up!=0)
print(num*2+1)
|
s753356047 | p02663 | u125269142 | 2,000 | 1,048,576 | Wrong Answer | 21 | 9,164 | 174 | In this problem, we use the 24-hour clock. Takahashi gets up exactly at the time H_1 : M_1 and goes to bed exactly at the time H_2 : M_2. (See Sample Inputs below for clarity.) He has decided to study for K consecutive minutes while he is up. What is the length of the period in which he can start studying? | h1, m1, h2, m2, k = map(int, input().split())
start = (60 * h1) + m1
end = (60 * h2) + m2 - k
print(start-end) | s759104730 | Accepted | 22 | 9,100 | 178 | h1, m1, h2, m2, k = map(int, input().split())
start = (60 * h1) + m1
end = (60 * h2) + m2 - k
print(end - start) |
s725458852 | p00441 | u797673668 | 5,000 | 131,072 | Wrong Answer | 60 | 7,768 | 540 | 昔, そこには集落があり, 多くの人が暮らしていた. 人々は形も大きさも様々な建物を建てた. だが, それらの建造物は既に失われ, 文献と, 遺跡から見つかった柱だけが建造物の位置を知る手がかりだった. 文献には神殿の記述がある. 神殿は上から見ると正確に正方形になっており, その四隅には柱があった. 神殿がどの向きを向いていたかはわからない. また, 辺上や内部に柱があったかどうかもわからない. 考古学者たちは, 遺跡から見つかった柱の中で, 正方形になっているもののうち, 面積が最大のものが神殿に違いないと考えた. 柱の位置の座標が与えられるので, 4 本の柱でできる正方形のうち面積が最大のものを探し, その面積を出力するプ... | n = int(input())
poles = [tuple(map(int, input().split())) for _ in range(n)]
poles_set = set(poles)
max_square = 0
for i in range(n):
x1, y1 = poles[i]
for j in range(i, n):
x2, y2 = poles[j]
dx, dy = x2 - x1, y2 - y1
if ((x2 + dy, y2 - dx) in poles_set and (x1 + dy, y1 - dx) in poles... | s590068124 | Accepted | 17,870 | 8,812 | 640 | while True:
n = int(input())
if not n:
break
poles = [tuple(map(int, input().split())) for _ in range(n)]
poles_set = set(poles)
max_square = 0
for i in range(n):
x1, y1 = poles[i]
for j in range(i, n):
x2, y2 = poles[j]
dx, dy = x2 - x1, y2 - y1... |
s513251685 | p03836 | u977193988 | 2,000 | 262,144 | Wrong Answer | 17 | 3,060 | 187 | 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 ... | sx,sy,tx,ty=map(int,input().split())
ans_1='U'*(ty-sy)+'R'*(tx-ty)+'D'*(ty-sy)+'L'*(tx-sx)
ans_2='L'+'U'*(ty-sy+1)+'R'*(tx-ty+1)+'D'+'R'+'D'*(ty-sy+1)+'L'*(tx-sx+1)+'U'
print(ans_1+ans_2) | s324384652 | Accepted | 17 | 3,060 | 187 | sx,sy,tx,ty=map(int,input().split())
ans_1='U'*(ty-sy)+'R'*(tx-sx)+'D'*(ty-sy)+'L'*(tx-sx)
ans_2='L'+'U'*(ty-sy+1)+'R'*(tx-sx+1)+'D'+'R'+'D'*(ty-sy+1)+'L'*(tx-sx+1)+'U'
print(ans_1+ans_2) |
s280553027 | p02422 | u283452598 | 1,000 | 131,072 | Wrong Answer | 20 | 7,684 | 423 | Write a program which performs a sequence of commands to a given string $str$. The command is one of: * print a b: print from the a-th character to the b-th character of $str$ * reverse a b: reverse from the a-th character to the b-th character of $str$ * replace a b p: replace from the a-th character to the b-t... | moto = input()
num = int(input())
for i in range(num):
order = input().split()
if order[0] == "print":
m,n=int(order[1]),int(order[2])
print(moto[m:n+1])
elif order[0] == "reverse":
m,n=int(order[1]),int(order[2])
moto = moto[:m]+moto[n:m-1:-1]+moto[n:]
elif order[0] == ... | s233844772 | Accepted | 20 | 7,704 | 430 | moto = input()
num = int(input())
for i in range(num):
order = input().split()
if order[0] == "print":
m,n=int(order[1]),int(order[2])
print(moto[m:n+1])
elif order[0] == "reverse":
m,n=int(order[1]),int(order[2])
moto = moto[:m]+moto[m:n+1][::-1]+moto[n+1:]
elif order[0... |
s758721842 | p02420 | u177808190 | 1,000 | 131,072 | Wrong Answer | 20 | 5,556 | 338 | Your task is to shuffle a deck of n cards, each of which is marked by a alphabetical letter. A single shuffle action takes out h cards from the bottom of the deck and moves them to the top of the deck. The deck of cards is represented by a string as follows. abcdeefab The first character and the las... | string = ''
count = 0
while True:
hoge = input().strip()
if hoge == '-':
print (string)
break
if len(hoge) != 1:
if string:
print (string)
string = hoge
count = 0
else:
if count == 0:
continue
string = string[int(hoge):] + s... | s353733997 | Accepted | 20 | 5,596 | 375 | string = ''
while True:
hoge = input().strip()
if hoge == '-':
print (string)
break
if hoge.isalpha():
if string:
print (string)
string = hoge
count = 0
else:
if count == 0:
count = hoge
continue
else:
... |
s816752228 | p03999 | u699699071 | 2,000 | 262,144 | Wrong Answer | 33 | 3,444 | 261 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | S=input()
result = 0
for i in range(1 << len(S)-1):
hoge=S[0]
for j in range( len(S)-1 ):
print("i>>j",i>>j)
if i>>j&1 :
hoge+="+"
hoge+=S[j+1]
print(hoge)
result += eval(hoge)
print(result) | s441548202 | Accepted | 27 | 3,060 | 218 | S=input()
result = 0
for i in range(1 << len(S)-1):
hoge=S[0]
for j in range( len(S)-1 ):
if i>>j&1 :
hoge+="+"
hoge+=S[j+1]
result += eval(hoge)
print(result) |
s752671108 | p03693 | u839246671 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 94 | 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... | N = list(map(int,input().split()))
if N[1]*10+N[2] // 4 == 0:
print("YES")
else:
print("NO") | s453385622 | Accepted | 17 | 2,940 | 96 | N = list(map(int,input().split()))
if (N[1]*10+N[2]) % 4 == 0:
print("YES")
else:
print("NO") |
s183307585 | p03644 | u821588465 | 2,000 | 262,144 | Wrong Answer | 31 | 9,060 | 64 | Takahashi loves numbers divisible by 2. You are given a positive integer N. Among the integers between 1 and N (inclusive), find the one that can be divisible by 2 for the most number of times. The solution is always unique. Here, the number of times an integer can be divisible by 2, is how many times the integer can... | print(len(bin(7)))
n = int(input())
print(2**(len(bin(n))-3))
| s760993643 | Accepted | 26 | 9,112 | 42 | n = int(input())
print(2**(len(bin(n))-3)) |
s335485995 | p03644 | u072717685 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 55 | Takahashi loves numbers divisible by 2. You are given a positive integer N. Among the integers between 1 and N (inclusive), find the one that can be divisible by 2 for the most number of times. The solution is always unique. Here, the number of times an integer can be divisible by 2, is how many times the integer can... | n = int(input())
r = 1
while r <= n:
r *= 2
print(r) | s679441061 | Accepted | 18 | 2,940 | 62 | n = int(input())
r = 1
while r <= n:
r *= 2
print(int(r/2)) |
s651798983 | p04012 | u886274153 | 2,000 | 262,144 | Wrong Answer | 18 | 3,060 | 292 | 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. | w = input()
mp = dict()
for c in w:
if c in mp:
mp[c] += 1
else:
mp[c] = 1
print(mp)
def check(w):
c = "Yes"
for i in w:
if i % 2 == 0:
continue
else:
c = "No"
break
return c
print(check(mp.values())) | s318284995 | Accepted | 18 | 2,940 | 281 | w = input()
mp = dict()
for c in w:
if c in mp:
mp[c] += 1
else:
mp[c] = 1
def check(w):
c = "Yes"
for i in w:
if i % 2 == 0:
continue
else:
c = "No"
break
return c
print(check(mp.values())) |
s214542502 | p03160 | u634461073 | 2,000 | 1,048,576 | Wrong Answer | 142 | 13,980 | 178 | 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()))
c = [0]*n
c[1]=abs(h[1]-h[0])
for i in range(1,n):
c[i]=min(c[i-2]+abs(h[i]-h[i-2]),c[i-1]+abs(h[i]-h[i-1]))
print(c[n-1]) | s634439737 | Accepted | 139 | 13,928 | 179 | n = int(input())
h = list(map(int,input().split()))
c = [0]*n
c[1]=abs(h[1]-h[0])
for i in range(2,n):
c[i]=min(c[i-2]+abs(h[i]-h[i-2]),c[i-1]+abs(h[i]-h[i-1]))
print(c[n-1])
|
s368499499 | p03722 | u550943777 | 2,000 | 262,144 | Wrong Answer | 238 | 3,572 | 802 | There is a directed graph with N vertices and M edges. The i-th edge (1≤i≤M) points from vertex a_i to vertex b_i, and has a weight c_i. We will play the following single-player game using this graph and a piece. Initially, the piece is placed at vertex 1, and the score of the player is set to 0. The player can move t... | n, m = map(int,input().split())
a = []
b = []
c = []
ed_list = [[] for _ in range(n)]
for i in range(m):
t_a, t_b, t_c = map(int,input().split())
a.append(t_a-1)
b.append(t_b-1)
c.append(t_c)
ed_list[t_a - 1].append(t_b - 1)
def loop_judge(ed_list):
stack = [0]
post = set()
while stack:... | s826511128 | Accepted | 1,423 | 3,572 | 648 | n, m = map(int,input().split())
edge = []
c = []
ed_list = [[] for _ in range(n)]
for i in range(m):
t_a, t_b, t_c = map(int,input().split())
edge.append([t_a - 1, t_b - 1])
c.append(-t_c)
ed_list[t_a - 1].append(t_b - 1)
INF = float('inf')
score = [INF for _ in range(n)]
score[0] = 0
for i in range(n... |
s280698862 | p03377 | u745087332 | 2,000 | 262,144 | Wrong Answer | 16 | 2,940 | 167 | 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. | # coding:utf-8
INF = float('inf')
def inpl(): return list(map(int, input().split()))
A, B, X = inpl()
if A + B >= X >= A:
print('Yes')
else:
print('No')
| s347731666 | Accepted | 17 | 2,940 | 167 | # coding:utf-8
INF = float('inf')
def inpl(): return list(map(int, input().split()))
A, B, X = inpl()
if A + B >= X >= A:
print('YES')
else:
print('NO')
|
s454595176 | p03730 | u077291787 | 2,000 | 262,144 | Wrong Answer | 17 | 3,060 | 200 | 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 = list(map(int, input().rstrip().split()))
for i in range(a, a * b + 1, a):
print(i)
if i % b == c:
print("YES")
break
else:
print("NO") | s465737838 | Accepted | 17 | 2,940 | 246 |
def main():
A, B, C = tuple(map(int, input().split()))
for i in range(A, A * B + 1, A):
if i % B == C:
print("YES")
return
print("NO")
if __name__ == "__main__":
main() |
s536299192 | p03494 | u972658925 | 2,000 | 262,144 | Wrong Answer | 18 | 2,940 | 148 | 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. | ans = 10**9
N = int(input())
A = list(map(int,input().split()))
for i in A:
p = 0
while i % 2 == 0:
i //= 2
p += 1
print(p) | s396821963 | Accepted | 18 | 2,940 | 181 | ans = 10**9
N = int(input())
A = list(map(int,input().split()))
for i in A:
p = 0
while i % 2 == 0:
i //= 2
p += 1
if p < ans:
ans = p
print(ans) |
s645119116 | p03473 | u571685561 | 2,000 | 262,144 | Wrong Answer | 18 | 3,064 | 67 | How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? | M = input()
rest = 24 - (int(M)%24)
print(str(rest+24) + "Hours")
| s123925810 | Accepted | 17 | 2,940 | 52 | M = input()
rest = 24 - (int(M)%24)
print(rest+24)
|
s202271949 | p02612 | u407702479 | 2,000 | 1,048,576 | Wrong Answer | 34 | 9,140 | 28 | 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) | s172213105 | Accepted | 26 | 9,152 | 70 | N=int(input())
if N%1000!=0:
print(1000-N%1000)
else:
print(0) |
s235754630 | p03730 | u440161695 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 117 | 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())
for i in range(2*B):
if ((i*A)%B)==C:
print("Yes")
break
else:
print("No") | s639578666 | Accepted | 17 | 2,940 | 117 | A,B,C=map(int,input().split())
for i in range(2*B):
if ((i*A)%B)==C:
print("YES")
break
else:
print("NO") |
s215504441 | p03860 | u275934251 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 138 | Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters. Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppe... | s = input()
t = "Atcoder" + s + "Contest"
u = ""
for i in t:
if i == i.lower():
continue
else:
u += i
print(u) | s342208685 | Accepted | 18 | 2,940 | 43 | a,b,c=input().split()
print(a[0]+b[0]+c[0]) |
s142472590 | p03418 | u934868410 | 2,000 | 262,144 | Wrong Answer | 60 | 2,940 | 118 | Takahashi had a pair of two positive integers not exceeding N, (a,b), which he has forgotten. He remembers that the remainder of a divided by b was greater than or equal to K. Find the number of possible pairs that he may have had. | n,k = map(int, input().split())
ans = 0
for b in range(1, n+1):
ans += (n // b) * (b-k) + (n % b) - (k-1)
print(ans) | s011899989 | Accepted | 113 | 3,060 | 239 | n,k = map(int, input().split())
ans = 0
for b in range(1, n+1):
ans += (n // b) * max(0, b-k)
if n % b > 0:
if k == 0:
ans += max(0, (n % b) - k)
else:
ans += max(0, (n%b) - k + 1)
print(ans) |
s664445664 | p03377 | u611090896 | 2,000 | 262,144 | Wrong Answer | 19 | 3,060 | 78 | 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") | s600824325 | Accepted | 18 | 2,940 | 80 | a,b,x = map(int,input().split())
print('YES' if x >= a and (a+b) >= x else 'NO') |
s347967045 | p03597 | u382431597 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 43 | We have an N \times N square grid. We will paint each square in the grid either black or white. If we paint exactly A squares white, how many squares will be painted black? | n=int(input())
a=int(input())
print(n^2 -a) | s919534129 | Accepted | 17 | 2,940 | 45 | n=int(input())
a=int(input())
print(n**2 -a)
|
s994395254 | p03023 | u221345507 | 2,000 | 1,048,576 | Wrong Answer | 18 | 2,940 | 37 | Given an integer N not less than 3, find the sum of the interior angles of a regular polygon with N sides. Print the answer in degrees, but do not print units. | N = int(input())
print((180-360/N)*N) | s062739370 | Accepted | 17 | 2,940 | 43 | N = int(input())
print(int((180-360/N)*N))
|
s640000155 | p02831 | u596979123 | 2,000 | 1,048,576 | Wrong Answer | 17 | 3,060 | 201 | 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 ... | str = list(map(int, input().split()))
a = str[0]
b = str[1]
i = 1
if a < b:
big = b
small = a
else:
big = a
small = b
while i != 0:
i = big % small
big = small
small = i
print (a*b/big) | s837413987 | Accepted | 17 | 3,060 | 206 | str = list(map(int, input().split()))
a = str[0]
b = str[1]
i = 1
if a < b:
big = b
small = a
else:
big = a
small = b
while i != 0:
i = big % small
big = small
small = i
print (int(a*b/big)) |
s022098263 | p03565 | u045170811 | 2,000 | 262,144 | Wrong Answer | 17 | 3,064 | 510 | E869120 found a chest which is likely to contain treasure. However, the chest is locked. In order to open it, he needs to enter a string S consisting of lowercase English letters. He also found a string S', which turns out to be the string S with some of its letters (possibly all or none) replaced with `?`. One mo... | s = input()
t = input()
match = -1
for i in range(len(s) - len(t) + 1):
is_term_match = True
for j in range(len(t)):
if s[i + j] != "?" and s[i + j] != t[j]:
is_term_match = False
break
if is_term_match:
match = i
break
if match == -1:
print("UNRESTORABL... | s491762789 | Accepted | 17 | 3,064 | 519 | s = input()
t = input()
match = -1
if len(s) >= len(t):
for i in range(len(s) - len(t) + 1):
is_term_match = True
for j in range(len(t)):
if s[i + j] != "?" and s[i + j] != t[j]:
is_term_match = False
break
if is_term_match:
match = i
... |
s605549524 | p03377 | u273242084 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 94 | 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 a+b >= x and a <=x:
print("Yes")
else:
print("No") | s373271240 | Accepted | 17 | 2,940 | 94 | a,b,x = map(int,input().split())
if a+b >= x and a <=x:
print("YES")
else:
print("NO") |
s688379327 | p03129 | u784169501 | 2,000 | 1,048,576 | Wrong Answer | 18 | 2,940 | 184 | Determine if we can choose K different integers between 1 and N (inclusive) so that no two of them differ by 1. | import math
def solution(N, K):
if (math.ceil((N + 1) / 2) >= K):
return "YES"
else:
return "NO"
n, k = [int(s) for s in input().split(' ')]
solution(n, k)
| s492402574 | Accepted | 18 | 2,940 | 192 | import math
def solution(N, K):
if (math.floor((N + 1) / 2) >= K):
return "YES"
else:
return "NO"
n, k = [int(s) for s in input().split(' ')]
print(solution(n, k))
|
s051876765 | p03623 | u186838327 | 2,000 | 262,144 | Wrong Answer | 18 | 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') | s154797083 | Accepted | 18 | 2,940 | 91 | x, a, b = map(int, input().split())
if abs(x-a) > abs(x-b):
print('B')
else:
print('A') |
s256076693 | p03861 | u061912210 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 51 | 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())
print(b//x - a//x) | s030419601 | Accepted | 18 | 2,940 | 93 | a,b,x = map(int,input().split())
if a == 0:
print(b//x + 1)
else:
print(b//x - (a-1)//x) |
s774014979 | p03720 | u063073794 | 2,000 | 262,144 | Wrong Answer | 17 | 3,060 | 262 | There are N cities and M roads. The i-th road (1≤i≤M) connects two cities a_i and b_i (1≤a_i,b_i≤N) bidirectionally. There may be more than one road that connects the same pair of two cities. For each city, how many roads are connected to the city? | a,b=map(int,input().split())
d=dict()
for i in range(b):
s,l=input().split()
if s in d.keys():
d[s]+=1
if l in d.keys():
d[l]+=1
else:
d[l]=1
else:
d[s]=1
if l in d.keys():
d[l]+=1
else:
d[l]=1
print(d.keys) | s288742713 | Accepted | 17 | 2,940 | 144 | n,m=map(int,input().split())
l=[0]*n
for i in range(m):
a,b=map(int,input().split())
l[a-1]+=1
l[b-1]+=1
for i in range(n):
print(l[i])
|
s101509610 | p03591 | u224226076 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 209 | Ringo is giving a present to Snuke. Ringo has found out that Snuke loves _yakiniku_ (a Japanese term meaning grilled meat. _yaki_ : grilled, _niku_ : meat). He supposes that Snuke likes grilled things starting with `YAKI` in Japanese, and does not like other things. You are given a string S representing the Japanese ... | # -*- coding: utf-8 -*-
"""
Created on Sat Sep 23 20:49:53 2017
@author: thvinmei
"""
if __name__ == '__main__':
S=input()
if (S[0:4]=="YAKI"):
print("YES")
else:
print("NO") | s044489704 | Accepted | 17 | 2,940 | 209 | # -*- coding: utf-8 -*-
"""
Created on Sat Sep 23 20:49:53 2017
@author: thvinmei
"""
if __name__ == '__main__':
S=input()
if (S[0:4]=="YAKI"):
print("Yes")
else:
print("No") |
s551328192 | p03697 | u609738635 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 67 | You are given two integers A and B as the input. Output the value of A + B. However, if A + B is 10 or greater, output `error` instead. | A, B = map(int, input().split())
print("error") if A+B>=10 else A+B | s575936854 | Accepted | 17 | 2,940 | 74 | A, B = map(int, input().split())
print("error") if A+B>=10 else print(A+B) |
s800651272 | p03068 | u573310917 | 2,000 | 1,048,576 | Wrong Answer | 17 | 3,060 | 174 | 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 = int(input())
S = input()
K = int(input())
l = S[K - 1]
result = ""
print(l)
for s in S:
if s != l:
result += "*"
else:
result += s
print(result) | s906991477 | Accepted | 17 | 2,940 | 166 | N = int(input())
S = input()
K = int(input())
l = S[K - 1]
result = ""
for s in S:
if s != l:
result += "*"
else:
result += s
print(result)
|
s291432615 | p02261 | u000317780 | 1,000 | 131,072 | Wrong Answer | 20 | 7,760 | 1,118 | 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... | class Card:
def __init__(self, suit, value):
self.suit = suit
self.value = value
def selection(ls):
for i in range(len(ls)):
minj = i
for j in range(i, len(ls)):
if ls[j].value < ls[minj].value:
minj = j
ls[i], ls[minj] = ls[minj]... | s799629692 | Accepted | 30 | 7,784 | 1,212 | class Card:
def __init__(self, suit, value):
self.suit = suit
self.value = value
def selection(ls):
for i in range(len(ls)):
minj = i
for j in range(i, len(ls)):
if ls[j].value < ls[minj].value:
minj = j
ls[i], ls[minj] = ls[minj]... |
s437945593 | p03565 | u391475811 | 2,000 | 262,144 | Wrong Answer | 17 | 3,064 | 302 | E869120 found a chest which is likely to contain treasure. However, the chest is locked. In order to open it, he needs to enter a string S consisting of lowercase English letters. He also found a string S', which turns out to be the string S with some of its letters (possibly all or none) replaced with `?`. One mo... | S=input()
H=input()
slen=len(S)
hlen=len(H)
ans=False
for i in range(slen-hlen):
jud=True
for j in range(hlen):
if S[i+j]!='?' and S[i+j]!=H[j]:
jud=False
break
if jud:
S=S[:i]+H+S[i+hlen:]
ans=True
if ans:
S=S.replace('?','a')
print(S)
else:
print("UNRESTORABLE") | s822450152 | Accepted | 17 | 3,064 | 370 | S=input()
H=input()
slen=len(S)
hlen=len(H)
jisho=[]
ans=False
for i in range(slen-hlen+1):
jud=True
for j in range(hlen):
if S[i+j]!='?' and S[i+j]!=H[j]:
jud=False
break
if jud:
ansS=S[:i]+H+S[i+hlen:]
ans=True
ansS=ansS.replace('?','a')
jisho.append(ansS)
if ans:
jisho.sort... |
s537151021 | p03472 | u566159623 | 2,000 | 262,144 | Wrong Answer | 391 | 16,712 | 451 | You are going out for a walk, when you suddenly encounter a monster. Fortunately, you have N katana (swords), Katana 1, Katana 2, …, Katana N, and can perform the following two kinds of attacks in any order: * Wield one of the katana you have. When you wield Katana i (1 ≤ i ≤ N), the monster receives a_i points of d... | n, h = map(int, input().split())
a = [0]*n
b = [0]*n
maxa = 0
for i in range(n):
a[i], b[i] = map(int, input().split())
maxa = max(maxa, a[i])
b.sort()
bsum = sum(b)
count = n
if bsum >= h:
i = 0
while bsum - b[i] > h:
bsum -= b[i]
i += 1
count -= 1
else:
if (h - bsum) % ma... | s727373274 | Accepted | 405 | 12,140 | 596 | n, h = map(int, input().split())
a = [0]*n
b = [0]*n
maxa = 0
for i in range(n):
a[i], b[i] = map(int, input().split())
maxa = max(maxa, a[i])
c = []
for i in range(n):
if b[i] >= maxa:
c.append(b[i])
c.sort()
csum = sum(c)
count = len(c)
if csum >= h:
i = 0
while csum - c[i] >= h... |
s855203621 | p03377 | u088974156 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 81 | 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(a<=x<=a+b):
print("Yes")
else:
print("No") | s789861390 | Accepted | 17 | 2,940 | 81 | a,b,x =map(int,input().split())
if(a<=x<=a+b):
print("YES")
else:
print("NO") |
s569019780 | p03151 | u288430479 | 2,000 | 1,048,576 | Wrong Answer | 141 | 20,144 | 404 | 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())
l_a = list(map(int,input().split()))
l_b = list(map(int,input().split()))
if sum(l_a)<sum(l_b):
print(-1)
exit()
l_sa = sorted(list(i-j for i,j in zip(l_a,l_b)))
s = 0
cou =0
print(l_sa)
for i in l_sa:
if i<0:
s += i
cou +=1
else:
break
#print(s,cou)
l_sb = l_sa[::-1]
for i in l_sb:... | s215459990 | Accepted | 131 | 19,536 | 402 | n = int(input())
l_a = list(map(int,input().split()))
l_b = list(map(int,input().split()))
if sum(l_a)<sum(l_b):
print(-1)
exit()
l_sa = sorted(list(i-j for i,j in zip(l_a,l_b)))
s = 0
cou =0
#print(l_sa)
for i in l_sa:
if i<0:
s += i
cou +=1
else:
break
#print(s,cou)
l_sb = l_sa[::-1]
for i in l_sb... |
s555269640 | p03455 | u358791207 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 93 | 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 == 0:
print("Even")
else:
print("Odd")
| s634786747 | Accepted | 17 | 2,940 | 93 | a, b = map(int, input().split())
if a * b % 2 == 0:
print("Even")
else:
print("Odd")
|
s291928553 | p03999 | u620846115 | 2,000 | 262,144 | Wrong Answer | 29 | 9,084 | 125 | You are given a string S consisting of digits between `1` and `9`, inclusive. You can insert the letter `+` into some of the positions (possibly none) between two letters in this string. Here, `+` must not occur consecutively after insertion. All strings that can be obtained in this way can be evaluated as formulas. ... | n = input()
l = len(n)
ans = 0
for i in range(l):
for j in range(l-1):
ans+=int(n[i])*(10**j)*(2**(l-1-j-1))
print(ans) | s892845653 | Accepted | 23 | 9,016 | 149 | S = input()
n = len(S)
ans = 0
for i in range(n):
a = int(S[i])
for j in range(n-i):
ans += a * 10**j * 2**i * 2**(max(0,n-i-j-2))
print(ans) |
s687580824 | p03455 | u863442865 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 156 | AtCoDeer the deer found two positive integers, a and b. Determine whether the product of a and b is even or odd. | a, b = input().split()
c = int(a+b)
def d(c):
for i in range(4, 400):
if i**2 == c:
return print('Yes')
return print('No')
d(c) | s563672448 | Accepted | 17 | 2,940 | 79 | a, b = map(int, input().split())
if (a*b) % 2: print('Odd')
else: print('Even') |
s148486077 | p03659 | u576335153 | 2,000 | 262,144 | Wrong Answer | 124 | 30,692 | 222 | Snuke and Raccoon have a heap of N cards. The i-th card from the top has the integer a_i written on it. They will share these cards. First, Snuke will take some number of cards from the top of the heap, then Raccoon will take all the remaining cards. Here, both Snuke and Raccoon have to take at least one card. Let th... | n = int(input())
a = list(map(int, input().split()))
s = sum(a)
x = 0
ans = abs(2 * a[0] - s)
snuke = 0
for i in range(1, n-1):
snuke += 2 * a[i]
if abs(snuke - s) < ans:
ans = abs(snuke - s)
print(ans)
| s154139080 | Accepted | 126 | 30,484 | 229 | n = int(input())
a = list(map(int, input().split()))
s = sum(a)
x = 0
ans = abs(2 * a[0] - s)
snuke = a[0]
for i in range(1, n-1):
snuke += a[i]
if abs(2 * snuke - s) < ans:
ans = abs(2 * snuke - s)
print(ans)
|
s807895501 | p02694 | u502594696 | 2,000 | 1,048,576 | Wrong Answer | 30 | 9,120 | 68 | 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())
i=100
l=0
while i<=X:
i=int(i*1.01)
l+=1
print(l) | s904913633 | Accepted | 31 | 9,128 | 72 | X=int(input())
i=100
year=0
while i<X:
i+=i//100
year+=1
print(year) |
s786923782 | p03813 | u102242691 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 89 | Smeke has decided to participate in AtCoder Beginner Contest (ABC) if his current rating is less than 1200, and participate in AtCoder Regular Contest (ARC) otherwise. You are given Smeke's current rating, x. Print `ABC` if Smeke will participate in ABC, and print `ARC` otherwise. |
s = input()
a_index = s.find("A")
b_index = s.rfind("Z")
print(b_index - a_index + 1)
| s795372584 | Accepted | 17 | 2,940 | 72 |
x = int(input())
if x < 1200:
print("ABC")
else:
print("ARC")
|
s305995300 | p04044 | u191635495 | 2,000 | 262,144 | Wrong Answer | 105 | 18,036 | 977 | Iroha has a sequence of N strings S_1, S_2, ..., S_N. The length of each string is L. She will concatenate all of the strings in some order, to produce a long string. Among all strings that she can produce in this way, find the lexicographically smallest one. Here, a string s=s_1s_2s_3...s_n is _lexicographically sm... | N, L = map(int, input().split())
S = []
master = 'abcdefghijklmnopqrstuvwxyz'
def f(s1, s2, l):
for i in range(l):
if master.index(s1[i]) == master.index(s2[i]):
continue
elif master.index(s1[i]) > master.index(s2[i]):
return 'greater'
elif master.index(s1[i]) < mast... | s562330994 | Accepted | 22 | 3,064 | 920 | N, L = map(int, input().split())
S = []
master = 'abcdefghijklmnopqrstuvwxyz'
def f(s1, s2, l):
for i in range(l):
if master.index(s1[i]) == master.index(s2[i]):
continue
elif master.index(s1[i]) > master.index(s2[i]):
return 'greater'
elif master.index(s1[i]) < mast... |
s440189201 | p03139 | u597455618 | 2,000 | 1,048,576 | Wrong Answer | 18 | 2,940 | 85 | 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 = list(map(int, input().split()))
print(min(n[1], n[2]))
print(max(0, n[1] - n[2])) | s743338569 | Accepted | 17 | 2,940 | 86 | n = list(map(int, input().split()))
print(min(n[1], n[2]), max(0, n[1] + n[2] - n[0])) |
s663027727 | p02401 | u644636020 | 1,000 | 131,072 | Wrong Answer | 30 | 7,616 | 293 | 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. | while True:
a, op, b = input().split()
a = int(a)
b = int(b)
if op == '?':
break
if op == '+':
print(a + b)
if op == '-':
print(a - b)
if op == '*':
print(a * b)
if op == '/':
print(a / b) | s970773177 | Accepted | 20 | 7,644 | 294 | while True:
a, op, b = input().split()
a = int(a)
b = int(b)
if op == '?':
break
if op == '+':
print(a + b)
if op == '-':
print(a - b)
if op == '*':
print(a * b)
if op == '/':
print(a // b) |
s711317056 | p03448 | u277104886 | 2,000 | 262,144 | Wrong Answer | 48 | 3,060 | 222 | You have A 500-yen coins, B 100-yen coins and C 50-yen coins (yen is the currency of Japan). In how many ways can we select some of these coins so that they are X yen in total? Coins of the same kind cannot be distinguished. Two ways to select coins are distinguished when, for some kind of coin, the numbers of that co... | a = int(input())
b = int(input())
c = int(input())
x = int(input())
ans = 0
for i in range(a):
for j in range(b):
for k in range(c):
if 500*i + 100*j + 50*k == x:
ans += 1
print(ans) | s571038794 | Accepted | 49 | 3,060 | 228 | a = int(input())
b = int(input())
c = int(input())
x = int(input())
ans = 0
for i in range(a+1):
for j in range(b+1):
for k in range(c+1):
if 500*i + 100*j + 50*k == x:
ans += 1
print(ans) |
s005778315 | p03477 | u780212666 | 2,000 | 262,144 | Wrong Answer | 17 | 3,060 | 141 | A balance scale tips to the left if L>R, where L is the total weight of the masses on the left pan and R is the total weight of the masses on the right pan. Similarly, it balances if L=R, and tips to the right if L<R. Takahashi placed a mass of weight A and a mass of weight B on the left pan of a balance scale, and pl... | A, B, C, D= map(int, input().split())
L = A + B
R = C + D
if L >R:
print("Left")
if L < R:
print("Right")
else:
print("Balanced") | s522298130 | Accepted | 18 | 2,940 | 139 | A, B, C, D= map(int, input().split())
if A +B > C+D:
print("Left")
elif A+B < C+D:
print("Right")
else:
print("Balanced")
|
s094232527 | p02690 | u402629484 | 2,000 | 1,048,576 | Wrong Answer | 27 | 9,984 | 2,207 | Give a pair of integers (A, B) such that A^5-B^5 = X. It is guaranteed that there exists such a pair for the given integer X. | import sys
sys.setrecursionlimit(1000000000)
import math
from math import gcd
def lcm(a, b): return a * b // gcd(a, b)
from itertools import count, permutations, chain
from functools import lru_cache
from collections import deque, defaultdict
from pprint import pprint
ii = lambda: int(input())
mis = lambda: map(int, in... | s375403495 | Accepted | 31 | 8,904 | 252 | from itertools import count
def main():
X = int(input())
for i in count():
for A in (-i, i):
for B in range(-i, i+1):
if A**5 - B**5 == X:
print(A, B)
return
main()
|
s016995908 | p02613 | u671211357 | 2,000 | 1,048,576 | Wrong Answer | 154 | 16,328 | 282 | 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())
S=[input() for i in range(N)]
AC=0
WA=0
TLE=0
RE=0
for i in S:
if i =="WA":
WA+=1
elif i=="AC":
AC+=1
elif i=="TLE":
TLE+=1
else:
RE+=1
print("AC x "+str(AC))
print("WA x "+str(WA))
print("TLE x",TLE)
print("RE x",RE) | s126088605 | Accepted | 154 | 16,328 | 278 | N=int(input())
S=[input() for i in range(N)]
AC=0
WA=0
TLE=0
RE=0
for i in S:
if i =="WA":
WA+=1
elif i=="AC":
AC+=1
elif i=="TLE":
TLE+=1
else:
RE+=1
print("AC x",str(AC))
print("WA x",str(WA))
print("TLE x",TLE)
print("RE x",RE) |
s614338187 | p03485 | u416758623 | 2,000 | 262,144 | Wrong Answer | 18 | 2,940 | 67 | 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 = [int(x) for x in input().split()]
print(((a + b) // 2) + 1)
| s659280693 | Accepted | 18 | 2,940 | 69 | a,b = map(int, input().split())
total = a + b
print((total+2-1) // 2) |
s222470444 | p02742 | u215630013 | 2,000 | 1,048,576 | Wrong Answer | 18 | 2,940 | 137 | We have a board with H horizontal rows and W vertical columns of squares. There is a bishop at the top-left square on this board. How many squares can this bishop reach by zero or more movements? Here the bishop can only move diagonally. More formally, the bishop can move from the square at the r_1-th row (from the to... | h, w = map(int, input().split())
if h ==1 or w == 1:
print(1)
exit()
s =h* w
if s%2 ==1:
print(s/2 +0.5)
else:
print(s/2) | s714987741 | Accepted | 19 | 3,060 | 166 | import math
h, w = map(int, input().split())
if h ==1 or w == 1:
print(1)
exit()
s =h* w
if s%2 ==1:
print(int(math.ceil(s/2)))
else:
print(int(s/2)) |
s189331933 | p02393 | u697703458 | 1,000 | 131,072 | Wrong Answer | 20 | 5,592 | 86 | Write a program which reads three integers, and prints them in ascending order. | a=input()
b=a.split()
d=list()
for c in b:
d.append(int(c))
print(d[0],d[1],d[2])
| s716471651 | Accepted | 20 | 5,596 | 98 | a=input()
b=a.split()
d=list()
for c in b:
d.append(int(c))
d=sorted(d)
print(d[0],d[1],d[2])
|
s960978589 | p03693 | u792743880 | 2,000 | 262,144 | Wrong Answer | 32 | 9,040 | 110 | 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())
if (g % 2 == 0) and (b % 2 == 0):
print('YES')
else:
print('NO')
| s705591309 | Accepted | 27 | 9,096 | 124 | r, g, b = map(int, input().split())
rgb = int(r * 100 + g * 10 + b)
if rgb % 4 == 0:
print('YES')
else:
print('NO')
|
s605141600 | p03544 | u540761833 | 2,000 | 262,144 | Wrong Answer | 17 | 3,060 | 174 | It is November 18 now in Japan. By the way, 11 and 18 are adjacent Lucas numbers. You are given an integer N. Find the N-th Lucas number. Here, the i-th Lucas number L_i is defined as follows: * L_0=2 * L_1=1 * L_i=L_{i-1}+L_{i-2} (i≥2) | n = int(input())
a0 = 2
a1 = 1
if n == 1:
print(2)
elif n == 2:
print(1)
else:
for i in range(n-1):
a0,a1 = a1,(a0+a1)
print(a0,a1)
print(a1) | s207604418 | Accepted | 17 | 2,940 | 128 | n = int(input())
a0 = 2
a1 = 1
if n == 1:
print(1)
else:
for i in range(n-1):
a0,a1 = a1,(a0+a1)
print(a1)
|
s840055128 | p00003 | u914146430 | 1,000 | 131,072 | Wrong Answer | 50 | 7,580 | 184 | Write a program which judges wheather given length of three side form a right triangle. Print "YES" if the given sides (integers) form a right triangle, "NO" if not so. | N=int(input())
for i in range(N):
hens=list(map(int, input().split()))
hens.sort()
if hens[0]**2+hens[1]**2==hens[2]**2:
print("Yes")
else:
print("No") | s155829561 | Accepted | 40 | 7,512 | 184 | N=int(input())
for i in range(N):
hens=list(map(int, input().split()))
hens.sort()
if hens[0]**2+hens[1]**2==hens[2]**2:
print("YES")
else:
print("NO") |
s767535502 | p04043 | u460129720 | 2,000 | 262,144 | Wrong Answer | 18 | 3,060 | 227 | 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 ... | B = map(int, input().split())
counter = 0
five_seven_five = [5,7,5]
for i in B:
if i in five_seven_five:
counter += 1
five_seven_five.remove(i)
else:
print('No')
if counter ==3:
print('Yes') | s167833091 | Accepted | 17 | 3,060 | 233 | B = list(map(int, input().split()))
counter = 0
five_seven_five = [5,7,5]
for i in B:
if i in five_seven_five:
counter += 1
five_seven_five.remove(i)
else:
print('NO')
if counter ==3:
print('YES') |
s733797640 | p02612 | u922769680 | 2,000 | 1,048,576 | Wrong Answer | 30 | 9,148 | 40 | 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())
A=N//1000*1000
print(N-A) | s288355261 | Accepted | 27 | 9,152 | 86 | N=int(input())
A=(N//1000+1)*1000
if A-N==1000:
ans=0
else:
ans=A-N
print(ans) |
s978923691 | p00015 | u990228206 | 1,000 | 131,072 | Wrong Answer | 20 | 5,584 | 129 | 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 i in range(n):
a=int(input())
b=int(input())
if a+b>=10**79:print("overflow")
else:print(a+b)
| s625575862 | Accepted | 20 | 5,588 | 129 | n=int(input())
for i in range(n):
a=int(input())
b=int(input())
if a+b>=10**80:print("overflow")
else:print(a+b)
|
s070953438 | p03474 | u236536206 | 2,000 | 262,144 | Wrong Answer | 17 | 3,064 | 277 | 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()
print(s)
if s[a]!="-":
print("No")
#print(1)
elif s.count("-")>1:
print("No")
#print(2)
else:
s=s.replace("-","")
#print(3)
#print(s)
if s.isdigit()==True:
print("Yes")
else:
print("No") | s391742531 | Accepted | 18 | 3,060 | 279 |
a,b=map(int,input().split())
s=input()
#print(s)
if s[a]!="-":
print("No")
#print(1)
elif s.count("-")>1:
print("No")
#print(2)
else:
s=s.replace("-","")
#print(3)
#print(s)
if s.isdigit()==True:
print("Yes")
else:
print("No") |
s035767564 | p03378 | u313111801 | 2,000 | 262,144 | Wrong Answer | 27 | 9,160 | 128 | There are N + 1 squares arranged in a row, numbered 0, 1, ..., N from left to right. Initially, you are in Square X. You can freely travel between adjacent squares. Your goal is to reach Square 0 or Square N. However, for each i = 1, 2, ..., M, there is a toll gate in Square A_i, and traveling to Square A_i incurs a c... | N,M,X=map(int,input().split())
A=[int(x) for x in input().split()]
left=sum(x<X for x in A)
right=M-left
print(max(left,right))
| s446157171 | Accepted | 24 | 9,036 | 127 | N,M,X=map(int,input().split())
A=[int(x) for x in input().split()]
ans=min(sum(x<X for x in A),sum(x>X for x in A))
print(ans)
|
s380087161 | p04044 | u077080573 | 2,000 | 262,144 | Wrong Answer | 39 | 3,064 | 569 | Iroha has a sequence of N strings S_1, S_2, ..., S_N. The length of each string is L. She will concatenate all of the strings in some order, to produce a long string. Among all strings that she can produce in this way, find the lexicographically smallest one. Here, a string s=s_1s_2s_3...s_n is _lexicographically sm... | ans = ""
def get_input():
flag = 1
cnt = 0
while True:
try:
if flag == 1:
N,L = input().split()
flag = 0
continue
else:
a = input()
yield ''.join(a)
cnt += 1
if cn... | s311602400 | Accepted | 44 | 3,064 | 456 | ans = ""
def get_input():
flag = 1
cnt = 0
while True:
if flag == 1:
N,L = input().split()
flag = 0
continue
else:
a = input()
yield ''.join(a)
cnt += 1
if cnt >= int(N):
break
if __name__ =... |
s610826478 | p02389 | u421938296 | 1,000 | 131,072 | Wrong Answer | 30 | 7,508 | 54 | Write a program which calculates the area and perimeter of a given rectangle. | a, b = list(map(int, input().split(' ')))
print(a * b) | s930600619 | Accepted | 20 | 7,604 | 81 | a, b = list(map(int, input().split(' ')))
print('{} {}'.format(a * b, 2*a + 2*b)) |
s169567477 | p03475 | u088552457 | 3,000 | 262,144 | Wrong Answer | 106 | 3,188 | 405 | A railroad running from west to east in Atcoder Kingdom is now complete. There are N stations on the railroad, numbered 1 through N from west to east. Tomorrow, the opening ceremony of the railroad will take place. On this railroad, for each integer i such that 1≤i≤N-1, there will be trains that run from Station i t... | n = int(input())
stations = []
for _ in range(n-1):
stations.append(list(map(int, input().split())))
me = 0
for i in range(n-1):
remain = n - i - 1
cost = 0
time = 0
for r in range(remain):
c, s, f = stations[r+i]
if time < s:
time = s
else:
if time - s < s:
time = s*2
... | s085345634 | Accepted | 101 | 3,188 | 373 | n = int(input())
stations = []
for _ in range(n-1):
stations.append(list(map(int, input().split())))
me = 0
for i in range(n-1):
remain = n - i - 1
time = 0
for r in range(remain):
c, s, f = stations[r+i]
if time < s:
time = s
elif time % f == 0:
pass
else:
time = time + f - ... |
s045626357 | p03387 | u597455618 | 2,000 | 262,144 | Wrong Answer | 17 | 3,060 | 130 | 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())
m = max(a, b, c)
diff = (m-a) + (m-b) + (m-c)
print( (diff+3)//2 if diff%2 == 0 else diff//2 ) | s840535598 | Accepted | 17 | 2,940 | 125 | a, b, c = map(int, input().split())
m = max(a, b, c)
diff = (m-a) + (m-b) + (m-c)
print( (diff+3)//2 if diff%2 else diff//2 ) |
s216934212 | p03458 | u600402037 | 2,000 | 262,144 | Wrong Answer | 594 | 63,668 | 792 | AtCoDeer is thinking of painting an infinite two-dimensional grid in a _checked pattern of side K_. Here, a checked pattern of side K is a pattern where each square is painted black or white so that each connected component of each color is a K × K square. Below is an example of a checked pattern of side 3: AtCoDeer... | # coding: utf-8
import sys
import numpy as np
sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
N, K = lr()
table = [[0] * 2*K for _ in range(K)]
for _ in range(N):
x, y, c = sr().split()
x = int(x); y = int(y)
if c == 'B':
y -= K
x... | s461886526 | Accepted | 799 | 196,552 | 1,010 | # coding: utf-8
import sys
import numpy as np
sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
N, K = lr()
table = [[0] * 2*K for _ in range(K)]
for _ in range(N):
x, y, c = sr().split()
x = int(x); y = int(y)
if c == 'B':
x -= K
x... |
s870620121 | p03495 | u779599374 | 2,000 | 262,144 | Wrong Answer | 197 | 40,060 | 294 | Takahashi has N balls. Initially, an integer A_i is written on the i-th ball. He would like to rewrite the integer on some balls so that there are at most K different integers written on the N balls. Find the minimum number of balls that Takahashi needs to rewrite the integers on them. | N, K = map(int, input().split())
A = list(map(int, input().split()))
import collections
A_tuple = collections.Counter(A).most_common()[::-1]
print(len(A_tuple))
if len(A_tuple) < K:
print(0)
else:
ans = 0
for i in range(len(A_tuple)-K):
ans += A_tuple[i][1]
print(ans)
| s439901432 | Accepted | 193 | 39,348 | 274 | N, K = map(int, input().split())
A = list(map(int, input().split()))
import collections
A_tuple = collections.Counter(A).most_common()[::-1]
if len(A_tuple) < K:
print(0)
else:
ans = 0
for i in range(len(A_tuple)-K):
ans += A_tuple[i][1]
print(ans) |
s199868965 | p02273 | u885889402 | 2,000 | 131,072 | Wrong Answer | 30 | 7,824 | 676 | Write a program which reads an integer _n_ and draws a Koch curve based on recursive calles of depth _n_. The Koch curve is well known as a kind of You should start (0, 0), (100, 0) as the first segment. | import math
T = []
class Vect:
def __init__(self,x,y):
self.x = x
self.y = y
def hoge(p,q):
ax = q.x-p.x
ay = q.y-p.y
bx = ax/5 - ay*math.sqrt(3)/2
by = ax*math.sqrt(3)/2 + ay/2
nb = Vect(p.x+bx,p.y+by)
return nb
def koch(p,q,n):
if n == 0:
T.append(p)
els... | s927128739 | Accepted | 30 | 8,480 | 680 | import math
T = []
class Vect:
def __init__(self,x,y):
self.x = x
self.y = y
def hoge(p,q):
ax = q.x-p.x
ay = q.y-p.y
bx = ax/2 - ay*math.sqrt(3)/2
by = ax*math.sqrt(3)/2 + ay/2
nb = Vect(p.x+bx,p.y+by)
return nb
def koch(p,q,n):
if n == 0:
T.append(p)
els... |
s810531609 | p03623 | u078349616 | 2,000 | 262,144 | Wrong Answer | 18 | 2,940 | 89 | 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") | s131873403 | Accepted | 17 | 2,940 | 89 | x,a,b = map(int, input().split())
if abs(x-a) > abs(x-b):
print("B")
else:
print("A") |
s649049497 | p03435 | u729214975 | 2,000 | 262,144 | Wrong Answer | 325 | 21,804 | 112 | We have a 3 \times 3 grid. A number c_{i, j} is written in the square (i, j), where (i, j) denotes the square at the i-th row from the top and the j-th column from the left. According to Takahashi, there are six integers a_1, a_2, a_3, b_1, b_2, b_3 whose values are fixed, and the number written in the square (i, j) ... | import numpy as np
c = np.array([[int(i) for i in input().split()] for _ in range(3)])
print(np.sum(c) % 3 == 0) | s252246904 | Accepted | 153 | 12,516 | 349 | import numpy as np
c = np.array([[int(i) for i in input().split()] for _ in range(3)])
b = np.sum(c) % 3 == 0
b &= np.sum(c[0] - c[1]) % 3 == 0
b &= np.sum(c[0] - c[2]) % 3 == 0
b &= np.sum(c[1] - c[2]) % 3 == 0
c = c.T
b &= np.sum(c[0] - c[1]) % 3 == 0
b &= np.sum(c[0] - c[2]) % 3 == 0
b &= np.sum(c[1] - c[2]) % 3 == ... |
s135197155 | p02600 | u030278108 | 2,000 | 1,048,576 | Wrong Answer | 30 | 9,196 | 393 | M-kun is a competitor in AtCoder, whose highest rating is X. In this site, a competitor is given a _kyu_ (class) according to his/her highest rating. For ratings from 400 through 1999, the following kyus are given: * From 400 through 599: 8-kyu * From 600 through 799: 7-kyu * From 800 through 999: 6-kyu * Fr... | x = int(input())
if x >= 400 and 599 >= x:
print("8級")
elif x >= 600 and 799 >= x:
print("7級")
elif x >= 800 and 999 >= x:
print("6級")
elif x >= 1000 and 1199 >= x:
print("5級")
elif x >= 1200 and 1399 >= x:
print("4級")
elif x >= 1400 and 1599 >= x:
print("3級")
elif x >= 1600 and 1799 >= x:
... | s138831840 | Accepted | 34 | 9,132 | 369 | x = int(input())
if x >= 400 and 599 >= x:
print("8")
elif x >= 600 and 799 >= x:
print("7")
elif x >= 800 and 999 >= x:
print("6")
elif x >= 1000 and 1199 >= x:
print("5")
elif x >= 1200 and 1399 >= x:
print("4")
elif x >= 1400 and 1599 >= x:
print("3")
elif x >= 1600 and 1799 >= x:
print(... |
s971515624 | p02390 | u518939641 | 1,000 | 131,072 | Wrong Answer | 30 | 7,692 | 86 | 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=S//3600
m=(S-h*3600)//60
s=S%3600
print(str(h)+':'+str(m)+':'+str(s)) | s763703446 | Accepted | 20 | 7,688 | 84 | S=int(input())
h=S//3600
m=(S-h*3600)//60
s=S%60
print(str(h)+':'+str(m)+':'+str(s)) |
s496621978 | p03437 | u018679195 | 2,000 | 262,144 | Wrong Answer | 2,104 | 3,060 | 327 | You are given positive integers X and Y. If there exists a positive integer not greater than 10^{18} that is a multiple of X but not a multiple of Y, choose one such integer and print it. If it does not exist, print -1. | import math
input = str(input()).split(" ")
for index in range(len(input)):
input[index] = int(input[index])
x = input[0]
y = input[1]
def test(x, y):
for index in range(-abs(y), abs(y) + 1):
if (x * index % y != 0 and abs(x * index) <= 10**(18)):
return x * index
return -1
print(test... | s928766774 | Accepted | 17 | 3,060 | 380 | import math
x, y = map(int, input().split())
def gcd(a, b):
while b != 0:
a, b = b, a % b
return a
def lcm(x,y):
return (x * y)//gcd(x, y)
def thingo(x,y):
if (x == 0 and y == 0):
return -1
if (x != 0 and y == 0):
return x
test = lcm(x,y)
if (test-x >= x):
r... |
s952255514 | p03971 | u181668771 | 2,000 | 262,144 | Wrong Answer | 109 | 4,040 | 693 | There are N participants in the CODE FESTIVAL 2016 Qualification contests. The participants are either students in Japan, students from overseas, or neither of these. Only Japanese students or overseas students can pass the Qualification contests. The students pass when they satisfy the conditions listed below, from t... | def main():
from builtins import int, map, list, print
import sys
sys.setrecursionlimit(10 ** 6)
input = sys.stdin.readline
input_list = (lambda: input().rstrip().split())
input_number = (lambda: int(input()))
input_number_list = (lambda: list(map(int, input_list())))
N, A, B = input_n... | s022417256 | Accepted | 103 | 4,144 | 698 | def main():
from builtins import int, map, list, print
import sys
sys.setrecursionlimit(10 ** 6)
input = sys.stdin.readline
input_list = (lambda: input().rstrip().split())
input_number = (lambda: int(input()))
input_number_list = (lambda: list(map(int, input_list())))
N, A, B = input_n... |
s049907183 | p02694 | u611090896 | 2,000 | 1,048,576 | Wrong Answer | 21 | 8,980 | 68 | 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())
B = 100
while (B>X):
B = B + B*0.01
print(int(B)) | s664809344 | Accepted | 24 | 9,064 | 115 | X = int(input())
year = 0
deposit = 100
while deposit < X:
deposit = deposit*101//100
year += 1
print(year) |
s083681107 | p03494 | u698771758 | 2,000 | 262,144 | Wrong Answer | 19 | 2,940 | 165 | 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=0
f=1
while(f):
for i in range(len(A)):
if A[i]%2==0:A[i]/=2
else: f=0
ans+=1
print(ans)
| s283222555 | Accepted | 19 | 2,940 | 166 | N=int(input())
A=list(map(int,input().split()))
ans=-1
f=1
while(f):
for i in range(len(A)):
if A[i]%2==0:A[i]/=2
else: f=0
ans+=1
print(ans)
|
s707176753 | p03605 | u054717609 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 193 | 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()
n=int(n)
og=n
flag=0
while(n>0):
d=n%10
n=n//10
if(d==7):
flag=flag+1
if(flag>0):
print("Yes")
else:
print("No")
| s717430911 | Accepted | 17 | 2,940 | 193 | n=input()
n=int(n)
og=n
flag=0
while(n>0):
d=n%10
n=n//10
if(d==9):
flag=flag+1
if(flag>0):
print("Yes")
else:
print("No")
|
s999585053 | p03409 | u451017206 | 2,000 | 262,144 | Wrong Answer | 25 | 3,064 | 515 | On a two-dimensional plane, there are N red points and N blue points. The coordinates of the i-th red point are (a_i, b_i), and the coordinates of the i-th blue point are (c_i, d_i). A red point and a blue point can form a _friendly pair_ when, the x-coordinate of the red point is smaller than that of the blue point, ... | N = int(input())
red = [list(map(int, input().split())) for i in range(N)]
blue = [list(map(int, input().split())) for i in range(N)]
l = [0] * N
def c(a,b):
if a[0] < b[0] or a[1] < b[1]:return True
return False
for r in red:
m = 10000000
mi = -1
for i, b in enumerate(blue):
if l[i]: contin... | s732650597 | Accepted | 20 | 3,064 | 406 | N = int(input())
red = [list(map(int, input().split())) for i in range(N)]
blue = [list(map(int, input().split())) for i in range(N)]
a = [0] * N
for x,y in sorted(blue,key=lambda x: x[0]):
k = []
for i,[x2,y2] in enumerate(red):
if x2 < x and y2 < y and not a[i]:
k.append((x2,y2,i))
if ... |
s480189590 | p00045 | u775586391 | 1,000 | 131,072 | Wrong Answer | 20 | 7,532 | 162 | 販売単価と販売数量を読み込んで、販売金額の総合計と販売数量の平均を出力するプログラムを作成してください。 | import sys
x,y = 0,0
n = 0
for line in sys.stdin.readlines():
print(line)
a,b = map(int,line.split(','))
x += a*b
y += b
n += 1
print(x)
print(int(y/n)) | s612052918 | Accepted | 20 | 7,556 | 203 | import sys
count = 0
asum = 0
bsum = 0
for line in sys.stdin:
count += 1
l = list(map(int,line.split(",")))
asum += l[0]*l[1]
bsum += l[1]
bave = int(bsum / count + 0.5)
print(asum)
print(bave) |
s595057224 | p03485 | u633914031 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 48 | 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())
print((a+b)/2%1) | s253454536 | Accepted | 17 | 2,940 | 55 | a,b = map(int, input().split())
print(int((a+b+2-1)/2)) |
s258588479 | p03964 | u905582793 | 2,000 | 262,144 | Wrong Answer | 21 | 3,188 | 222 | AtCoDeer the deer is seeing a quick report of election results on TV. Two candidates are standing for the election: Takahashi and Aoki. The report shows the ratio of the current numbers of votes the two candidates have obtained, but not the actual numbers of votes. AtCoDeer has checked the report N times, and when he c... | n=int(input())
a=[list(map(int,input().split())) for i in range(n)]
x,y = a[0][0],a[0][1]
for i in range(1,n):
xr=(a[i-1][0]+a[i][0]-1)//a[i][0]
yr=(a[i-1][1]+a[i][1]-1)//a[i][1]
r=max(xr,yr)
x*=r
y*=r
print(x+y) | s299564299 | Accepted | 21 | 3,188 | 220 | n=int(input())
a=[list(map(int,input().split())) for i in range(n)]
x,y = a[0][0],a[0][1]
for i in range(1,n):
xr=(x+a[i][0]-1)//a[i][0]
yr=(y+a[i][1]-1)//a[i][1]
r=max(xr,yr)
x=r*a[i][0]
y=r*a[i][1]
print(x+y) |
s784830989 | p04029 | u760961723 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 36 | 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) | s249090860 | Accepted | 18 | 2,940 | 42 | N = int(input())
print(int(N * (N+1)/2)) |
s368037277 | p04043 | u165268875 | 2,000 | 262,144 | Wrong Answer | 18 | 2,940 | 96 | 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 ... |
A, B, C = map(int, input().split())
print("YES" if A==B==5 and B==C==5 and A==C==5 else "NO")
| s513127525 | Accepted | 18 | 2,940 | 112 |
A, B, C = input().split()
list = [A, B, C]
print("YES" if list.count("5")==2 and list.count("7")==1 else "NO")
|
s489236450 | p02601 | u624281900 | 2,000 | 1,048,576 | Wrong Answer | 31 | 9,172 | 198 | 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
else:
break
k-=1
if a<b and b<c:
print("YES")
else:
print("NO") | s498075301 | Accepted | 28 | 9,176 | 198 | a,b,c=map(int,input().split())
k=int(input())
while k>0:
if a>=b:
b*=2
elif b>=c:
c*=2
else:
break
k-=1
if a<b and b<c:
print("Yes")
else:
print("No") |
s790061648 | p03997 | u144029820 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 65 | 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. | n=int(input())
ans=0
for i in range(n):
ans+=i+1
print(ans)
| s125602103 | Accepted | 17 | 2,940 | 64 | a=int(input())
b=int(input())
c=int(input())
print((a+b)*c//2)
|
s645818598 | p03854 | u546338822 | 2,000 | 262,144 | Wrong Answer | 72 | 3,316 | 371 | 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()
mojiretu = ['dream','dreamer','erase','eraser']
import re
def setudan(s):
if s[-5:] == 'dream' or s[-5:] == 'erase':
return s[:-5]
elif s[-6:] == 'eraser':
return s[:-6]
elif s[-7:] == 'dreamer':
return s[:-7]
else:
return 0
while True:
s = setudan(s)
if s == 0:
print('No'... | s545627117 | Accepted | 71 | 3,444 | 371 | s = input()
mojiretu = ['dream','dreamer','erase','eraser']
import re
def setudan(s):
if s[-5:] == 'dream' or s[-5:] == 'erase':
return s[:-5]
elif s[-6:] == 'eraser':
return s[:-6]
elif s[-7:] == 'dreamer':
return s[:-7]
else:
return 0
while True:
s = setudan(s)
if s == 0:
print('NO'... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.