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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
s593485247 | p03455 | u674722380 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 103 | 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())
c = a * b
if c % 2 == 0 :
print("Odd")
else:
print("Even")
| s704076423 | Accepted | 17 | 2,940 | 103 |
a, b = map(int, input().split())
c = a * b
if c % 2 == 0 :
print("Even")
else:
print("Odd")
|
s525506314 | p02694 | u589969467 | 2,000 | 1,048,576 | Wrong Answer | 25 | 9,100 | 86 | 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... | n = int(input())
kane = 100
i = 0
while kane>=n:
i += 1
kane = int(kane * 1.01)
| s856780920 | Accepted | 33 | 9,144 | 100 | x = int(input())
money = 100
i = 0
while money<x:
i += 1
money = (money * 101)//100
print(i) |
s947556564 | p03543 | u288948615 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 127 | We call a 4-digit integer with three or more consecutive same digits, such as 1118, **good**. You are given a 4-digit integer N. Answer the question: Is N **good**? | nums = [int(n) for n in input()]
for i in range(2):
if set(nums[i:i+3:]) == 1:
print('Yes')
break
else:
print('No') | s337153219 | Accepted | 17 | 2,940 | 138 | nums = [int(n) for n in input()]
for i in range(2):
if len(set(nums[i:i+3:])) == 1:
print('Yes')
break
else:
print('No') |
s551311033 | p03360 | u220345792 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 124 | There are three positive integers A, B and C written on a blackboard. E869120 performs the following operation K times: * Choose one integer written on the blackboard and let the chosen integer be n. Replace the chosen integer with 2n. What is the largest possible sum of the integers written on the blackboard after... | A, B, C = map(int, input().split())
K = int(input())
ans = 0
ans = A + B + C + max(A, B, C) * (K - 1) *2
print(int(ans))
| s227129546 | Accepted | 17 | 2,940 | 145 | A, B, C = map(int, input().split())
K = int(input())
ans = 0
max_num = max(A, B, C)
ans = A + B + C + max_num * 2**K -max_num
print(int(ans))
|
s444008240 | p03141 | u539517139 | 2,000 | 1,048,576 | Wrong Answer | 358 | 7,848 | 145 | There are N dishes of cuisine placed in front of Takahashi and Aoki. For convenience, we call these dishes Dish 1, Dish 2, ..., Dish N. When Takahashi eats Dish i, he earns A_i points of _happiness_ ; when Aoki eats Dish i, she earns B_i points of happiness. Starting from Takahashi, they alternately choose one dish a... | n=int(input())
s=[0]*n
t=0
for i in range(n):
a,b=map(int,input().split())
s[i]=a+b
t+=b
s.sort()
s=s[::-1]
print(sum(s[:n//2+(n%2==1)])-t) | s276816241 | Accepted | 357 | 7,848 | 134 | n=int(input())
s=[0]*n
t=0
for i in range(n):
a,b=map(int,input().split())
s[i]=a+b
t+=b
s.sort()
s=s[::-1]
print(sum(s[::2])-t) |
s809888281 | p03455 | u314050667 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 75 | 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("Odd") if (a*b)%2 else print("Evev") | s194150104 | Accepted | 17 | 2,940 | 75 | a, b = map(int,input().split())
print("Odd") if (a*b)%2 else print("Even") |
s306990688 | p03605 | u732061897 | 2,000 | 262,144 | Wrong Answer | 26 | 8,948 | 78 | 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()
if N[0] == 9 or N[1] == 9:
print('Yes')
else:
print('No')
| s007026278 | Accepted | 26 | 9,028 | 82 | N = input()
if N[0] == '9' or N[1] == '9':
print('Yes')
else:
print('No')
|
s031442281 | p03943 | u306142032 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 111 | 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,b,c = map(int, input().split())
if a+b == c or b+c == a or c+a == b:
print("YES")
else:
print("NO")
| s067790234 | Accepted | 19 | 3,060 | 111 | a,b,c = map(int, input().split())
if a+b == c or b+c == a or c+a == b:
print("Yes")
else:
print("No")
|
s541089436 | p02854 | u760961723 | 2,000 | 1,048,576 | Wrong Answer | 122 | 26,220 | 430 | Takahashi, who works at DISCO, is standing before an iron bar. The bar has N-1 notches, which divide the bar into N sections. The i-th section from the left has a length of A_i millimeters. Takahashi wanted to choose a notch and cut the bar at that point into two parts with the same length. However, this may not be po... | N = int(input())
A = list(map(int,input().split()))
almost_half = sum(A)/2
former = 0
for n in range(N):
former += A[n]
if former == almost_half:
print(0)
break
if former > almost_half:
if n == 0:
print(abs(A[0]-sum(A[1:])))
break
elif n == N-1:
print(abs(A[n]-sum(A[:n])))... | s870530305 | Accepted | 124 | 26,056 | 598 | N = int(input())
A = list(map(int,input().split()))
almost_half = sum(A)/2
former = 0
for n in range(N):
former += A[n]
if former == almost_half:
print(0)
break
if former > almost_half:
if n == 0:
#print("case01",n,former)
print(abs(A[0]-sum(A[1:])))
break
elif n == N-1:
... |
s089802001 | p03457 | u610232423 | 2,000 | 262,144 | Wrong Answer | 910 | 3,188 | 348 | AtCoDeer the deer is going on a trip in a two-dimensional plane. In his plan, he will depart from point (0, 0) at time 0, then for each i between 1 and N (inclusive), he will visit point (x_i,y_i) at time t_i. If AtCoDeer is at point (x, y) at time t, he can be at one of the following points at time t+1: (x+1,y), (x-1... | n=input()
x1=0
y1=0
t1=0
success=True
for i in range(int(n)):
t,x,y = map(int,input().split())
w = abs(x - x1) + abs(y - y1)
print(w)
if w > abs(t - t1):
success=False
break
if w % 2 != abs(t -t1) % 2:
success=False
break
x1 = x
y1 = y
t1 = t
print("Yes")... | s844182583 | Accepted | 377 | 3,064 | 336 | n=input()
x1=0
y1=0
t1=0
success=True
for i in range(int(n)):
t,x,y = map(int,input().split())
w = abs(x - x1) + abs(y - y1)
if w > abs(t - t1):
success=False
break
if w % 2 != abs(t -t1) % 2:
success=False
break
x1 = x
y1 = y
t1 = t
print("Yes") if success ... |
s723800632 | p03998 | u513900925 | 2,000 | 262,144 | Wrong Answer | 18 | 3,188 | 586 | Alice, Bob and Charlie are playing _Card Game for Three_ , as below: * At first, each of the three players has a deck consisting of some number of cards. Each card has a letter `a`, `b` or `c` written on it. The orders of the cards in the decks cannot be rearranged. * The players take turns. Alice goes first. * ... | a = input()
b = input()
c = input()
d = a + b + c
def turn(x ,a_hand ,b_hand ,c_hand):
if not a_hand:
print("A")
return
if not b_hand:
print("B")
return
if not c_hand:
print("C")
return
if x == "a":
x = a_hand[0]
a_hand = a_hand[1:]
... | s997463104 | Accepted | 17 | 3,188 | 609 | a = input()
b = input()
c = input()
def turn(x ,a_hand ,b_hand ,c_hand):
if not a_hand and x == "a":
print("A")
return
if not b_hand and x =="b":
print("B")
return
if not c_hand and x =="c":
print("C")
return
if x == "a":
x = a_hand[0]
a_ha... |
s956779295 | p03485 | u333731247 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 51 | 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(int((a+b)/2)+1) | s694195839 | Accepted | 17 | 2,940 | 101 | a,b=map(int,input().split())
if (a+b)%2==0:
print(int((a+b)/2))
else :
print(int((a+b)/2)+1) |
s927136021 | p02613 | u945375934 | 2,000 | 1,048,576 | Wrong Answer | 146 | 9,096 | 330 | 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())
ac, wa, tle, re = 0, 0, 0, 0
for i in range(n):
s = input()
if s == "AC":
ac += 1
elif s == "WA":
wa += 1
elif s == "TLE":
tle += 1
elif s == "RE":
re += 1
print("AC × " + str(ac))
print("WA × " + str(wa))
print("TLE × " + str(tle))
print("RE × " + st... | s379660858 | Accepted | 148 | 9,152 | 326 | n = int(input())
ac, wa, tle, re = 0, 0, 0, 0
for i in range(n):
s = input()
if s == "AC":
ac += 1
elif s == "WA":
wa += 1
elif s == "TLE":
tle += 1
elif s == "RE":
re += 1
print("AC x " + str(ac))
print("WA x " + str(wa))
print("TLE x " + str(tle))
print("RE x " + st... |
s877664786 | p03973 | u731028462 | 2,000 | 262,144 | Wrong Answer | 304 | 7,084 | 234 | N people are waiting in a single line in front of the Takahashi Store. The cash on hand of the i-th person from the front of the line is a positive integer A_i. Mr. Takahashi, the shop owner, has decided on the following scheme: He picks a product, sets a positive integer P indicating its price, and shows this product... | n = int(input())
a = []
for i in range(n):
a.append(int(input()))
count = max(a[0]-1,0)
index = 2
for i in range(1,n):
if a[i] > index:
count += (a[i] - 1) / index
if a[i] == index:
index += 1
print(count)
| s674235865 | Accepted | 282 | 7,848 | 232 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
n = int(input())
arr = [int(input()) for i in range(n)]
count = arr[0]-1
m = 2
for a in arr[1:]:
if a > m:
count += (a - 1) // m
if a == m:
m += 1
print(count)
|
s352320573 | p03605 | u729133443 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 32 | 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? | print('YNeos'['9'in input()::2]) | s886343351 | Accepted | 27 | 9,020 | 33 | print('NYoe s'['9'in input()::2]) |
s065661949 | p03456 | u747220349 | 2,000 | 262,144 | Wrong Answer | 2,104 | 18,992 | 141 | AtCoDeer the deer has found two positive integers, a and b. Determine whether the concatenation of a and b in this order is a square number. | s=int("".join(map(str,input().split())))
i=1
while i<s:
if s==i*2:
print("Yes")
else:
i=i+1
else:
print("No")
| s989152867 | Accepted | 55 | 2,940 | 156 | s=int("".join(map(str,input().split())))
i=1
while i<s:
if s==i**2:
print("Yes")
break
else:
i=i+1
else:
print("No")
|
s660881855 | p02613 | u068142202 | 2,000 | 1,048,576 | Wrong Answer | 32 | 9,156 | 96 | 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())
if n % 1000 == 0:
print("0")
else:
print(((n // 1000) + 1) * 1000 - n)
| s645076024 | Accepted | 143 | 16,608 | 258 | import collections
n = int(input())
s = [input() for _ in range(n)]
s_count = collections.Counter(s)
print("AC x {}".format(s_count["AC"]))
print("WA x {}".format(s_count["WA"]))
print("TLE x {}".format(s_count["TLE"]))
print("RE x {}".format(s_count["RE"])) |
s669838713 | p03456 | u279229189 | 2,000 | 262,144 | Wrong Answer | 21 | 4,088 | 203 | AtCoDeer the deer has found two positive integers, a and b. Determine whether the concatenation of a and b in this order is a square number. | lists=[input() for i in range(1)]
num = int(lists[0].split(" ")[0] + lists[0].split(" ")[1])
dct = {str(i * i): "A" for i in range(0, 10000, 1)}
if str(num) in dct:
print("yes")
else:
print("no")
| s304949692 | Accepted | 21 | 4,088 | 203 | lists=[input() for i in range(1)]
num = int(lists[0].split(" ")[0] + lists[0].split(" ")[1])
dct = {str(i * i): "A" for i in range(0, 10000, 1)}
if str(num) in dct:
print("Yes")
else:
print("No")
|
s328930872 | p03433 | u330176731 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 99 | E869120 has A 1-yen coins and infinitely many 500-yen coins. Determine if he can pay exactly N yen using only these coins. | n = [int(input()) for n in range(2)]
if n[0] % 500 == n[1]:
print('Yes')
else:
print('No')
| s202883952 | Accepted | 20 | 2,940 | 51 | print(['Yes','No'][int(input())%500>int(input())])
|
s047360311 | p03680 | u672494157 | 2,000 | 262,144 | Wrong Answer | 22 | 3,700 | 657 | Takahashi wants to gain muscle, and decides to work out at AtCoder Gym. The exercise machine at the gym has N buttons, and exactly one of the buttons is lighten up. These buttons are numbered 1 through N. When Button i is lighten up and you press it, the light is turned off, and then Button a_i will be lighten up. It ... | import functools
def inputs(num_of_input):
ins = [input() for i in range(num_of_input)]
return ins
def solve(inputs):
a = list(map(lambda x: int(x), inputs))
a[1] = -1
return wh(a, 2, 0)
def wh(a, search, count):
counts = []
if search == 1:
return count
for i, value in en... | s618961070 | Accepted | 181 | 13,980 | 502 | import functools
def inputs(num_of_input):
ins = [input() for i in range(num_of_input)]
return ins
def solve(inputs):
a = list(map(lambda x: int(x), inputs))
count = 0
light = 1
N = len(a)
while 1:
next_light = a[light - 1]
count += 1
if next_light == 2:
... |
s905452453 | p03050 | u054556734 | 2,000 | 1,048,576 | Wrong Answer | 158 | 3,324 | 149 | Snuke received a positive integer N from Takahashi. A positive integer m is called a _favorite number_ when the following condition is satisfied: * The quotient and remainder of N divided by m are equal, that is, \lfloor \frac{N}{m} \rfloor = N \bmod m holds. Find all favorite numbers and print the sum of those. | import math as m
n = int(input())
ans = 0
for i in range(1,m.ceil(m.sqrt(n))):
if n%i==0: ans += n//i -1; print(i)
print(ans)
| s528272149 | Accepted | 170 | 2,940 | 202 | import math as m
n = int(input())
ans = 0
for i in range(1,m.ceil(m.sqrt(n))):
if n%i==0:
if n//i == i+1 : break
ans += n//i -1
if n in [1,2]: ans = 0
print(ans)
|
s658605096 | p02678 | u711295009 | 2,000 | 1,048,576 | Wrong Answer | 1,448 | 40,172 | 845 | There is a cave. The cave has N rooms and M passages. The rooms are numbered 1 to N, and the passages are numbered 1 to M. Passage i connects Room A_i and Room B_i bidirectionally. One can travel between any two rooms by traversing passages. Room 1 is a special room with an entrance from the outside. It is dark in th... | class queue:
listQ = []
def push(self, x):
self.listQ.append(x)
def pop(self):
a = self.listQ[0]
del self.listQ[0]
return a
def length(self):
return len(self.listQ)
n, m = map(int, input().split())
nodeMap = {}
doneL = [0]*(n+1)
doneL[1] = -1
for i in range(m):
... | s593011186 | Accepted | 1,467 | 40,008 | 828 | class queue:
listQ = []
def push(self, x):
self.listQ.append(x)
def pop(self):
a = self.listQ[0]
del self.listQ[0]
return a
def length(self):
return len(self.listQ)
n, m = map(int, input().split())
nodeMap = {}
doneL = [0]*(n+1)
doneL[1] = -1
for i in range(m):
... |
s526044520 | p03351 | u939757770 | 2,000 | 1,048,576 | Wrong Answer | 17 | 3,060 | 139 | Three people, A, B and C, are trying to communicate using transceivers. They are standing along a number line, and the coordinates of A, B and C are a, b and c (in meters), respectively. Two people can directly communicate when the distance between them is at most d meters. Determine if A and C can communicate, either ... | a,b,c,d=map(int,input().split())
if abs(c-a)<=d:
print("Yes")
elif abs(a-b)<=d and abs(b-c)<=0:
print("Yes")
else:
print("No") | s709923481 | Accepted | 17 | 3,060 | 139 | a,b,c,d=map(int,input().split())
if abs(c-a)<=d:
print("Yes")
elif abs(a-b)<=d and abs(b-c)<=d:
print("Yes")
else:
print("No") |
s306033033 | p02663 | u883674141 | 2,000 | 1,048,576 | Wrong Answer | 22 | 9,168 | 130 | 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? | a = list(map(int,input().split()))
x = a[0]*60 + a[1]
y = a[2]*60 + a[3]
z = x - y
r = z - a[4]
if r <= 0:
r = 0
print(r) | s069696446 | Accepted | 21 | 9,164 | 108 | a = list(map(int,input().split()))
x = a[0]*60 + a[1]
y = a[2]*60 + a[3]
z = y - x
r = z - a[4]
print(r) |
s735820126 | p02843 | u626228246 | 2,000 | 1,048,576 | Wrong Answer | 31 | 9,108 | 86 | AtCoder Mart sells 1000000 of each of the six items below: * Riceballs, priced at 100 yen (the currency of Japan) each * Sandwiches, priced at 101 yen each * Cookies, priced at 102 yen each * Cakes, priced at 103 yen each * Candies, priced at 104 yen each * Computers, priced at 105 yen each Takahashi want... | x = int(input())
n = x//100
x -= n*100
if 5*n >= x:
print("Yes")
else:
print("No") | s961670472 | Accepted | 31 | 9,160 | 83 | x = int(input())
n = x//100
x -= n*100
if 5*n >= x:
print("1")
else:
print("0") |
s470380825 | p03475 | u059210959 | 3,000 | 262,144 | Wrong Answer | 477 | 24,472 | 919 | 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... | # encoding:utf-8
import copy
import numpy as np
import random
N = int(input())
n = N
C = []
S = []
F = []
for i in range(n-1):
c,s,f = map(int, input().split())
C.append(c)
S.append(s)
F.append(f)
answer = []
for i in list(reversed(range(n))):
if i == n-1:
answer.append(0)
elif i == n... | s509696286 | Accepted | 238 | 13,520 | 632 | # encoding:utf-8
import copy
import numpy as np
import random
N = int(input())
n = N
C = []
S = []
F = []
for i in range(n-1):
c,s,f = map(int, input().split())
C.append(c)
S.append(s)
F.append(f)
answer = []
for i in range(n-1):
to_goal = C[i] + S[i]
for j in range(i+1,n-1):
if to_go... |
s641789637 | p03719 | u729133443 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 60 | You are given three integers A, B and C. Determine whether C is not less than A and not greater than B. | a,b,c=map(int,input().split());print('YNeos'[a<c or c>b::2]) | s743725816 | Accepted | 26 | 8,968 | 58 | a,b,c=map(int,input().split())
print('NYoe s'[a<=c<=b::2]) |
s000355991 | p02381 | u179070318 | 1,000 | 131,072 | Wrong Answer | 20 | 5,644 | 176 | You have final scores of an examination for n students. Calculate standard deviation of the scores s1, s2 ... sn. The variance α2 is defined by α2 = (∑n _i_ =1(s _i_ \- m)2)/n where m is an average of si. The standard deviation of the scores is the square root of their variance. | n = int(input())
scores = [int(x) for x in input().split()]
ave = sum(scores)/n
resi = 0
for s in scores:
resi += (s-ave)**2
sd = (resi/n)**0.5
print('{:.6f}'.format(sd))
| s254442229 | Accepted | 20 | 5,684 | 253 | while True:
n = int(input())
if n == 0:
break
else:
score = [int(x) for x in input().split()]
a = 0
m = sum(score)/n
for s in score:
a += (s-m)**2
a = (a/n)**0.5
print('{:.8f}'.format(a))
|
s725125659 | p04031 | u503901534 | 2,000 | 262,144 | Wrong Answer | 21 | 3,060 | 263 | 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())
nlist= list(map(int,input().split()))
nmax = max(nlist)
nmin = min(nlist)
costs = []
for i in range(len(nlist)):
p = 0
for j in range(len(nlist)):
p = p + (nlist[i]-nlist[j]) ** 2
costs.append(p)
print(min(costs))
| s402252587 | Accepted | 25 | 3,060 | 259 | n = int(input())
nlist= list(map(int,input().split()))
nmax = max(nlist)
nmin = min(nlist)
costs = []
for i in range(nmin,nmax + 1):
p = 0
for j in range(len(nlist)):
p = p + (i-nlist[j]) ** 2
costs.append(p)
print(min(costs))
|
s580453896 | p03854 | u343128979 | 2,000 | 262,144 | Wrong Answer | 18 | 3,188 | 256 | 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`. | def main():
S = input()
T = 'dream', 'dreamer', 'erase', 'eraser'
for t in T:
print(t)
S = S.strip(t)
if len(S) > 0:
ans = 'NO'
else:
ans = 'YES'
print(ans)
if __name__ == '__main__':
main()
| s681678797 | Accepted | 71 | 3,188 | 463 | def main():
S = input()
S = S[::-1]
_T = 'dreamer', 'dream', 'eraser', 'erase'
T = []
for t in _T:
T.append(t[::-1])
i = 0
while 1:
temp = []
bool = True
for t in T:
if S[:len(t)] == t:
S = S[len(t):]
bool = False
... |
s803999062 | p02534 | u720603143 | 2,000 | 1,048,576 | Wrong Answer | 26 | 9,016 | 27 | You are given an integer K. Print the string obtained by repeating the string `ACL` K times and concatenating them. For example, if K = 3, print `ACLACLACL`. | print("abc" * int(input())) | s708225942 | Accepted | 28 | 9,144 | 27 | print("ACL" * int(input())) |
s705261875 | p03435 | u036340997 | 2,000 | 262,144 | Wrong Answer | 17 | 3,064 | 285 | 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) ... | c = []
for i in range(3):
c.append(list(map(int, input().split())))
d = []
for i in range(3):
sum = 0
d.append([])
for j in range(3):
sum += c[i][j]
for j in range(3):
d[i].append(c[i][j] - sum/3)
if d[0]==d[1] and d[1]==d[2]:
print('Yes')
else:
print('No') | s608949024 | Accepted | 17 | 3,064 | 347 | c = []
for i in range(3):
c.append(list(map(int, input().split())))
d = []
for i in range(3):
sum = 0
d.append([])
for j in range(3):
sum += c[i][j]
for j in range(3):
d[i].append(3*c[i][j] - sum)
for i in range(3):
if d[0][i]==d[1][i] and d[0][i]==d[2][i]:
pass
else:
print('No')
... |
s746499998 | p02268 | u826549974 | 1,000 | 131,072 | Wrong Answer | 20 | 5,596 | 527 | You are given a sequence of _n_ integers S and a sequence of different _q_ integers T. Write a program which outputs C, the number of integers in T which are also in the set S. | def half(a,b,low,high):
if(low > high):
return 0
c = int((low+high)/2)
if(a[c] == b):
return 1
elif(a[c] < b):
return half(a,b,c,high-1)
elif(a[c] > b):
return half(a,b,low+1,c)
else:
return 1
#############################
n = int(input())
s = list(m... | s287509913 | Accepted | 500 | 16,712 | 498 | ############################
def half(a,b,low,high):
if(low > high):
return 0
c = int((low+high)/2)
if(a[c] == b):
return 1
elif(a[c] < b):
return half(a,b,c+1,high)
elif(a[c] > b):
return half(a,b,low,c-1)
#############################
n = int(input())
s = list... |
s816228262 | p03565 | u254871849 | 2,000 | 262,144 | Wrong Answer | 17 | 3,064 | 501 | 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... | from sys import stdin
s, t = stdin.read().split()
s = list(s)
possible_indexes = []
for i in range(len(s) - len(t) + 1):
substring = s[i: i+len(t)]
for j in range(len(t)):
if substring[j] == t[j] or substring[j] == '?': continue
else: break
else:
possible_indexes.append(i)
if not ... | s032328711 | Accepted | 17 | 3,064 | 482 | import sys
s, t = sys.stdin.read().split()
n = len(s); m = len(t)
s = list(s)
def main():
for i in range(n - m, -1, -1):
for j in range(m):
if t[j] != s[i+j] != '?':
break
else:
for j in range(m):
s[i+j] = t[j]
for i in range(n):... |
s046030384 | p03370 | u089376182 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 156 | Akaki, a patissier, can make N kinds of doughnut using only a certain powder called "Okashi no Moto" (literally "material of pastry", simply called Moto below) as ingredient. These doughnuts are called Doughnut 1, Doughnut 2, ..., Doughnut N. In order to make one Doughnut i (1 ≤ i ≤ N), she needs to consume m_i grams o... | n, x = map(int, input().split())
material_list = []
for i in range(n):
m = int(input())
x -= m
material_list.append(m)
print(x//min(material_list)) | s854522652 | Accepted | 17 | 3,060 | 158 | n, x = map(int, input().split())
material_list = []
for i in range(n):
m = int(input())
x -= m
material_list.append(m)
print(x//min(material_list)+n) |
s953029263 | p02659 | u965397031 | 2,000 | 1,048,576 | Wrong Answer | 29 | 9,144 | 90 | Compute A \times B, truncate its fractional part, and print the result as an integer. | a, b = input().split()
a = int(a)
b = float(b)
print(b)
import math
print(math.floor(a*b)) | s702125913 | Accepted | 34 | 10,052 | 105 | from decimal import Decimal
from math import floor
a, b = map(Decimal, input().split())
print(floor(a*b)) |
s771623367 | p03759 | u228223940 | 2,000 | 262,144 | Wrong Answer | 29 | 9,032 | 82 | 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 b-a == c-a:
print('YES')
else:
print('NO') | s325079905 | Accepted | 29 | 9,100 | 82 | a,b,c = map(int,input().split())
if b-a == c-b:
print('YES')
else:
print('NO') |
s393436808 | p03635 | u598684283 | 2,000 | 262,144 | Wrong Answer | 25 | 9,112 | 52 | In _K-city_ , there are n streets running east-west, and m streets running north-south. Each street running east-west and each street running north-south cross each other. We will call the smallest area that is surrounded by four streets a block. How many blocks there are in K-city? | a,b = map(int, input().split())
print(a - 1 * b - 1) | s807037153 | Accepted | 25 | 9,100 | 56 | a,b = map(int, input().split())
print((a - 1) * (b - 1)) |
s348722166 | p03457 | u081784777 | 2,000 | 262,144 | Wrong Answer | 334 | 3,060 | 200 | AtCoDeer the deer is going on a trip in a two-dimensional plane. In his plan, he will depart from point (0, 0) at time 0, then for each i between 1 and N (inclusive), he will visit point (x_i,y_i) at time t_i. If AtCoDeer is at point (x, y) at time t, he can be at one of the following points at time t+1: (x+1,y), (x-1... | n = int(input())
flag = 0
for _ in range(n):
t, x, y = map(int, input().split())
if t%2 == (x+y)%2 and t >= (x+y):
continue
else:
flag = 1
print('YES') if not flag else print('NO') | s498784847 | Accepted | 331 | 3,060 | 200 | n = int(input())
flag = 0
for _ in range(n):
t, x, y = map(int, input().split())
if t%2 == (x+y)%2 and t >= (x+y):
continue
else:
flag = 1
print('Yes') if not flag else print('No') |
s208460580 | p03129 | u698176039 | 2,000 | 1,048,576 | Wrong Answer | 17 | 2,940 | 91 | 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 (N+1)/2 > K:
print('Yes')
else:
print('No')
| s476141501 | Accepted | 19 | 3,060 | 92 | N,K = map(int,input().split())
if (N+1)/2 >= K:
print('YES')
else:
print('NO')
|
s655975113 | p02409 | u193453446 | 1,000 | 131,072 | Wrong Answer | 20 | 7,680 | 505 | 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... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
rooms = [[[0 for r in range(10)] for f in range(3)] for b in range(4)]
number = int(input())
for n in range(number):
inp = input().split(" ")
b = int(inp[0]) - 1
f = int(inp[1]) - 1
r = int(inp[2]) - 1
v = int(inp[3])
rooms[b][f][r] += v
for b i... | s581189196 | Accepted | 20 | 7,676 | 478 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
rooms = [[[0 for r in range(10)] for f in range(3)] for b in range(4)]
number = int(input())
for n in range(number):
inp = input().split(" ")
b = int(inp[0]) - 1
f = int(inp[1]) - 1
r = int(inp[2]) - 1
v = int(inp[3])
rooms[b][f][r] += v
for b... |
s511020806 | p02972 | u025501820 | 2,000 | 1,048,576 | Wrong Answer | 2,109 | 20,688 | 403 | There are N empty boxes arranged in a row from left to right. The integer i is written on the i-th box from the left (1 \leq i \leq N). For each of these boxes, Snuke can choose either to put a ball in it or to put nothing in it. We say a set of choices to put a ball or not in the boxes is good when the following con... | import numpy as np
N = int(input())
a = list(map(int, input().split()))
box = np.array([0 for _ in range(N + 1)])
for i in range(1, N + 1)[:: -1]:
k = 1
sum = 0
while i * k <= N:
sum += box[i * k]
k += 1
if sum % 2 != a[i - 1]:
box[i] = 1
box = box[1:]
if np.count_nonzero(box) >... | s536141653 | Accepted | 889 | 19,896 | 381 | N = int(input())
a = list(map(int, input().split()))
box = [0 for _ in range(N + 1)]
ans = []
for i in range(1, N + 1)[:: -1]:
k = 1
my_sum = 0
while i * k <= N:
my_sum += box[i * k]
k += 1
if my_sum % 2 != a[i - 1]:
box[i] = 1
ans.append(i)
if len(ans) > 0:
print(le... |
s937325408 | p03024 | u517152997 | 2,000 | 1,048,576 | Wrong Answer | 388 | 21,636 | 244 | Takahashi is competing in a sumo tournament. The tournament lasts for 15 days, during which he performs in one match per day. If he wins 8 or more matches, he can also participate in the next tournament. The matches for the first k days have finished. You are given the results of Takahashi's matches as a string S cons... | # -*- coding: utf-8 -*-
#
import math
import sys
import itertools
import numpy as np
#
sumo = list(input())
lose = 0
for i in range(len(sumo)):
if sumo[i] == 'x':
lose += 1
if lose >= 8:
print("No")
else:
print("Yes")
| s534877894 | Accepted | 148 | 12,408 | 244 | # -*- coding: utf-8 -*-
#
import math
import sys
import itertools
import numpy as np
#
sumo = list(input())
lose = 0
for i in range(len(sumo)):
if sumo[i] == 'x':
lose += 1
if lose >= 8:
print("NO")
else:
print("YES")
|
s271171993 | p03544 | u798675549 | 2,000 | 262,144 | Wrong Answer | 17 | 3,064 | 918 | 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) | print([2,1,3,4,7,11,18,29,47,76,123,199,322,521,843,1364,2207,3571,5778,9349,15127,24476,39603,64079,103682,167761,271443,439204,710647,1149851,1860498,3010349,4870847,7881196,12752043,20633239,33385282,54018521,87403803,141422324,228826127,370248451,599074578,969323029,1568397607,2537720636,4106118243,6643838879,10749... | s269401430 | Accepted | 17 | 3,188 | 935 | print([2,1,3,4,7,11,18,29,47,76,123,199,322,521,843,1364,2207,3571,5778,9349,15127,24476,39603,64079,103682,167761,271443,439204,710647,1149851,1860498,3010349,4870847,7881196,12752043,20633239,33385282,54018521,87403803,141422324,228826127,370248451,599074578,969323029,1568397607,2537720636,4106118243,6643838879,10749... |
s665712401 | p03693 | u691896522 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 101 | 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... | k = "".join(list((input().split())))
k = int(k)
if k % 4 == 0:
print("Yes")
else:
print("No") | s323449316 | Accepted | 17 | 2,940 | 101 | k = "".join(list((input().split())))
k = int(k)
if k % 4 == 0:
print("YES")
else:
print("NO") |
s179110827 | p02678 | u494058663 | 2,000 | 1,048,576 | Wrong Answer | 679 | 35,152 | 516 | There is a cave. The cave has N rooms and M passages. The rooms are numbered 1 to N, and the passages are numbered 1 to M. Passage i connects Room A_i and Room B_i bidirectionally. One can travel between any two rooms by traversing passages. Room 1 is a special room with an entrance from the outside. It is dark in th... | from collections import deque
import copy
n,m = map(int,input().split())
Map = [[]for i in range(n)]
for i in range(m):
a,b = map(int,input().split())
Map[a-1].append(b-1)
Map[b-1].append(a-1)
Visited = [False for i in range(n)]
depth = [0 for i in range(n)]
q = deque()
q.append(0)
while q:
st = q.pop... | s855372421 | Accepted | 798 | 38,740 | 709 | from collections import deque
import copy
n,m = map(int,input().split())
Map = [[]for i in range(n)]
for i in range(m):
a,b = map(int,input().split())
Map[a-1].append(b-1)
Map[b-1].append(a-1)
Visited = [False for i in range(n)]
depth = [0 for i in range(n)]
q = deque()
q.append(0)
while q:
st = q.pop... |
s219324092 | p03636 | u949315872 | 2,000 | 262,144 | Wrong Answer | 26 | 9,096 | 134 | 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. | import sys
input = sys.stdin.readline
#-------------
S = input()
#-------------
S = list(S)
n = len(S)
print(S[0] + str(n-2) + S[n-1]) | s057331967 | Accepted | 24 | 8,952 | 81 | S = input()
#-------------
S = list(S)
n = len(S)
print(S[0] + str(n-2) + S[n-1]) |
s139893124 | p02743 | u610326327 | 2,000 | 1,048,576 | Wrong Answer | 18 | 2,940 | 125 | Does \sqrt{a} + \sqrt{b} < \sqrt{c} hold? | import math
abc = input().split(' ')
a = abc[0]
b = abc[1]
c = abc[2]
if a + b < c:
print('Yes')
else:
print('No')
| s370673956 | Accepted | 34 | 5,076 | 227 | import decimal
import math
abc = input().split(' ')
a = int(abc[0])
b = int(abc[1])
c = int(abc[2])
if decimal.Decimal(a).sqrt() + decimal.Decimal(b).sqrt() < decimal.Decimal(c).sqrt():
print('Yes')
else:
print('No')
|
s094475435 | p03478 | u572271833 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 235 | 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). | ### coding: UTF-8
#import math
#import random as rd
#import numpy as np
#n,a,b=map(int,input().split( ))
n=100
a=4
b=16
s=0
for i in range(n):
line=list(map(int,str(i+1)))
if sum(line)>=a and sum(line)<=b:
s+=i+1
| s941555057 | Accepted | 38 | 3,060 | 229 | ### coding: UTF-8
#import math
#import random as rd
#import numpy as np
n,a,b=map(int,input().split( ))
s=0
for i in range(n):
line=list(map(int,str(i+1)))
if sum(line)>=a and sum(line)<=b:
s+=i+1
print(s)
|
s661244255 | p03689 | u556812955 | 2,000 | 262,144 | Wrong Answer | 130 | 3,828 | 384 | You are given four integers: H, W, h and w (1 ≤ h ≤ H, 1 ≤ w ≤ W). Determine whether there exists a matrix such that all of the following conditions are held, and construct one such matrix if the answer is positive: * The matrix has H rows and W columns. * Each element of the matrix is an integer between -10^9 and... | H, W, h, w = map(int, input().split())
if H % h == 0 or W % w == 0:
print("No")
exit(0)
blocks = (H//h) * (W//w)
left = H * W - blocks * h * w
offset = blocks // left + 1
v = [offset, -offset * h * w - 1]
print("Yes")
for i in range(H):
a = []
for j in range(W):
a.append(v[1 if i % h == h-1 a... | s857897167 | Accepted | 142 | 4,084 | 391 | H, W, h, w = map(int, input().split())
if H % h == 0 and W % w == 0:
print("No")
exit(0)
blocks = (H//h) * (W//w)
left = H * W - blocks * h * w
offset = blocks // left + 1
v = [offset, -offset * (h * w - 1) - 1]
print("Yes")
for i in range(H):
a = []
for j in range(W):
a.append(v[1 if i % h =... |
s306550331 | p03469 | u538956308 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 30 | On some day in January 2018, Takaki is writing a document. The document has a column where the current date is written in `yyyy/mm/dd` format. For example, January 23, 2018 should be written as `2018/01/23`. After finishing the document, she noticed that she had mistakenly wrote `2017` at the beginning of the date col... | S = input()
S[3]=="8"
print(S) | s636395539 | Accepted | 17 | 2,940 | 31 | s = input()
print('2018'+s[4:]) |
s108580123 | p03558 | u411537765 | 2,000 | 262,144 | Time Limit Exceeded | 2,104 | 3,272 | 216 | Find the smallest possible sum of the digits in the decimal notation of a positive multiple of K. | n = input()
def get_sum(n):
s = str(n)
arr = list(map(int, list(s)))
return sum(arr)
ans = get_sum(n)
i = 1
for i in range(1, 10000):
m = get_sum(n * i)
if ans > m:
ans = m
print(ans)
| s842962953 | Accepted | 118 | 6,084 | 487 | import collections
def ans(n):
dist = [10 ** 5] * n
dist[1] = 1
d = collections.deque()
d.append(1)
while not d.count == 0:
u = d.popleft()
if u == 0:
return dist[u]
if dist[u] < dist[(u * 10) % n]:
dist[(u * 10) % n] = dist[u]
d.appendle... |
s377047659 | p03371 | u170849169 | 2,000 | 262,144 | Wrong Answer | 18 | 3,060 | 388 | "Pizza At", a fast food chain, offers three kinds of pizza: "A-pizza", "B-pizza" and "AB-pizza". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of B-pizza combined together. The prices of one A-pizza, B-pizza and AB-pizza are A yen, B yen and C yen (yen is the curr... | if __name__ == '__main__':
A, B, C, X, Y = list(map(int, input().split()))
if A + B < 2 * C:
print(1)
print(A * X + B * Y)
else:
if X == Y:
print(2)
print(C * 2 * X)
elif X < Y:
print(3)
print(X * C * 2 + B * (Y - X))
el... | s155486127 | Accepted | 19 | 3,060 | 429 | if __name__ == '__main__':
A, B, C, X, Y = list(map(int, input().split()))
if A + B <= 2 * C:
# print(1)
print(A * X + B * Y)
else:
if X == Y:
# print(2)
print(C * 2 * X)
elif X < Y:
# print(3)
print(min(X * C * 2 + B * (Y - X),... |
s311247057 | p03693 | u544050502 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 64 | 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... | s=int(input().replace(" ",""))
print("YES" if s//4==0 else "NO") | s703178498 | Accepted | 18 | 2,940 | 49 | s=int(input()[::2])
print("NO" if s%4 else "YES") |
s315271873 | p01981 | u998437062 | 8,000 | 262,144 | Wrong Answer | 20 | 5,592 | 218 | 平成31年4月30日をもって現行の元号である平成が終了し,その翌日より新しい元号が始まることになった.平成最後の日の翌日は新元号元年5月1日になる. ACM-ICPC OB/OGの会 (Japanese Alumni Group; JAG) が開発するシステムでは,日付が和暦(元号とそれに続く年数によって年を表現する日本の暦)を用いて "平成 _y_ 年 _m_ 月 _d_ 日" という形式でデータベースに保存されている.この保存形式は変更することができないため,JAGは元号が変更されないと仮定して和暦で表した日付をデータベースに保存し,出力の際に日付を正しい元号を用いた形式に変換することにした. あなたの仕事はJAGのデータベ... | while True:
line = input()
if line == '#':
exit()
g = line.split()[0]
y, m, d = map(int, line.split()[1:])
if y > 31:
g = '?'
elif m > 4:
g = '?'
print(g, y, m, d)
| s489470964 | Accepted | 30 | 5,596 | 224 | while True:
line = input()
if line == '#':
exit()
g = line.split()[0]
y, m, d = map(int, line.split()[1:])
if y > 31 or y >= 31 and m >= 5:
g = '?'
y -= 30
print(g, y, m, d)
|
s118892603 | p02612 | u416011173 | 2,000 | 1,048,576 | Wrong Answer | 27 | 9,136 | 123 | 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. | # -*- coding: utf-8 -*-
N = int(input())
ans = N % 1000
print(ans)
| s383287435 | Accepted | 26 | 9,180 | 501 | # -*- coding: utf-8 -*-
def get_input() -> int:
N = int(input())
return N
def main(N: int) -> None:
ans = (1000 - (N % 1000)) % 1000
print(ans)
if __name__ == "__main__":
N = get_input()
main(N)
|
s049498533 | p02259 | u547492399 | 1,000 | 131,072 | Wrong Answer | 20 | 7,752 | 411 | Write a program of the Bubble Sort algorithm which sorts a sequence _A_ in ascending order. The algorithm should be based on the following pseudocode: BubbleSort(A) 1 for i = 0 to A.length-1 2 for j = A.length-1 downto i+1 3 if A[j] < A[j-1] 4 swap A[j] and A[j-1] Note that, in... | def bubbleSort(A, N):
swap_count = 0
flag = True
while flag:
flag = False
for j in range(N-1, 0, -1):
if A[j] < A[j-1]:
A[j], A[j-1] = A[j-1], A[j]
flag = True
swap_count += 1
print(A)
return swap_count
n = int(... | s038321743 | Accepted | 20 | 7,760 | 386 | def bubbleSort(A, N):
swap_count = 0
flag = True
while flag:
flag = False
for j in range(N-1, 0, -1):
if A[j] < A[j-1]:
A[j], A[j-1] = A[j-1], A[j]
flag = True
swap_count += 1
return swap_count
n = int(input())
A = list(map(int... |
s869691751 | p02615 | u813993459 | 2,000 | 1,048,576 | Wrong Answer | 120 | 31,548 | 73 | Quickly after finishing the tutorial of the online game _ATChat_ , you have decided to visit a particular place with N-1 players who happen to be there. These N players, including you, are numbered 1 through N, and the **friendliness** of Player i is A_i. The N players will arrive at the place one by one in some order... | input()
a=list(map(int,input().split()))
a.sort(reverse=True)
sum(a[:-1]) | s698750373 | Accepted | 218 | 35,452 | 283 | input()
a=list(map(int,input().split()))
a.sort(reverse=True)
import collections
count=len(a)
ans=0
c = collections.Counter(a)
for i in c.keys():
tmp = c[i]*2
if count<=tmp:
ans+=i*count
break
else:
ans+=i*tmp
count-=tmp
print(ans-max(a)) |
s542649415 | p03599 | u151785909 | 3,000 | 262,144 | Wrong Answer | 426 | 4,996 | 574 | 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())
s_max = f*e//(e+100)
w_max = f//(e+100)
s=[]
w=[]
max = 0
ans = []
for i in range(s_max//c+1):
for j in range(s_max//d+1):
if c*i + d*j <= s_max:
s.append(c*i + d*j)
for i in range(w_max//a+1):
for j in range(w_max//b+1):
if 0<a*i + b*j <= w... | s771554621 | Accepted | 1,266 | 5,060 | 609 | a,b,c,d,e,f = map(int, input().split())
s_max = f*e//(e+100)
w_max = f//100
s=[]
w=[]
max = 0
ans = [100*a,0]
for i in range(s_max//c+1):
for j in range(s_max//d+1):
if c*i + d*j <= s_max:
s.append(c*i + d*j)
for i in range(w_max//a+1):
for j in range(w_max//b+1):
if 0<a*i + b*j <... |
s845393661 | p03130 | u970198631 | 2,000 | 1,048,576 | Wrong Answer | 28 | 9,044 | 245 | 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... | list1 =[]
total =0
for i in range(3):
MM = input().split()
a = int(MM[0])
b = int(MM[1])
list1.append(a)
list1.append(b)
for i in range(5):
x = list1.count(i)
if x >2:
total +=1
if total == 0:
print('Yes')
else:
print('No') | s384265228 | Accepted | 29 | 9,116 | 245 | list1 =[]
total =0
for i in range(3):
MM = input().split()
a = int(MM[0])
b = int(MM[1])
list1.append(a)
list1.append(b)
for i in range(5):
x = list1.count(i)
if x >2:
total +=1
if total == 0:
print('YES')
else:
print('NO') |
s936112946 | p03698 | u931636178 | 2,000 | 262,144 | Wrong Answer | 18 | 2,940 | 74 | You are given a string S consisting of lowercase English letters. Determine whether all the characters in S are different. | s = list(input())
if s == list(set(s)):
print("yes")
else:
print("no") | s814791154 | Accepted | 18 | 2,940 | 84 | s = list(input())
if len(s) == len(list(set(s))):
print("yes")
else:
print("no") |
s666649914 | p02615 | u731467249 | 2,000 | 1,048,576 | Wrong Answer | 174 | 31,612 | 140 | Quickly after finishing the tutorial of the online game _ATChat_ , you have decided to visit a particular place with N-1 players who happen to be there. These N players, including you, are numbered 1 through N, and the **friendliness** of Player i is A_i. The N players will arrive at the place one by one in some order... | N = int(input())
A = list(map(int, input().split()))
A.sort(reverse=True)
print(A)
ans = 0
for i in range(N - 1):
ans += A[i]
print(ans) | s087227418 | Accepted | 146 | 31,360 | 346 | N = int(input())
A = list(map(int, input().split()))
A.sort(reverse=True)
# print(A)
ans = A[0]
if N >= 3:
a = (N - 2) // 2
b = (N - 2) % 2
# print(a)
# print(b)
if b == 0:
for i in range(a):
ans += (A[i+1] * 2)
else:
for i in range(a):
ans += (A[i+1] * 2)
... |
s602350925 | p03555 | u811202694 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 114 | 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 = input()
b = input()
if a[0] == b[2] and a[1] == b[1] and b[0] == a[2]:
print("Yes")
else:
print("No") | s855806822 | Accepted | 17 | 2,940 | 114 | a = input()
b = input()
if a[0] == b[2] and a[1] == b[1] and b[0] == a[2]:
print("YES")
else:
print("NO") |
s291914927 | p02402 | u300641790 | 1,000 | 131,072 | Wrong Answer | 20 | 7,416 | 111 | 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. | hoge = int(input())
l = [int(i) for i in input().split()]
mx = max(l)
mn = min(l)
sm = sum(l)
print(mx,mn,sm) | s287952835 | Accepted | 20 | 8,612 | 111 | hoge = int(input())
l = [int(i) for i in input().split()]
mn = min(l)
mx = max(l)
sm = sum(l)
print(mn,mx,sm) |
s637393798 | p03730 | u129978636 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 168 | 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(1,101):
if((a * i) % b == c):
print('YES')
exit()
else:
print('NO')
exit() | s614565765 | Accepted | 18 | 3,060 | 156 | a, b, c = map( int, input().split())
for i in range(1,101):
if((a * i) % b == c):
print('YES')
exit()
else:
print('NO')
exit() |
s935856539 | p02261 | u203261375 | 1,000 | 131,072 | Wrong Answer | 20 | 5,604 | 634 | 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 bubble_sort(A):
for i in range(len(A)):
for j in range(len(A) - 1, i, -1):
if int(A[j][1]) < int(A[j - 1][1]):
A[j], A[j - 1] = A[j - 1], A[j]
return A
def selection_sort(A):
n = len(A)
for i in range(n):
mini = i
for j in range(i, n):
... | s559364614 | Accepted | 30 | 6,344 | 726 | from copy import copy
def bubble_sort(org_A):
A = copy(org_A)
for i in range(len(A)):
for j in range(len(A) - 1, i, -1):
if int(A[j][1]) < int(A[j - 1][1]):
A[j], A[j - 1] = A[j - 1], A[j]
return A
def selection_sort(org_A):
A = copy(org_A)
n = len(A)
for ... |
s026435634 | p02612 | u657786757 | 2,000 | 1,048,576 | Wrong Answer | 129 | 27,172 | 426 | 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. | import sys
import numpy as np
import math
from collections import deque
from collections import defaultdict
from copy import deepcopy
from itertools import accumulate
def input(): return sys.stdin.readline().rstrip()
from functools import lru_cache
def main():
n = int(input())
print(n%1000)
return 0
i... | s933758796 | Accepted | 121 | 27,172 | 501 | import sys
import numpy as np
import math
from collections import deque
from collections import defaultdict
from copy import deepcopy
from itertools import accumulate
def input(): return sys.stdin.readline().rstrip()
from functools import lru_cache
def main():
n = int(input())
if n % 1000 == 0:
pri... |
s081065911 | p02408 | u340503368 | 1,000 | 131,072 | Wrong Answer | 20 | 5,584 | 229 | Taro is going to play a card game. However, now he has only n cards, even though there should be 52 cards (he has no Jokers). The 52 cards include 13 ranks of each of the four suits: spade, heart, club and diamond. | count = int(input())
cards = []
for i in range(count):
cards.append(input())
capitals = "SHCD"
for j in capitals:
for k in range(1,14):
if (j + " " + str(k)) in cards == False:
print(j + " " + str(k))
| s968236183 | Accepted | 20 | 5,592 | 231 | count = int(input())
cards = []
for i in range(count):
cards.append(input())
capitals = "SHCD"
for j in capitals:
for k in range(1,14):
if ((j + " " + str(k)) in cards) == False:
print(j + " " + str(k))
|
s352158352 | p02259 | u963402991 | 1,000 | 131,072 | Wrong Answer | 40 | 7,624 | 244 | Write a program of the Bubble Sort algorithm which sorts a sequence _A_ in ascending order. The algorithm should be based on the following pseudocode: BubbleSort(A) 1 for i = 0 to A.length-1 2 for j = A.length-1 downto i+1 3 if A[j] < A[j-1] 4 swap A[j] and A[j-1] Note that, in... | def BubbleSort(A,n):
for i in range(n):
for j in range(n-1,i,-1):
if A[j] < A[j-1]:
A[j], A[j-1] = A[j-1], A[j]
return A
n = int(input())
A = [int(input()) for i in range(n)]
print (BubbleSort(A,n)) | s577653690 | Accepted | 30 | 7,668 | 324 | n = int(input())
numbers = list(map(int, input().split(" ")))
cnt = 0
for i in range(n):
for j in range(n - 1, i, -1):
if numbers[j] < numbers[j - 1]:
numbers[j],numbers[j - 1] = numbers[j - 1], numbers[j]
cnt += 1
numbers = map(str, numbers)
print(" ".join(numbers))
print(... |
s253682492 | p03693 | u297399512 | 2,000 | 262,144 | Wrong Answer | 24 | 9,156 | 127 | 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())
answer = r * 100 + g * 10 + b
if answer % 4 == 0:
print('Yes')
else:
print('No') | s939879657 | Accepted | 28 | 9,028 | 127 |
r, g, b = map(int, input().split())
answer = r * 100 + g * 10 + b
if answer % 4 == 0:
print('YES')
else:
print('NO') |
s233907607 | p02612 | u623814058 | 2,000 | 1,048,576 | Wrong Answer | 24 | 9,152 | 24 | We will buy a product for N yen (the currency of Japan) at a shop. If we use only 1000-yen bills to pay the price, how much change will we receive? Assume we use the minimum number of bills required. | print(int(input())%1000) | s346323521 | Accepted | 27 | 9,104 | 50 | N=int(input())%1000
print(0 if not(N) else 1000-N) |
s941029390 | p03698 | u382639013 | 2,000 | 262,144 | Wrong Answer | 31 | 9,264 | 195 | You are given a string S consisting of lowercase English letters. Determine whether all the characters in S are different. | S = input()
import collections
c = collections.Counter(list(S))
ans = "yes"
for i in c.values():
print(i)
if i == 1:
pass
else:
ans = "no"
break
print(ans) | s058696854 | Accepted | 26 | 9,240 | 182 | S = input()
import collections
c = collections.Counter(list(S))
ans = "yes"
for i in c.values():
if i == 1:
pass
else:
ans = "no"
break
print(ans) |
s026215412 | p03436 | u773265208 | 2,000 | 262,144 | Wrong Answer | 25 | 3,316 | 1,091 | We have an H \times W grid whose squares are painted black or white. The square at the i-th row from the top and the j-th column from the left is denoted as (i, j). Snuke would like to play the following game on this grid. At the beginning of the game, there is a character called Kenus at square (1, 1). The player re... | from collections import deque
H,W = map(int,input().split())
c =[]
c.append(['#' for _ in range(W+2)])
ans = [[0 for _ in range(W+2)]for _ in range(H+2)]
score = 0
for i in range(H):
tmp = list('#'+input()+'#')
c.append(tmp)
for j in range(W+2):
if tmp[j] == '.':
score += 1
c.append(['... | s191003497 | Accepted | 25 | 3,444 | 1,086 | from collections import deque
H,W = map(int,input().split())
c =[]
c.append(['#' for _ in range(W+2)])
ans = [[0 for _ in range(W+2)]for _ in range(H+2)]
score = 0
for i in range(H):
tmp = list('#'+input()+'#')
c.append(tmp)
for j in range(W+2):
if tmp[j] == '.':
score += 1
c.append(['... |
s259446344 | p02281 | u777299405 | 1,000 | 131,072 | Wrong Answer | 20 | 7,700 | 832 | Binary trees are defined recursively. A binary tree _T_ is a structure defined on a finite set of nodes that either * contains no nodes, or * is composed of three disjoint sets of nodes: \- a root node. \- a binary tree called its left subtree. \- a binary tree called its right subtree. Your task is to wr... | n = int(input())
tree = [0] * n
root = set(range(n))
for i in range(n):
node_id, left, right = map(int, input().split())
tree[node_id] = (left, right)
root -= {left, right}
root_node = root.pop()
def preorder(i):
if i == -1:
return
(left, right) = tree[i]
yield i
yield from preorde... | s617632377 | Accepted | 20 | 7,776 | 832 | n = int(input())
tree = [0] * n
root = set(range(n))
for i in range(n):
node_id, left, right = map(int, input().split())
tree[node_id] = (left, right)
root -= {left, right}
root_node = root.pop()
def preorder(i):
if i == -1:
return
(left, right) = tree[i]
yield i
yield from preorde... |
s235248337 | p03555 | u445404615 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 123 | 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. | c1 = input()
c2 = input()
if c1[0] == c2[2] and c1[1] == c2[1] and c1[2] == c2[0]:
print('Yes')
else:
print('No') | s997532053 | Accepted | 17 | 2,940 | 123 | c1 = input()
c2 = input()
if c1[0] == c2[2] and c1[1] == c2[1] and c1[2] == c2[0]:
print('YES')
else:
print('NO') |
s868622839 | p03469 | u379424722 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 59 | On some day in January 2018, Takaki is writing a document. The document has a column where the current date is written in `yyyy/mm/dd` format. For example, January 23, 2018 should be written as `2018/01/23`. After finishing the document, she noticed that she had mistakenly wrote `2017` at the beginning of the date col... | N = list(input())
N[3] = "7"
date = ''.join(N)
print(date) | s523696148 | Accepted | 17 | 2,940 | 58 | N = list(input())
N[3] = "8"
date = ''.join(N)
print(date) |
s244389501 | p03815 | u252828980 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 87 | Snuke has decided to play with a six-sided die. Each of its six sides shows an integer 1 through 6, and two numbers on opposite sides always add up to 7. Snuke will first put the die on the table with an arbitrary side facing upward, then repeatedly perform the following operation: * Operation: Rotate the die 90° t... | n = int(input())
if n%11 != 0:
print(n//11*2+1)
elif n%11 == 0:
print(n//11*2) | s801477879 | Accepted | 18 | 2,940 | 123 | n = int(input())
if n%11 >=7:
print(n//11*2+2)
elif n%11 >= 1:
print(n//11*2+1)
elif n%11 == 0:
print(n//11*2) |
s168323947 | p03943 | u134712256 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 76 | 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... | s = list(map(int,input().split()))
print("Yes" if s[0]+s[1]==s[2] else "No") | s271341653 | Accepted | 17 | 2,940 | 85 | s = list(map(int,input().split()))
s.sort()
print("Yes" if s[0]+s[1]==s[2] else "No") |
s755722127 | p03854 | u210827208 | 2,000 | 262,144 | Wrong Answer | 30 | 3,188 | 324 | 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()
s=s[::-1]
X=['maerd','remaerd','esare','resare']
ans='Yes'
i=0
while i<=len(s)-5:
if s[i:i+5] in X:
i+=5
else:
if s[i:i+6] in X:
i+=6
else:
if s[i:i+7] in X:
i+=7
else:
ans='No'
break
print(... | s356987865 | Accepted | 30 | 3,188 | 324 | s=input()
s=s[::-1]
X=['maerd','remaerd','esare','resare']
ans='YES'
i=0
while i<=len(s)-5:
if s[i:i+5] in X:
i+=5
else:
if s[i:i+6] in X:
i+=6
else:
if s[i:i+7] in X:
i+=7
else:
ans='NO'
break
print(... |
s148747825 | p02610 | u595952233 | 2,000 | 1,048,576 | Wrong Answer | 708 | 46,716 | 1,037 | We have N camels numbered 1,2,\ldots,N. Snuke has decided to make them line up in a row. The happiness of Camel i will be L_i if it is among the K_i frontmost camels, and R_i otherwise. Snuke wants to maximize the total happiness of the camels. Find the maximum possible total happiness of the camel. Solve this probl... | import heapq
def greedy(limit, n):
ans = 0
hq = []
for i in range(n-1, -1, -1):
for item in limit[i]:
heapq.heappush(hq, -item)
if hq:
ans += -heapq.heappop(hq)
return ans
def solve():
n = int(input())
left = []
limit_l = [[] for i in ra... | s846156085 | Accepted | 723 | 46,736 | 1,038 | import heapq
def greedy(limit, n):
ans = 0
hq = []
for i in range(n-1, -1, -1):
for item in limit[i]:
heapq.heappush(hq, -item)
if hq:
ans += -heapq.heappop(hq)
return ans
def solve():
n = int(input())
left = []
limit_l = [[] for i in ra... |
s533959945 | p03534 | u785578220 | 2,000 | 262,144 | Wrong Answer | 27 | 4,340 | 138 | 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. | import collections
a=list(input())
c=collections.Counter(a)
t = sorted(list(c.values()))
if t[-1] - t[0] > 1:print("YES")
else:print("NO") | s570786544 | Accepted | 19 | 3,188 | 135 | s = input()
a, b, c = [s.count(i) for i in 'abc']
if max(a, b, c) - min(a, b, c) not in [0, 1]:
print('NO')
else:
print('YES')
|
s839323984 | p03377 | u393881437 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 77 | 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 = ['a','b','c']
s = list(input())
s.sort()
print('Yes' if a == s else 'No') | s700515664 | Accepted | 17 | 2,940 | 140 | a,b,x = list(map(int,input().split()))
if a > x:
print('NO')
else:
if a+b >= x:
print('YES')
else:
print('NO')
|
s775774122 | p03524 | u185948224 | 2,000 | 262,144 | Wrong Answer | 33 | 9,456 | 158 | 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. | from collections import Counter
s = input()
cnt = list(Counter(s).values())
if len(cnt) < 3: cnt.append(0)
print('Yes' if max(cnt) - min(cnt) <= 1 else 'No') | s263262595 | Accepted | 37 | 9,316 | 158 | from collections import Counter
s = input()
cnt = list(Counter(s).values())
if len(cnt) < 3: cnt.append(0)
print('YES' if max(cnt) - min(cnt) <= 1 else 'NO') |
s254164926 | p03067 | u219417113 | 2,000 | 1,048,576 | Wrong Answer | 17 | 2,940 | 105 | 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 (a>b and b>c) or (a<b and b<c):
print("Yes")
else:
print("No") | s138758373 | Accepted | 17 | 2,940 | 106 | a,b,c=map(int,input().split())
if (a>c and b<c) or (a<c and b>c):
print("Yes")
else:
print("No")
|
s655501840 | p04044 | u941794834 | 2,000 | 262,144 | Wrong Answer | 17 | 3,060 | 142 | 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,b=list(map(int,input().split()))
a=[]
for i in range(n-1):
x=input()
a.append(x[:-1])
a.append(input())
a.sort()
print("".join(a)) | s135908542 | Accepted | 17 | 3,060 | 93 | n, l = map(int, input().split())
a = [input() for i in range(n)]
a.sort()
print("".join(a)) |
s119493354 | p03565 | u996672406 | 2,000 | 262,144 | Wrong Answer | 18 | 3,064 | 690 | 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 = list(input())
slen = len(s)
t = list(input())
tlen = len(t)
box = []
phase = 0
def check(wh, phase=1):
if wh + phase >= slen:
return False
if s[wh + phase] == "?" or s[wh + phase] == t[phase]:
if phase + 1 == tlen:
return True
return check(wh, phase + 1)
return... | s526998670 | Accepted | 18 | 3,064 | 630 | s = list(input())
slen = len(s)
t = list(input())
tlen = len(t)
box = []
def check(wh, phase=0):
if wh + phase >= slen:
return False
if s[wh + phase] == "?" or s[wh + phase] == t[phase]:
if phase + 1 == tlen:
return True
return check(wh, phase + 1)
return False
def um... |
s045205673 | p03544 | u626468554 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 226 | 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())
#n,k = map(int,input().split())
#x = list(map(int,input().split()))
n = int(input())
li = [0 for i in range(100)]
li[0]=2
li[1]=1
for i in range(n-1):
li[i+2]=li[i+1]+li[i]
print(li[-1])
#print(li)
| s976144595 | Accepted | 17 | 2,940 | 225 | #n = int(input())
#n,k = map(int,input().split())
#x = list(map(int,input().split()))
n = int(input())
li = [0 for i in range(100)]
li[0]=2
li[1]=1
for i in range(n-1):
li[i+2]=li[i+1]+li[i]
print(li[n])
#print(li)
|
s810839121 | p03712 | u319818856 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 232 | You are given a image with a height of H pixels and a width of W pixels. Each pixel is represented by a lowercase English letter. The pixel at the i-th row from the top and j-th column from the left is a_{ij}. Put a box around this image and output the result. The box should consist of `#` and have a thickness of 1. | def picture_frame(H: int, W: int, A: list)->list:
return ['#' * (W+2)] + ['#' + s + '#' for s in A] + ['#' * (W+2)]
if __name__ == "__main__":
H = 0
H, W = map(int, input().split())
A = [input() for _ in range(H)]
| s523833808 | Accepted | 18 | 3,060 | 291 | def picture_frame(H: int, W: int, A: list)->list:
return ['#' * (W+2)] + ['#' + s + '#' for s in A] + ['#' * (W+2)]
if __name__ == "__main__":
H = 0
H, W = map(int, input().split())
A = [input() for _ in range(H)]
ans = picture_frame(H, W, A)
print('\n'.join(ans))
|
s304270533 | p03400 | u924828749 | 2,000 | 262,144 | Wrong Answer | 25 | 9,180 | 233 | Some number of chocolate pieces were prepared for a training camp. The camp had N participants and lasted for D days. The i-th participant (1 \leq i \leq N) ate one chocolate piece on each of the following days in the camp: the 1-st day, the (A_i + 1)-th day, the (2A_i + 1)-th day, and so on. As a result, there were X ... | n = int(input())
d,x = [int(t) for t in input().split()]
a = []
for i in range(n):
a.append(int(input()))
res = 0
for i in range(n):
c = a[i]
res += 1
while c < d:
res += 1
c += a[i]
print(i,res)
res += x
print(res) | s616807193 | Accepted | 28 | 9,184 | 218 | n = int(input())
d,x = [int(t) for t in input().split()]
a = []
for i in range(n):
a.append(int(input()))
res = 0
for i in range(n):
c = a[i]
res += 1
while c < d:
res += 1
c += a[i]
res += x
print(res) |
s577973963 | p03547 | u923279197 | 2,000 | 262,144 | Wrong Answer | 17 | 3,064 | 379 | In programming, hexadecimal notation is often used. In hexadecimal notation, besides the ten digits 0, 1, ..., 9, the six letters `A`, `B`, `C`, `D`, `E` and `F` are used to represent the values 10, 11, 12, 13, 14 and 15, respectively. In this problem, you are given two letters X and Y. Each X and Y is `A`, `B`, `C`,... | def changer(x):
if x=='A':
return 1
elif x=='B':
return 2
elif x=='C':
return 3
elif x=='D':
return 4
elif x=='E':
return 5
elif x=='F':
return 6
else:
return 0
a,b=map(str,input().split())
if changer(a)>changer(b):
print('<')
elif ... | s592444696 | Accepted | 18 | 3,060 | 379 | def changer(x):
if x=='A':
return 1
elif x=='B':
return 2
elif x=='C':
return 3
elif x=='D':
return 4
elif x=='E':
return 5
elif x=='F':
return 6
else:
return 0
a,b=map(str,input().split())
if changer(a)>changer(b):
print('>')
elif ... |
s787199708 | p03386 | u367130284 | 2,000 | 262,144 | Wrong Answer | 18 | 2,940 | 64 | Print all the integers that satisfies the following in ascending order: * Among the integers between A and B (inclusive), it is either within the K smallest integers or within the K largest integers. | a,b,k=map(int,input().split())
for s in range(a,a+k):
print(s) | s569469140 | Accepted | 18 | 3,064 | 94 | a,b,k=map(int,input().split());r=range(a,b+1)
for i in sorted(set(r[:k])|set(r[-k:])):print(i) |
s229361334 | p03080 | u100409377 | 2,000 | 1,048,576 | Wrong Answer | 17 | 2,940 | 156 | There are N people numbered 1 to N. Each person wears a red hat or a blue hat. You are given a string s representing the colors of the people. Person i wears a red hat if s_i is `R`, and a blue hat if s_i is `B`. Determine if there are more people wearing a red hat than people wearing a blue hat. | N=int(input())
r,b=0,0
X=[x for x in input()]
for x in X:
if x=='R':
r+=1
else:
b+=1
if b>r:
print('Yes')
else:
print('No')
| s013526954 | Accepted | 17 | 2,940 | 156 | N=int(input())
r,b=0,0
X=[x for x in input()]
for x in X:
if x=='R':
r+=1
else:
b+=1
if r>b:
print('Yes')
else:
print('No') |
s094387174 | p04043 | u063346608 | 2,000 | 262,144 | Wrong Answer | 17 | 3,060 | 197 | 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())
if A == 5 and B == 5 and C == 7:
print("Yes")
elif B == 5 and C == 5 and A == 7:
print("Yes")
elif C == 5 and A == 5 and B == 7:
print("Yes")
else:
print("No") | s260421120 | Accepted | 17 | 3,060 | 197 | A,B,C = map(int,input().split())
if A == 5 and B == 5 and C == 7:
print("YES")
elif B == 5 and C == 5 and A == 7:
print("YES")
elif C == 5 and A == 5 and B == 7:
print("YES")
else:
print("NO") |
s061016939 | p00387 | u435226340 | 1,000 | 262,144 | Wrong Answer | 20 | 5,592 | 51 | Yae joins a journey plan, in which parties will be held several times during the itinerary. She wants to participate in all of them and will carry several dresses with her. But the number of dresses she can carry with her may be smaller than that of the party opportunities. In that case, she has to wear some of her dre... | A, B = map(int, input().split())
print((B+A-1)/A)
| s715801637 | Accepted | 20 | 5,580 | 52 | A, B = map(int, input().split())
print((B+A-1)//A)
|
s303866320 | p03352 | u396210538 | 2,000 | 1,048,576 | Wrong Answer | 18 | 3,060 | 235 | You are given a positive integer X. Find the largest _perfect power_ that is at most X. Here, a perfect power is an integer that can be represented as b^p, where b is an integer not less than 1 and p is an integer not less than 2. | # from sys import stdin
import math
X = int(input())
ans = 0
for i in range(int(math.sqrt(X))+1):
for x in range(11):
print(i,x)
if i**x < X and i**x > ans:
ans = i**x
print(ans)
| s777342391 | Accepted | 17 | 2,940 | 238 | # from sys import stdin
import math
X = int(input())
ans = 0
for i in range(int(math.sqrt(X))+1):
for x in range(11):
# print(i,x)
if i**x <= X and i**x > ans:
ans = i**x
print(ans)
|
s969534706 | p03400 | u816552564 | 2,000 | 262,144 | Wrong Answer | 26 | 9,048 | 119 | Some number of chocolate pieces were prepared for a training camp. The camp had N participants and lasted for D days. The i-th participant (1 \leq i \leq N) ate one chocolate piece on each of the following days in the camp: the 1-st day, the (A_i + 1)-th day, the (2A_i + 1)-th day, and so on. As a result, there were X ... | N = int(input())
D,X = input().split()
x = 0
for n in range(N):
An = int(input())
x += 1+(N-1)//An
print(str(x)+X)
| s168483791 | Accepted | 28 | 9,092 | 130 | N = int(input())
D,X = input().split()
x = 0
for n in range(N):
An = int(input())
x += 1+(int(D)-1)//An
c = x+int(X)
print(c)
|
s006160887 | p03160 | u192042624 | 2,000 | 1,048,576 | Wrong Answer | 108 | 14,588 | 390 | 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... | #frog
N = int(input())
h = list(map(int,input().split()))
dp = [10000000000000] * N
dp[0] = 0
def dpf():
for i in range(1,N):
x = abs( h[i] - h[i-1] ) + dp[i-1]
y = abs( h[i] - h[i-2] ) + dp[i-2]
if x >=y:
dp[i] = y
else:
dp[i] = x
def solve():
dpf()
... | s685414187 | Accepted | 96 | 13,976 | 376 | #frog
N = int(input())
h = list(map(int,input().split()))
dp = [10000000000000] * N
dp[0] = 0
def dpf():
for i in range(1,N):
x = abs( h[i] - h[i-1] ) + dp[i-1]
y = abs( h[i] - h[i-2] ) + dp[i-2]
if x >=y:
dp[i] = y
else:
dp[i] = x
def solve():
dpf()
... |
s229587162 | p03544 | u597455618 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 111 | 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())
l_1 = 2; l_2 = 1;l_n = 3
for i in range(n):
l_1, l_2, l_n = l_2, l_n, (l_1 + l_2)
print(l_1) | s885366829 | Accepted | 18 | 2,940 | 112 | n = int(input())
l_0 = 2; l_1 = 1; l_n = 3
for i in range(n):
l_0, l_1, l_n = l_1, l_n, (l_1 + l_n)
print(l_0) |
s248346598 | p03814 | u662430503 | 2,000 | 262,144 | Wrong Answer | 34 | 3,516 | 204 | 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... | def main():
s=input()
start=0
end=len(s)
for i in range(0,len(s)):
if s[i]=='A':
start=i
break
for i in range(1,len(s)):
if s[-i]=='Z':
end=len(s)-i
break
main()
| s627131755 | Accepted | 32 | 3,512 | 225 | def main():
s=input()
start=0
end=len(s)
for i in range(0,len(s)):
if s[i]=='A':
start=i
break
for i in range(1,len(s)):
if s[-i]=='Z':
end=len(s)-i
break
print(end-start+1)
main()
|
s309890300 | p03379 | u405660020 | 2,000 | 262,144 | Wrong Answer | 370 | 26,756 | 283 | When l is an odd number, the median of l numbers a_1, a_2, ..., a_l is the (\frac{l+1}{2})-th largest value among a_1, a_2, ..., a_l. You are given N numbers X_1, X_2, ..., X_N, where N is an even number. For each i = 1, 2, ..., N, let the median of X_1, X_2, ..., X_N excluding X_i, that is, the median of X_1, X_2, ..... | from sys import stdin
input = stdin.readline
n = int(input())
x = list(map(int, input().split()))
x_sorted=sorted(x)
c = (x_sorted[n//2-1]+x_sorted[n//2])/2
print(x_sorted)
for i in range(n):
if x[i]>=c:
print(x_sorted[n//2-1])
else:
print(x_sorted[n//2])
| s698141391 | Accepted | 340 | 25,572 | 267 | from sys import stdin
input = stdin.readline
n = int(input())
x = list(map(int, input().split()))
x_sorted=sorted(x)
c = (x_sorted[n//2-1]+x_sorted[n//2])/2
for i in range(n):
if x[i]>=c:
print(x_sorted[n//2-1])
else:
print(x_sorted[n//2])
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.