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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
s616068261 | p03351 | u192908410 | 2,000 | 1,048,576 | Wrong Answer | 19 | 3,188 | 176 | 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 ... | import math
x = list(map(int, input().split()))
s = math.fabs(x[2]-x[0]) < x[3]
t = math.fabs(x[1]-x[0]) < x[3] and math.fabs(x[2]-x[1]) < x[3]
print("Yes" if s or t else "No") | s438319671 | Accepted | 18 | 3,188 | 179 | import math
x = list(map(int, input().split()))
s = math.fabs(x[2]-x[0]) <= x[3]
t = math.fabs(x[1]-x[0]) <= x[3] and math.fabs(x[2]-x[1]) <= x[3]
print("Yes" if s or t else "No") |
s308621409 | p02678 | u054556734 | 2,000 | 1,048,576 | Wrong Answer | 2,208 | 85,368 | 1,139 | 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... |
import numpy as np
import scipy.sparse as sps
import scipy.misc as spm
import collections as col
import functools as func
import itertools as ite
import fractions as frac
import math as ma
import copy as cp
import sys
def sinput(): return sys.stdin.readline()
def iinput(): return int(sinput())
def imap(): return map(i... | s535707165 | Accepted | 1,028 | 76,864 | 1,335 | import numpy as np
import scipy.sparse as sps
import scipy.misc as spm
import collections as col
import functools as func
import itertools as ite
import fractions as frac
import math as ma
from math import cos,sin,tan,sqrt
import cmath as cma
import copy as cp
import sys
import re
sys.setrecursionlimit(10**7)
EPS = sys... |
s916693301 | p03795 | u690536347 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 37 | Snuke has a favorite restaurant. The price of any meal served at the restaurant is 800 yen (the currency of Japan), and each time a customer orders 15 meals, the restaurant pays 200 yen back to the customer. So far, Snuke has ordered N meals at the restaurant. Let the amount of money Snuke has paid to the restaurant ... | n=int(input())
print(n*800-200*n//15) | s345925897 | Accepted | 17 | 2,940 | 39 | n=int(input())
print(n*800-200*(n//15)) |
s709845311 | p03455 | u022830425 | 2,000 | 262,144 | Wrong Answer | 18 | 2,940 | 152 | AtCoDeer the deer found two positive integers, a and b. Determine whether the product of a and b is even or odd. | input_str = input().split(" ")
a = int(input_str[0])
b = int(input_str[1])
product = a * b
if product % 2 == 1:
print("odd")
else:
print("even")
| s534090461 | Accepted | 17 | 2,940 | 121 | ls = input().split(" ")
a = int(ls[0])
b = int(ls[1])
c = a * b
if c % 2 == 1:
print("Odd")
else:
print("Even")
|
s208529738 | p03456 | u996564551 | 2,000 | 262,144 | Wrong Answer | 26 | 9,356 | 116 | 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. | N = []
N = input().split(' ')
n = int(''.join(N))
if isinstance((n ** 0.5), int):
print('Yes')
else:
print('No') | s332848017 | Accepted | 28 | 9,332 | 117 | N = []
N = input().split(' ')
n = int(''.join(N))
W = str(n ** 0.5)
if '.0' in W:
print('Yes')
else:
print('No') |
s070932277 | p03339 | u780269042 | 2,000 | 1,048,576 | Wrong Answer | 2,104 | 12,632 | 271 | There are N people standing in a row from west to east. Each person is facing east or west. The directions of the people is given as a string S of length N. The i-th person from the west is facing east if S_i = `E`, and west if S_i = `W`. You will appoint one of the N people as the leader, then command the rest of the... | n = int(input())
s = list(input())
count=0
counts=[]
for i in range(n):
east,west = s[:i],s[i+1:]
for n in east:
if n=="w":
count+=1
for e in west:
if e == "e":
count +=1
counts.append(count)
print(min(counts)) | s471355055 | Accepted | 202 | 8,012 | 218 | n = int(input())
s = list(input())
temp = s[1:].count('E')
res = temp
for i in range(len(s)-1):
if s[i+1] == "E":
temp-=1
if s[i] == "W":
temp+=1
res = min(res,temp)
print(res)
|
s060763598 | p03416 | u347600233 | 2,000 | 262,144 | Wrong Answer | 124 | 2,940 | 215 | Find the number of _palindromic numbers_ among the integers between A and B (inclusive). Here, a palindromic number is a positive integer whose string representation in base 10 (without leading zeros) reads the same forward and backward. | a, b = map(int, input().split())
cnt = 0
for i in range(a, b + 1):
flag = True
si = str(i)
for j in range(len(si) // 2):
if si[j] != si[-(j + 1)]:
flag = False
if flag:
cnt += 1
| s781088658 | Accepted | 124 | 3,060 | 232 | a, b = map(int, input().split())
cnt = 0
for i in range(a, b + 1):
flag = True
si = str(i)
for j in range(len(si) // 2):
if si[j] != si[-(j + 1)]:
flag = False
if flag:
cnt += 1
print(cnt) |
s853816383 | p03471 | u497046426 | 2,000 | 262,144 | Wrong Answer | 2,103 | 3,064 | 431 | 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())
flag = False
for z in range(N):
rem1 = N - z
for y in range(rem1):
rem2 = rem1 - y
for x in range(rem2):
val = 10000*x + 5000*y + 1000*z
if val == Y:
flag = True
break
if flag == True:
b... | s699173858 | Accepted | 896 | 3,064 | 348 | N, Y = map(int, input().split())
flag = False
for z in range(N + 1)[::-1]:
rem1 = N - z + 1
for y in range(rem1)[::-1]:
x = N - z - y
val = 10000*x + 5000*y + 1000*z
if val == Y:
flag = True
break
if flag:
break
if not flag:
x = -1
y = -1
... |
s045044822 | p03472 | u827202523 | 2,000 | 262,144 | Wrong Answer | 2,104 | 13,136 | 406 | 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, HP = map(int, input().split())
hit = []
throw = []
for i in range(N):
h, t = map(int, input().split())
hit.append(h)
throw.append(t)
h = max(hit)
throw.sort()
throw.reverse()
ans = 0
for t in throw:
if t < h:
break
else:
ans += 1
HP -= t
print("throw", HP, h)
... | s013137397 | Accepted | 345 | 7,848 | 413 | import math
N, HP = map(int, input().split())
hit = 0
throw = []
for i in range(N):
h, t = map(int, input().split())
if h > hit:
hit = h
throw.append(t)
throw.sort()
ans = 0
for t in throw[::-1]:
if t < hit:
break
else:
ans += 1
HP -= t
if HP <= 0:
... |
s184047568 | p03997 | u898967808 | 2,000 | 262,144 | Wrong Answer | 26 | 9,136 | 68 | You are given a trapezoid. The lengths of its upper base, lower base, and height are a, b, and h, respectively. An example of a trapezoid Find the area of this trapezoid. | a = int(input())
b = int(input())
h = int(input())
print((a+b*h)//2) | s349036131 | Accepted | 27 | 9,156 | 70 | a = int(input())
b = int(input())
h = int(input())
print(((a+b)*h)//2) |
s245542691 | p02401 | u566311709 | 1,000 | 131,072 | Wrong Answer | 20 | 5,608 | 261 | 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 = map(str, input().split())
a = int(a)
b = int(b)
if op == "+":
print(a + b)
elif op == "-":
print(a - b)
elif op == "*":
print(a * b)
elif op == "/":
print(a / b)
elif op == "?":
break
else:
break
| s869269677 | Accepted | 20 | 5,552 | 66 | while 1:
s = input()
if "?" in s: break
print(int(eval(s)))
|
s271692858 | p03080 | u600261652 | 2,000 | 1,048,576 | Wrong Answer | 26 | 9,104 | 82 | 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())
S = input()
print("Yes" if S.count("B") > S.count("R") else "No") | s308908154 | Accepted | 29 | 9,036 | 119 | def resolve():
N = int(input())
S = input()
print("Yes" if S.count("R") > S.count("B") else "No")
resolve() |
s664787636 | p03473 | u685244071 | 2,000 | 262,144 | Wrong Answer | 17 | 3,064 | 31 | How many hours do we have until New Year at M o'clock (24-hour notation) on 30th, December? | M = int(input())
print(24 - M) | s287978263 | Accepted | 17 | 2,940 | 32 | M = int(input())
print(48 - M)
|
s896478306 | p03672 | u860002137 | 2,000 | 262,144 | Wrong Answer | 17 | 3,060 | 249 | We will call a string that can be obtained by concatenating two equal strings an _even_ string. For example, `xyzxyz` and `aaaaaa` are even, while `ababab` and `xyzxy` are not. You are given an even string S consisting of lowercase English letters. Find the length of the longest even string that can be obtained by del... | S = input()
def judge_s(s):
if len(s)%2==1:
return False
mid = len(s)//2
if s[:mid]==s[mid:]:
return True
for i in range(1, len(S)-1):
if judge_s(S[:-i]):
ans = S[:-i]
break
else:
print(len(ans)) | s868069947 | Accepted | 18 | 3,060 | 240 | S = input()
def judge_s(s):
if len(s)%2==1:
return False
mid = len(s)//2
if s[:mid]==s[mid:]:
return True
for i in range(1, len(S)-1):
if judge_s(S[:-i]):
ans = S[:-i]
break
print(len(ans)) |
s874143167 | p03645 | u641804918 | 2,000 | 262,144 | Wrong Answer | 572 | 13,136 | 310 | In Takahashi Kingdom, there is an archipelago of N islands, called Takahashi Islands. For convenience, we will call them Island 1, Island 2, ..., Island N. There are M kinds of regular boat services between these islands. Each service connects two islands. The i-th service connects Island a_i and Island b_i. Cat Snuk... | N,M = map(int,input().split())
one = []
goal = []
for i in range(M):
A,B = map(int,input().split())
if A == 1: one.append(B)
elif B == 1: one.append(A)
if A == M: goal.append(B)
elif B == M: goal.append(A)
if set(goal) & set(one):
print("POSSIBLE")
else:
print("IMPOSSIBLE")
| s475606686 | Accepted | 656 | 25,796 | 332 | N,M = map(int,input().split())
one = []
goal = []
for i in range(M):
A,B = map(int,input().split())
if A == 1 :
one.append(B)
elif B == 1:
one.append(A)
if A == N or B == N:
goal.append(A)
goal.append(B)
if set(goal) & set(one):
print("POSSIBLE")
else:
print("I... |
s873884114 | p03719 | u382748202 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 97 | You are given three integers A, B and C. Determine whether C is not less than A and not greater than B. | A, B, C = map(int, input().split())
if C >= A and C <= B:
print('YES')
else:
print('No') | s502495391 | Accepted | 17 | 2,940 | 97 | A, B, C = map(int, input().split())
if C >= A and C <= B:
print('Yes')
else:
print('No') |
s817472086 | p03623 | u371530330 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 110 | 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')
elif abs(x-a) > abs(x-b):
print('b') | s396727346 | Accepted | 17 | 2,940 | 111 | x,a,b = map(int, input().split())
if abs(x-a) < abs(x-b):
print('A')
elif abs(x-a) > abs(x-b):
print('B') |
s698381248 | p02612 | u216752093 | 2,000 | 1,048,576 | Wrong Answer | 26 | 9,092 | 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) | s060025919 | Accepted | 30 | 9,152 | 42 | n=int(input())
n=1000-n%1000
print(n%1000) |
s052773627 | p02927 | u580697892 | 2,000 | 1,048,576 | Wrong Answer | 27 | 3,064 | 363 | Today is August 24, one of the five Product Days in a year. A date m-d (m is the month, d is the date) is called a Product Day when d is a two-digit number, and all of the following conditions are satisfied (here d_{10} is the tens digit of the day and d_1 is the ones digit of the day): * d_1 \geq 2 * d_{10} \geq... | # coding: utf-8
M, D = map(int, input().split())
ans = 0
for m in range(1, M+1):
for d in range(1, D+1):
if len(str(d)) == 1:
continue
else:
d1 = int(str(d)[0])
d2 = int(str(d)[1])
if d1*d2 == m and d1 >= 2 and d2 >= 2:
ans += 1
... | s776050439 | Accepted | 28 | 3,060 | 323 | # coding: utf-8
M, D = map(int, input().split())
ans = 0
for m in range(1, M+1):
for d in range(1, D+1):
if len(str(d)) == 1:
continue
else:
d1 = int(str(d)[0])
d2 = int(str(d)[1])
if d1*d2 == m and d1 >= 2 and d2 >= 2:
ans += 1
print(a... |
s585974431 | p03998 | u268792407 | 2,000 | 262,144 | Wrong Answer | 19 | 3,188 | 259 | 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()
s="a"
while min(len(a),len(b),len(c))>0:
if s=="a":
s=a[0]
a=a[1:]
if s=="b":
s=b[0]
b=b[1:]
if s=="c":
s=c[0]
c=c[1:]
if len(a)==0:
print("A")
if len(b)==0:
print("B")
if len(c)==0:
print("C") | s889993363 | Accepted | 17 | 3,064 | 368 | a=input()
b=input()
c=input()
s="a"
for i in range(len(a)+len(b)+len(c)):
if s=="a" and len(a)>0:
s=a[0]
a=a[1:]
elif s=="a" and len(a)==0:
print("A")
exit()
elif s=="b" and len(b)>0:
s=b[0]
b=b[1:]
elif s=="b" and len(b)==0:
print("B")
exit()
elif s=="c" and len(c)>0:
s=c[... |
s751639729 | p03909 | u629350026 | 2,000 | 262,144 | Wrong Answer | 28 | 9,140 | 325 | There is a grid with H rows and W columns. The square at the i-th row and j-th column contains a string S_{i,j} of length 5. The rows are labeled with the numbers from 1 through H, and the columns are labeled with the uppercase English letters from `A` through the W-th letter of the alphabet. Exactly one of the sq... | h,w=map(int,input().split())
ha=0
wa=0
for i in range(h):
s=list(map(str,input().split()))
for j in range(w):
if s[j]=="snuke":
wa=j
ha=i+1
print(j,ha,wa)
break
ans=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]
print(ans[wa]+str... | s444210333 | Accepted | 29 | 9,176 | 304 | h,w=map(int,input().split())
ha=0
wa=0
for i in range(h):
s=list(map(str,input().split()))
for j in range(w):
if s[j]=="snuke":
wa=j
ha=i+1
break
ans=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]
print(ans[wa]+str(ha)) |
s897948909 | p04043 | u052221988 | 2,000 | 262,144 | Wrong Answer | 16 | 2,940 | 109 | 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*b*c == 175 and a+b+c == 17 :
print("Yes")
else :
print("No") | s789002069 | Accepted | 17 | 2,940 | 109 | a, b, c = map(int, input().split())
if a*b*c == 175 and a+b+c == 17 :
print("YES")
else :
print("NO") |
s879889259 | p03672 | u966987550 | 2,000 | 262,144 | Wrong Answer | 26 | 3,444 | 344 | We will call a string that can be obtained by concatenating two equal strings an _even_ string. For example, `xyzxyz` and `aaaaaa` are even, while `ababab` and `xyzxy` are not. You are given an even string S consisting of lowercase English letters. Find the length of the longest even string that can be obtained by del... | from collections import deque
def main():
s=deque(input())
for i in range(0,len(s)):
s.pop()
print(s)
if len(s)%2==1:
continue
else:
if "".join(s)[0:len(s)//2]=="".join(s)[len(s)//2:len(s)]:
print(len(s))
break;
if __name__=... | s407159330 | Accepted | 24 | 3,444 | 327 | from collections import deque
def main():
s=deque(input())
for i in range(0,len(s)):
s.pop()
if len(s)%2==1:
continue
else:
if "".join(s)[0:len(s)//2]=="".join(s)[len(s)//2:len(s)]:
print(len(s))
break;
if __name__=='__main__':
... |
s449097031 | p03408 | u940342887 | 2,000 | 262,144 | Wrong Answer | 18 | 3,064 | 369 | Takahashi has N blue cards and M red cards. A string is written on each card. The string written on the i-th blue card is s_i, and the string written on the i-th red card is t_i. Takahashi will now announce a string, and then check every card. Each time he finds a blue card with the string announced by him, he will ea... | n = int(input())
s, t = [],[]
for _ in range(n):
s.append(input())
s_dict = {s_:0 for s_ in s}
m = int(input())
for _ in range(m):
t.append(input())
t_dict = {t_:0 for t_ in t}
for i in range(n):
s_dict[s[i]] += 1
for i in range(m):
t_dict[t[i]] += 1
for i in s_dict:
if i in t_dict:
s_d... | s361876513 | Accepted | 17 | 3,064 | 402 | n = int(input())
s, t = [],[]
for _ in range(n):
s.append(input())
s_dict = {s_:0 for s_ in s}
s_dict['aaaaaaaaaaa'] = 0
m = int(input())
for _ in range(m):
t.append(input())
t_dict = {t_:0 for t_ in t}
for i in range(n):
s_dict[s[i]] += 1
for i in range(m):
t_dict[t[i]] += 1
for i in s_dict:
i... |
s929094106 | p03385 | u887207211 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 70 | You are given a string S of length 3 consisting of `a`, `b` and `c`. Determine if S can be obtained by permuting `abc`. | S = sorted(input())
if(S == 'abc'):
print('Yes')
else:
print('No') | s108940616 | Accepted | 17 | 2,940 | 81 | S = sorted(input())
ans = "No"
if(S == ["a", "b", "c"]):
ans = "Yes"
print(ans) |
s301255403 | p04043 | u586206420 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 113 | 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 ... | s = list(map(int, input().split()))
if s[0] == 5 and s[1] == 7 and s[2] == 5:
print("YES")
else:
print("NO") | s769642592 | Accepted | 17 | 2,940 | 130 | s = list(map(int, input().split()))
if s[0] + s[1] + s[2] == 17 and s[0] * s[1] * s[2] == 175:
print("YES")
else:
print("NO")
|
s457789899 | p00119 | u871745100 | 1,000 | 131,072 | Wrong Answer | 30 | 6,744 | 1,359 | まんじゅう好きの太郎くんの家でたいへんな事件がおきました。和室の仏壇に供えてあった3つのまんじゅうのうち1つが無くなっていたのです。いつかはおやつにいただこうと狙っていた太郎くんが犯人を見つけるため捜査を始めると、その日、和室に入った人が何人もいることが分かりました。そこで、これらの容疑者が部屋に入った順序を調べるため、全員に次のような形式の証言をしてもらうことにました。 容疑者 A の証言 「私は容疑者 B より先に部屋に入った。」 容疑者の一人(?)は三毛猫のタマなので証言はできませんが、幸運にも最後に部屋に入ったところを太郎くんは見ていました。 太郎くんはこれらの証言から、部屋に入った順番を推測して捜査に役立てることにし... | # -*- coding: utf-8 -*-
def satisfy_conditions(ans, part_evidences):
for i in range(len(part_evidences)):
x, y = part_evidences[i]
xi, yi = ans.index(x), ans.index(y)
if xi > yi:
return False
return True
if __name__ == '__main__':
m = int(input())
n = int(input())
... | s194427928 | Accepted | 40 | 6,724 | 474 | visited = []
def dfs(v):
for i in edges[v]:
if i not in visited:
dfs(i)
visited.append(v)
if __name__ == '__main__':
m = int(input())
n = int(input())
edges = [[] for i in range(m)]
for i in range(n):
x, y = map(int, input().split())
edges[x - 1].append(y - ... |
s796165123 | p03386 | u846877959 | 2,000 | 262,144 | Wrong Answer | 17 | 3,060 | 255 | 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())
nums = set()
for i in range(k):
#print(a)
nums.add(a)
a += 1
if a > b:
break
for j in range(k):
#print(b)
nums.add(b)
b -= 1
if a > b:
break
for k in nums:
print(k)
| s671119065 | Accepted | 18 | 3,064 | 275 | a, b, k = map(int, input().split())
nums = set()
for i in range(k):
#print(a)
nums.add(a)
a += 1
if a > b:
break
for j in range(k):
#print(b)
nums.add(b)
b -= 1
if a > b:
break
nums = sorted(nums)
for k in nums:
print(k)
|
s457713039 | p02613 | u205758185 | 2,000 | 1,048,576 | Wrong Answer | 157 | 9,180 | 283 | Takahashi is participating in a programming contest called AXC002, and he has just submitted his code to Problem A. The problem has N test cases. For each test case i (1\leq i \leq N), you are given a string S_i representing the verdict for that test case. Find the numbers of test cases for which the verdict is `AC`,... | n = int(input())
a = 0
w = 0
t = 0
r = 0
for i in range(n):
b = input()
if b == "AC":
a += 1
if b == "WA":
w += 1
if b == "TLE":
t += 1
if b == "RE":
r += 1
print("AC x", a)
print("WA x", w)
print("TLE x", t)
print("RE2 x", r)
| s124825013 | Accepted | 149 | 9,028 | 279 | n = int(input())
a = 0
w = 0
t = 0
r = 0
for i in range(n):
b = input()
if b == "AC":
a += 1
if b == "WA":
w += 1
if b == "TLE":
t += 1
if b == "RE":
r += 1
print("AC x", a)
print("WA x", w)
print("TLE x", t)
print("RE x", r) |
s617397569 | p03719 | u121732701 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 95 | You are given three integers A, B and C. Determine whether C is not less than A and not greater than B. |
A, B, C = map(int, input().split())
if A<=C and B>=C:
print("YES")
else:
print("NO")
| s277655945 | Accepted | 17 | 2,940 | 95 |
A, B, C = map(int, input().split())
if A<=C and B>=C:
print("Yes")
else:
print("No")
|
s790562415 | p03852 | u840807329 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 69 | Given a lowercase English letter c, determine whether it is a vowel. Here, there are five vowels in the English alphabet: `a`, `e`, `i`, `o` and `u`. | c = input()
if c[0] == "c":
print("vowel")
else:
print("consonant") | s460137319 | Accepted | 17 | 2,940 | 92 | c = input()
b =["a","i","u","e","o"]
if c[0] in b:
print("vowel")
else:
print("consonant") |
s462851360 | p03474 | u459150945 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 185 | 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 = list(input().split('-'))
try:
if len(S[0]) == A and len(S2[1]) == B:
print('Yes')
else:
print('No')
except:
print('No')
| s339555721 | Accepted | 20 | 2,940 | 209 | A, B = map(int, input().split())
S = input()
if S.count('-') != 1:
print('No')
else:
S = list(S.split('-'))
if len(S[0]) == A and len(S[1]) == B:
print('Yes')
else:
print('No')
|
s365206720 | p00015 | u567380442 | 1,000 | 131,072 | Wrong Answer | 30 | 6,724 | 210 | 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... | import sys
f = sys.stdin
n = int(f.readline())
for _ in range(n):
a = f.readline().strip()
b = f.readline().strip()
c = int(a) + int(b)
c = '{}'.format(c)
print(c if len(c) else 'overflow ') | s559262615 | Accepted | 30 | 6,724 | 215 | import sys
f = sys.stdin
n = int(f.readline())
for _ in range(n):
a = f.readline().strip()
b = f.readline().strip()
c = int(a) + int(b)
c = '{}'.format(c)
print(c if len(c) <= 80 else 'overflow') |
s050274268 | p03394 | u969708690 | 2,000 | 262,144 | Wrong Answer | 33 | 11,420 | 522 | Nagase is a top student in high school. One day, she's analyzing some properties of special sets of positive integers. She thinks that a set S = \\{a_{1}, a_{2}, ..., a_{N}\\} of **distinct** positive integers is called **special** if for all 1 \leq i \leq N, the gcd (greatest common divisor) of a_{i} and the sum of t... | N=int(input())
if N<=15000:
L=list(range(2,2*(N-1),2))
if N<=10000:
if (N-1)%2==0:
k=N-2
else:
k=N-1
L.append(k)
L.append(k*3)
R=list()
else:
if (N-1)%2==0:
k=N-1
else:
k=N-2
while k%2==0:
k//=2
L.append(k)
L.append(k*3)
R=list()
else:
if... | s015542883 | Accepted | 31 | 11,400 | 558 | N=int(input())
if N==3:
print("2 5 63")
exit()
if N<=15000:
L=list(range(2,2*(N-1),2))
if N<=10000:
if (N-1)%2==0:
k=N-2
else:
k=N-1
L.append(k)
L.append(k*3)
R=list()
else:
if (N-1)%2==0:
k=N-1
else:
k=N-2
while k%2==0:
k//=2
L.append(k)
L... |
s549576477 | p03795 | u622568141 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 269 | Snuke has a favorite restaurant. The price of any meal served at the restaurant is 800 yen (the currency of Japan), and each time a customer orders 15 meals, the restaurant pays 200 yen back to the customer. So far, Snuke has ordered N meals at the restaurant. Let the amount of money Snuke has paid to the restaurant ... | # -*- coding: utf-8 -*-
import sys
import math
def main():
N = int(input())
y = math.factorial(N) % (10**9+7)
print(y)
if __name__ == '__main__':
main()
| s304769358 | Accepted | 17 | 2,940 | 263 | # -*- coding: utf-8 -*-
import sys
def main():
N = int(input())
x = 800 * N
y = 200 * int(N / 15)
print(x-y)
if __name__ == '__main__':
main()
|
s555742166 | p03625 | u190405389 | 2,000 | 262,144 | Wrong Answer | 111 | 14,244 | 203 | We have N sticks with negligible thickness. The length of the i-th stick is A_i. Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle. | N = int(input())
A = [int(x) for x in input().split()]
A.sort()
for i in range(N - 1):
if A[i] == A[i + 1]:
A[i + 1] = 0
else:
A[i] = 0
A.sort()
A.reverse()
print(A[0] * A[1])
| s931907012 | Accepted | 114 | 14,252 | 217 | N = int(input())
A = [int(x) for x in input().split()]
A.sort()
for i in range(N - 1):
if A[i] == A[i + 1]:
A[i + 1] = 0
else:
A[i] = 0
A[N - 1] = 0
A.sort()
A.reverse()
print(A[0] * A[1])
|
s417412588 | p03386 | u346395915 | 2,000 | 262,144 | Wrong Answer | 17 | 3,060 | 183 | 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())
li1 = [i for i in range(a,a+k) if i <= b]
li2 = [i for i in range(b+1-k,b+1) if i >= a]
li1.extend(li2)
li1 = set(li1)
for i in li1:
print(i)
| s936450600 | Accepted | 17 | 3,060 | 191 | a,b,k = map(int,input().split())
li1 = [i for i in range(a,a+k) if i <= b]
li2 = [i for i in range(b+1-k,b+1) if i >= a]
li1.extend(li2)
li1 = set(li1)
for i in sorted(li1):
print(i)
|
s659912505 | p02397 | u365921604 | 1,000 | 131,072 | Wrong Answer | 50 | 5,604 | 135 | Write a program which reads two integers x and y, and prints them in ascending order. | for i in range(0, 3000):
x, y = map(int, input().split(' '))
if x == 0 and y == 0:
break
else:
print(x, y)
| s724649751 | Accepted | 60 | 5,624 | 195 | for i in range(0, 3000):
array = [int(x) for x in input().split(' ')]
if array[0] == 0 and array[1] == 0:
break
else:
print(' '.join([str(x) for x in sorted(array)]))
|
s409333800 | p02612 | u758910826 | 2,000 | 1,048,576 | Wrong Answer | 28 | 9,140 | 48 | 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())
num = n % 1000
print(abs(num))
| s899923884 | Accepted | 32 | 9,112 | 155 | import math
n = int(input())
if n >= 1000:
s = 1000
i = 1000
while n > s:
s += i
# print(s)
print(s-n)
else:
print(1000-n)
|
s526977680 | p02694 | u634576930 | 2,000 | 1,048,576 | Wrong Answer | 24 | 9,164 | 127 | 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())
m=100
n=0
while True:
if m<=X:
n+=1
m=int(m*1.01)
else:
print(n)
exit()
| s516774350 | Accepted | 24 | 9,096 | 128 | X=int(input())
m=100
n=0
while True:
if m>=X:
print(n)
exit()
else:
n+=1
m=int(m*1.01)
|
s553590025 | p03048 | u127499732 | 2,000 | 1,048,576 | Wrong Answer | 2,104 | 3,444 | 208 | Snuke has come to a store that sells boxes containing balls. The store sells the following three kinds of boxes: * Red boxes, each containing R red balls * Green boxes, each containing G green balls * Blue boxes, each containing B blue balls Snuke wants to get a total of exactly N balls by buying r red boxes, g... | import itertools
r,g,b,n=map(int,input().split())
r,g,b=list(range(r+1)),list(range(g+1)),list(range(b+1))
count = 0
for i,j,k in itertools.product(r,g,b):
s = i + j + k
if s==n:
count+=1
print(count) | s007689310 | Accepted | 1,266 | 183,140 | 343 | import collections
import itertools
r,g,b,n=map(int,input().split())
x,y=n//r,n//g
x,y=list(range(0,r*x+1,r)),list(range(0,g*y+1,g))
l=[i+j for i,j in itertools.product(x,y) if i+j<=n]
z=collections.Counter(l)
count=0
for key,value in zip(z.keys(),z.values()):
v=n-key
if v==0:
count+=value
elif v%b==0:
co... |
s947081888 | p02694 | u297089927 | 2,000 | 1,048,576 | Wrong Answer | 21 | 9,148 | 79 | 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())
m=100
ans=0
while m<=x:
m=int(m*1.01)
ans+=1
print(ans)
| s364881082 | Accepted | 19 | 9,156 | 78 | x=int(input())
m=100
ans=0
while m<x:
m=int(m*1.01)
ans+=1
print(ans)
|
s275668592 | p03795 | u033524082 | 2,000 | 262,144 | Wrong Answer | 19 | 2,940 | 37 | Snuke has a favorite restaurant. The price of any meal served at the restaurant is 800 yen (the currency of Japan), and each time a customer orders 15 meals, the restaurant pays 200 yen back to the customer. So far, Snuke has ordered N meals at the restaurant. Let the amount of money Snuke has paid to the restaurant ... | n=int(input())
print(800*n-int(n/15)) | s510847891 | Accepted | 18 | 2,940 | 41 | n=int(input())
print(800*n-int(n/15)*200) |
s290224212 | p03360 | u183481524 | 2,000 | 262,144 | Wrong Answer | 18 | 2,940 | 202 | There are three positive integers A, B and C written on a blackboard. E869120 performs the following operation K times: * Choose one integer written on the blackboard and let the chosen integer be n. Replace the chosen integer with 2n. What is the largest possible sum of the integers written on the blackboard after... | A, B, C = map(int, input().split())
K = int(input())
for i in range(K):
if A > B >= C:
A = A * 2
elif B > A >= C:
B = B * 2
elif C > B >= A:
C = C * 2
print(A+B+C)
| s167529309 | Accepted | 18 | 3,060 | 251 | A, B, C = map(int, input().split())
K = int(input())
for i in range(K):
if 2*A > (B + C):
A = A * 2
elif 2*B > (A + C):
B = B * 2
elif 2*C > (B + A):
C = C * 2
elif A == B == C:
A = A * 2
print(A+B+C)
|
s764139733 | p02410 | u661284763 | 1,000 | 131,072 | Wrong Answer | 30 | 7,640 | 236 | Write a program which reads a $ n \times m$ matrix $A$ and a $m \times 1$ vector $b$, and prints their product $Ab$. A column vector with m elements is represented by the following equation. \\[ b = \left( \begin{array}{c} b_1 \\\ b_2 \\\ : \\\ b_m \\\ \end{array} \right) \\] A $n \times m$ matrix with $m$ column ve... | n, m = [int(i) for i in input().split()]
matrix = []
for ni in range(n):
matrix.append([int(a) for a in input().split()])
vector = []
for mi in range(m):
vector.append(int(input()))
print(matrix)
print()
print(vector) | s786433897 | Accepted | 30 | 8,056 | 310 | n, m = [int(i) for i in input().split()]
matrix = []
for ni in range(n):
matrix.append([int(a) for a in input().split()])
vector = []
for mi in range(m):
vector.append(int(input()))
for ni in range(n):
sum = 0
for mi in range(m):
sum += matrix[ni][mi] * vector[mi]
print(sum) |
s179221367 | p02646 | u845416499 | 2,000 | 1,048,576 | Wrong Answer | 22 | 9,172 | 236 | Two children are playing tag on a number line. (In the game of tag, the child called "it" tries to catch the other child.) The child who is "it" is now at coordinate A, and he can travel the distance of V per second. The other child is now at coordinate B, and she can travel the distance of W per second. He can catch ... | if __name__ == '__main__':
A, V = map(int, input().strip().split(" "))
B, W = map(int, input().strip().split(" "))
T = int(input().strip())
if B + W * T <= A + W * T:
print("YES")
else:
print("No")
| s827704893 | Accepted | 20 | 9,068 | 206 | A, V = list(map(int, input().strip().split()))
B, W = list(map(int, input().strip().split()))
T = int(input().strip())
L = abs(A - B)
v = V - W
if L <= (V - W) * T:
print('YES')
else:
print('NO')
|
s594394462 | p00009 | u546285759 | 1,000 | 131,072 | Time Limit Exceeded | 40,000 | 205,336 | 509 | Write a program which reads an integer n and prints the number of prime numbers which are less than or equal to n. A prime number is a natural number which has exactly two distinct natural number divisors: 1 and itself. For example, the first four prime numbers are: 2, 3, 5 and 7. | while True:
try:
n = int(input())
count = 0
if n == 1:
print("0")
else:
a = [2*i for i in range(2, 1000000)]
b = [3*i for i in range(2, 1000000)]
c = [5*i for i in range(2, 1000000)]
d = [7*i for i in range(2, 1000000)]
... | s930532876 | Accepted | 350 | 21,016 | 314 | import bisect
primes = [0, 0] + [1] * 999999
for i in range(2, 1000):
if primes[i]:
for j in range(i*i, 1000000, i):
primes[j] = 0
primes = [i for i, v in enumerate(primes) if v]
while True:
try:
n = int(input())
except:
break
print(bisect.bisect(primes, n))
|
s711254285 | p03711 | u276192130 | 2,000 | 262,144 | Wrong Answer | 17 | 3,064 | 372 | Based on some criterion, Snuke divided the integers from 1 through 12 into three groups as shown in the figure below. Given two integers x and y (1 ≤ x < y ≤ 12), determine whether they belong to the same group. | import math
h, w = map(int, input().split())
low = min(h, w)
high = max(h, w)
if h%3 == 0 or w%3 == 0:
print (0)
elif (high/3) > low:
print(high - int(high/3))
else:
a = math.ceil(high/3)*low
b = (high-math.ceil(high/3))*int(low/2)
c = abs(a-b)
a = round(high/3)*low
b = (high-round(high/3)... | s365845983 | Accepted | 17 | 2,940 | 200 | x, y = map(int, input().split())
a = [1, 3, 5, 7, 8, 10, 12]
b = [4, 6, 9, 11]
c = [2]
if (x in a and y in a) or (x in b and y in b) or (x in c and y in c):
print ("Yes")
else:
print ("No")
|
s059702702 | p04030 | u779728630 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 142 | Sig has built his own keyboard. Designed for ultimate simplicity, this keyboard only has 3 keys on it: the `0` key, the `1` key and the backspace key. To begin with, he is using a plain text editor with this keyboard. This editor always displays one string (possibly empty). Just after the editor is launched, this stri... | s = input()
res = ""
for i in range(len(s)):
if s[i] == "B":
if res != "":
res = res[:len(s)-1]
else:
res += s[i]
print(res) | s184922478 | Accepted | 18 | 2,940 | 144 | s = input()
res = ""
for i in range(len(s)):
if s[i] == "B":
if res != "":
res = res[:len(res)-1]
else:
res += s[i]
print(res) |
s572493362 | p02646 | u927373043 | 2,000 | 1,048,576 | Wrong Answer | 24 | 9,180 | 225 | Two children are playing tag on a number line. (In the game of tag, the child called "it" tries to catch the other child.) The child who is "it" is now at coordinate A, and he can travel the distance of V per second. The other child is now at coordinate B, and she can travel the distance of W per second. He can catch ... | A, V = map(int,input().split())
B, W = map(int,input().split())
T = int(input())
if(V <= W):
print("NO")
else:
x = (B-A)/(V-W)
print(x)
if(x <= T and int(x)==x):
print("YES")
else:
print("NO")
| s153776498 | Accepted | 24 | 9,040 | 183 | A, V = map(int,input().split())
B, W = map(int,input().split())
T = int(input())
if(V <= W):
print("NO")
else:
if(abs(B-A) <= T*(V-W)):
print("YES")
else:
print("NO")
|
s986830621 | p03080 | u114648678 | 2,000 | 1,048,576 | Wrong Answer | 17 | 2,940 | 138 | 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())
s=list(input().split())
for i in s:
n=0
if i=='R':
n+=1
if N/2<n:
print('Yes')
else:
print('No') | s168051841 | Accepted | 17 | 2,940 | 151 | N=int(input())
s=input()
n=0
for char in s:
if char=='R':
n+=1
else:
n+=0
if N/2<n:
print('Yes')
else:
print('No')
|
s773772688 | p03623 | u201082459 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 83 | 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 x - a >= x - b:
print('A')
else:
print('B') | s868234118 | Accepted | 18 | 2,940 | 93 | x,a,b = map(int,input().split())
if abs(x - a) <= abs(x - b):
print('A')
else:
print('B') |
s965979351 | p03067 | u001024152 | 2,000 | 1,048,576 | Wrong Answer | 18 | 2,940 | 99 | 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 <= c <= b or b <= c <= a:
print("YES")
else:
print("NO") | s679235165 | Accepted | 17 | 2,940 | 99 | a,b,c = map(int, input().split())
if a <= c <= b or b <= c <= a:
print("Yes")
else:
print("No") |
s021684087 | p03658 | u637824361 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 106 | Snuke has N sticks. The length of the i-th stick is l_i. Snuke is making a snake toy by joining K of the sticks together. The length of the toy is represented by the sum of the individual sticks that compose it. Find the maximum possible length of the toy. | N, K = map(int, input().split())
L = [int(i) for i in input().split()]
L.sort(reverse = True)
print(L[:K]) | s318796574 | Accepted | 17 | 2,940 | 111 | N, K = map(int, input().split())
L = [int(i) for i in input().split()]
L.sort(reverse = True)
print(sum(L[:K])) |
s484459396 | p03050 | u063962277 | 2,000 | 1,048,576 | Wrong Answer | 153 | 3,060 | 162 | 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
N = int(input())
ans = 0
ls = []
for i in range(1,int(math.sqrt(N))):
if N%i == 0:
ans += (N//i)-1
ls.append((N//i)-1)
print(ans) | s096843826 | Accepted | 143 | 3,064 | 153 | import math
N = int(input())
ans = 0
for i in range(1,int(math.sqrt(N))+1):
if N%i == 0 and (N//i)-1 > i:
ans = ans + (N//i)-1
print(ans) |
s114840090 | p02659 | u980932400 | 2,000 | 1,048,576 | Wrong Answer | 23 | 9,100 | 73 | Compute A \times B, truncate its fractional part, and print the result as an integer. | a,b=input().split()
a=float(a)
b=float(b)
a=a*b
print("{:.2f}".format(a)) | s359133419 | Accepted | 22 | 9,088 | 170 | a,b=input().split()
a=int(a)
bb=[0,0]
c=0
for i in b:
if(i=='.'):
c=1
continue
bb[c]*=10
bb[c]+=int(i)
res=a*bb[0] + (a*bb[1])//100
print(res) |
s538476345 | p03141 | u512294098 | 2,000 | 1,048,576 | Wrong Answer | 2,104 | 11,312 | 1,669 | 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())
A = []
B = []
for i in range(n):
a, b = tuple(map(int, input().split(' ')))
A.append(a)
B.append(b)
eaten_dishes = set()
def taka_select():
max_choice = None
happiness = 0
opponent_happiness = 0
for i in range(n):
if i in eaten_dishes:
continue
... | s201754990 | Accepted | 520 | 36,880 | 479 | n = int(input())
happiness_hash = {}
for i in range(n):
a, b = tuple(map(int, input().split(' ')))
happiness_hash[i] = (a, b)
sorted_happiness = sorted(happiness_hash.items(), key = lambda x : x[1][0] + x[1][1], reverse = True)
total = 0
i = 0
for k, v in sorted_happiness:
happiness, selected = (0, k)... |
s135345191 | p02646 | u369796672 | 2,000 | 1,048,576 | Wrong Answer | 23 | 9,184 | 167 | Two children are playing tag on a number line. (In the game of tag, the child called "it" tries to catch the other child.) The child who is "it" is now at coordinate A, and he can travel the distance of V per second. The other child is now at coordinate B, and she can travel the distance of W per second. He can catch ... | a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())
if w >= v:
print("NO")
elif (w-v)*t>=abs(b-a):
print("YES")
else:
print("NO") | s853407405 | Accepted | 23 | 9,184 | 167 | a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())
if w >= v:
print("NO")
elif (v-w)*t>=abs(b-a):
print("YES")
else:
print("NO") |
s003690884 | p02612 | u020933954 | 2,000 | 1,048,576 | Wrong Answer | 27 | 9,132 | 193 | 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. | num=input()
if int(num)<=1000:
change=1000-int(num)
else:
array_1=list(num)
array_1=array_1[-4:]
a=''.join(array_1)
b=int(array_1[-4])+1
pay=b*1000
change=pay-int(a) | s612489774 | Accepted | 30 | 9,116 | 362 | num=input()
if 1<=int(num)<=10000:
if int(num)<=1000:
change=1000-int(num)
else:
array_1=list(num)
array_1=array_1[-4:]
a=''.join(array_1)
b=int(array_1[-4])+1
pay=b*1000
change=pay-int(a)
if array_1[-1]=="0" and array_1[-2]=="0" and array_1[-3]=="... |
s872268999 | p03149 | u977193988 | 2,000 | 1,048,576 | Wrong Answer | 17 | 3,060 | 99 | You are given four digits N_1, N_2, N_3 and N_4. Determine if these can be arranged into the sequence of digits "1974". | n=set(map(str,input().split()))
k={'1','9','7','4'}
if n==k:
print('Yes')
else:
print('No') | s500775788 | Accepted | 17 | 2,940 | 99 | n=set(map(str,input().split()))
k={'1','9','7','4'}
if n==k:
print('YES')
else:
print('NO') |
s113325211 | p03129 | u717671569 | 2,000 | 1,048,576 | Wrong Answer | 17 | 3,060 | 238 | Determine if we can choose K different integers between 1 and N (inclusive) so that no two of them differ by 1. | i = list(map(int, input().split()))
n = i[0]
k = i[1]
if n > 3:
if n > k - 2:
if (n % 2 == 1 and n % k == 1) or (n % 2 == 0 and n % k == 0):
print("YES")
else:
print("NO")
else:
print("NO")
else:
print("NO") | s653442921 | Accepted | 17 | 3,064 | 464 | i = list(map(int, input().split()))
n = i[0]
k = i[1]
if n >= 1 and k <= 100:
if n == 1 and k == 1:
print("YES")
elif n > k:
if n % 2 == 1:
if int(n / k) >= 2:
print("YES")
elif int(n / k) == 1 and (int(n % k) == k - 1):
print("YES")
else:
print("NO")
else:
... |
s724900795 | p04029 | u632369368 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 40 | 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((1 + N) * N / 2)
| s072481481 | Accepted | 17 | 2,940 | 41 | N = int(input())
print((1 + N) * N // 2)
|
s942392027 | p03139 | u051393148 | 2,000 | 1,048,576 | Wrong Answer | 17 | 2,940 | 112 | 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... | a, b, c = map(int, input().split())
_max = max(b,c)
_min = max(0, ((b+c)-a))
print('{0} {1}'.format(_max, _min)) | s160109979 | Accepted | 17 | 2,940 | 112 | a, b, c = map(int, input().split())
_max = min(b,c)
_min = max(0, ((b+c)-a))
print('{0} {1}'.format(_max, _min)) |
s772355521 | p03455 | u769739808 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 91 | AtCoDeer the deer found two positive integers, a and b. Determine whether the product of a and b is even or odd. | a, b = map(int, input().split())
if (a * b) % 2 :
print("Even")
else:
print("Odd") | s460644097 | Accepted | 17 | 2,940 | 96 | a, b = map(int, input().split())
if (a * b) % 2 == 0 :
print("Even")
else:
print("Odd") |
s328768015 | p03067 | u667024514 | 2,000 | 1,048,576 | Wrong Answer | 17 | 2,940 | 94 | 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 < c or c < b < a:
print("Yes")
else:
print("No") | s971152607 | Accepted | 17 | 2,940 | 94 | a,b,c = map(int,input().split())
if a < c < b or b < c < a:
print("Yes")
else:
print("No") |
s663246333 | p03494 | u039860745 | 2,000 | 262,144 | Time Limit Exceeded | 2,104 | 3,060 | 182 | 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 = input()
li = list(map(int, input().split()))
count = 0
while(a % 2 == 0 for a in li):
li = [ a / 2 for a in li]
count += 1
# a,b = map(int, input().split())
print(count) | s524719458 | Accepted | 19 | 3,060 | 225 | n = input()
li = list(map(int, input().split()))
count = 0
while all(a % 2 == 0 for a in li):
li = [ a / 2 for a in li]
count += 1
# a,b = map(int, input().split())
print(count) |
s269133514 | p04044 | u575560095 | 2,000 | 262,144 | Wrong Answer | 17 | 3,060 | 145 | 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 = []
ans = ""
for i in range(N):
S.append(input())
sorted(S)
for i in range(len(S)):
ans += S[i]
print(ans)
| s731220154 | Accepted | 18 | 3,060 | 126 | l=[]
a=''
N,L=map(int,input().split())
for i in range(N):
l.append(input())
l.sort()
for i in range(N):
a += l[i]
print(a)
|
s742522964 | p03636 | u506287026 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 43 | The word `internationalization` is sometimes abbreviated to `i18n`. This comes from the fact that there are 18 letters between the first `i` and the last `n`. You are given a string s of length at least 3 consisting of lowercase English letters. Abbreviate s in the same way. | s = input()
print(s[0] + s[1:-1] + s[-1])
| s875508400 | Accepted | 17 | 2,940 | 53 | s = input()
print(s[0] + str(len(s[1:-1])) + s[-1])
|
s427211843 | p03964 | u390958150 | 2,000 | 262,144 | Wrong Answer | 23 | 3,060 | 266 | 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... | ans = 0
for i in range(int(input())):
t_i, a_i = list(map(lambda x: int(x), input().split()))
if i == 0:
t, a = t_i, a_i
else:
n = max((t + t_i - 1) // t_i, (a + a_i - 1) // a_i)
t = n*t_i
a = n*a_i
ans = t + a | s636381568 | Accepted | 22 | 3,064 | 278 | ans = 0
for i in range(int(input())):
t_i, a_i = list(map(lambda x: int(x), input().split()))
if i == 0:
t, a = t_i, a_i
else:
n = max((t + t_i - 1) // t_i, (a + a_i - 1) // a_i)
t = n*t_i
a = n*a_i
ans = t + a
print(ans) |
s040878136 | p02842 | u854061980 | 2,000 | 1,048,576 | Wrong Answer | 17 | 3,060 | 210 | Takahashi bought a piece of apple pie at ABC Confiserie. According to his memory, he paid N yen (the currency of Japan) for it. The consumption tax rate for foods in this shop is 8 percent. That is, to buy an apple pie priced at X yen before tax, you have to pay X \times 1.08 yen (rounded down to the nearest integer).... | s=int(input())
n = int(s/1.08)
print(n)
for i in range(n):
if int(n*1.08)==s:
print(n)
break
elif int(n*1.08)<s:
n+=1
continue
else:
print(":(")
break | s080971041 | Accepted | 17 | 3,060 | 111 | import math
s=int(input())
n = math.ceil(s/1.08)
if math.floor(n*1.08)==s:
print(n)
else:
print(":(") |
s271976441 | p04030 | u055941944 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 166 | Sig has built his own keyboard. Designed for ultimate simplicity, this keyboard only has 3 keys on it: the `0` key, the `1` key and the backspace key. To begin with, he is using a plain text editor with this keyboard. This editor always displays one string (possibly empty). Just after the editor is launched, this stri... | # -*- coding utf-8 -*-
s=list(input())
ans=""
for i in range(0,len(s),1):
if s[i]==1 or s[i]==0:
ans+=ans[i]
else:
ans=ans[:-1]
print(ans)
| s752769722 | Accepted | 17 | 2,940 | 190 | # -*- coding utf-8 -*-
s=input()
ans=""
for i in range(len(s)):
if s[i]=="B":
ans=ans[:-1]
elif s[i]=="1":
ans+="1"
elif s[i]=="0":
ans+="0"
print(ans)
|
s269270236 | p02394 | u506468108 | 1,000 | 131,072 | Wrong Answer | 20 | 5,592 | 246 | Write a program which reads a rectangle and a circle, and determines whether the circle is arranged inside the rectangle. As shown in the following figures, the upper right coordinate $(W, H)$ of the rectangle and the central coordinate $(x, y)$ and radius $r$ of the circle are given. | W, H, x, y, r= map(int, input().split())
edgeleft = x - r
edgeright = x + r
edgetop = y + r
edgebottom = y - r
if (edgeleft <= 0) | (edgeright >= W):
print("No")
elif (edgetop >= H) | (edgebottom <= 0):
print("No")
else:
print("yes")
| s122886256 | Accepted | 20 | 5,596 | 272 | W, H, x, y, r= map(int, input().split())
edge_left = x - r
edge_right = x + r
edge_top = y + r
edge_bottom = y - r
if (edge_left < 0) | (edge_right > W):
answer = "No"
elif (edge_top > H) | (edge_bottom < 0):
answer = "No"
else:
answer = "Yes"
print(answer)
|
s694422890 | p03494 | u581603131 | 2,000 | 262,144 | Wrong Answer | 17 | 3,060 | 206 | 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()))
count = 0
for k in range(0, 5*10**8):
for i in A:
if i%2==0:
count += 1
i = i//2
else:
break
print(count) | s178405843 | Accepted | 18 | 3,060 | 166 | N = int(input())
A = list(map(int, input().split()))
count = 0
while all(i%2==0 for i in A):
for i in range(N):
A[i] = A[i]//2
count += 1
print(count) |
s376645564 | p04043 | u442948527 | 2,000 | 262,144 | Wrong Answer | 27 | 8,964 | 91 | 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 ... | s=input().split()
print(["NO","YES"]["5" in s and "7" in s and ("5 5" in s or "5 7" in s)]) | s545353237 | Accepted | 23 | 8,856 | 71 | a,b,c=sorted(input().split())
print(["NO","YES"][a==b=="5" and c=="7"]) |
s586981674 | p03693 | u989564346 | 2,000 | 262,144 | Wrong Answer | 20 | 3,064 | 168 | 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... | from sys import stdin
a, b, c = [int(x) for x in stdin.readline().rstrip().split()]
r = (a * 100) + (b * 10) + c
if r % 4 == 0:
print("Yes")
else:
print("No")
| s840893634 | Accepted | 18 | 2,940 | 168 | from sys import stdin
a, b, c = [int(x) for x in stdin.readline().rstrip().split()]
r = (a * 100) + (b * 10) + c
if r % 4 == 0:
print("YES")
else:
print("NO")
|
s194257875 | p03129 | u777207626 | 2,000 | 1,048,576 | Wrong Answer | 18 | 2,940 | 88 | 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())
m = int(n/2)+n%2
ans = 'Yes' if m>=k else 'No'
print(ans) | s109894979 | Accepted | 17 | 2,940 | 88 | n,k = map(int,input().split())
m = int(n/2)+n%2
ans = 'YES' if m>=k else 'NO'
print(ans) |
s415069075 | p03739 | u457901067 | 2,000 | 262,144 | Wrong Answer | 171 | 17,108 | 759 | You are given an integer sequence of length N. The i-th term in the sequence is a_i. In one operation, you can select a term and either increment or decrement it by one. At least how many operations are necessary to satisfy the following conditions? * For every i (1≤i≤n), the sum of the terms from the 1-st through ... | N = int(input())
A = list(map(int, input().split()))
S = [0] * (N+1)
for i in range(N):
S[i+1] = S[i] + A[i]
print(S)
#S[1] > 0
ans1 = 0
work = 0
for i in range(1,N+1):
if i%2 == 1:
if S[i] + work <= 0:
temp = 1 - (S[i] + work)
ans1 += temp
work += temp
else:
# neg is required
... | s966309992 | Accepted | 161 | 14,468 | 760 | N = int(input())
A = list(map(int, input().split()))
S = [0] * (N+1)
for i in range(N):
S[i+1] = S[i] + A[i]
#print(S)
#S[1] > 0
ans1 = 0
work = 0
for i in range(1,N+1):
if i%2 == 1:
if S[i] + work <= 0:
temp = 1 - (S[i] + work)
ans1 += temp
work += temp
else:
# neg is required
... |
s481993396 | p03493 | u145410317 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 60 | Snuke has a grid consisting of three squares numbered 1, 2 and 3. In each square, either `0` or `1` is written. The number written in Square i is s_i. Snuke will place a marble on each square that says `1`. Find the number of squares on which Snuke will place a marble. | nums = list(map(int, input().split()))
print(nums.count(1)) | s015039703 | Accepted | 16 | 2,940 | 43 | nums = list(input())
print(nums.count("1")) |
s255593654 | p02795 | u914671452 | 2,000 | 1,048,576 | Wrong Answer | 25 | 3,060 | 128 | We have a grid with H rows and W columns, where all the squares are initially white. You will perform some number of painting operations on the grid. In one operation, you can do one of the following two actions: * Choose one row, then paint all the squares in that row black. * Choose one column, then paint all t... | h = int(input())
w = int(input())
n = int(input())
a = max(h,w)
b = a
count = 0
while b <= n:
b += a
count += 1
print(count) | s774568331 | Accepted | 18 | 3,060 | 181 | h = int(input())
w = int(input())
n = int(input())
a = max(h,w)
b = a
count = 0
if h*w == n:
print(h)
elif b >= n:
print(1)
else:
while b*count < n:
count += 1
print(count) |
s522462899 | p03477 | u152638361 | 2,000 | 262,144 | Wrong Answer | 17 | 3,060 | 126 | 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())
if (a+b)>(c+d):
print("Right")
elif (a+b)<(c+d):
print("Left")
else: print("Balanced") | s921513783 | Accepted | 17 | 3,060 | 126 | 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") |
s295110670 | p03079 | u328751895 | 2,000 | 1,048,576 | Wrong Answer | 18 | 2,940 | 73 | You are given three integers A, B and C. Determine if there exists an equilateral triangle whose sides have lengths A, B and C. | A, B, C = map(int, input().split())
print('YES' if A == B == C else 'NO') | s048472376 | Accepted | 17 | 2,940 | 73 | A, B, C = map(int, input().split())
print('Yes' if A == B == C else 'No') |
s977256124 | p03198 | u297574184 | 2,000 | 1,048,576 | Wrong Answer | 271 | 26,180 | 699 | There are N positive integers A_1, A_2, ..., A_N. Takahashi can perform the following operation on these integers any number of times: * Choose 1 \leq i \leq N and multiply the value of A_i by -2. Notice that he multiplies it by **minus** two. He would like to make A_1 \leq A_2 \leq ... \leq A_N holds. Find the mi... | def func(i):
return numMinuss[i] * numPluss[i]
N = int(input())
As = list(map(int, input().split()))
numPluss = [0] * (N+1)
stack = [(N, As[-1])]
for i in reversed(range(1, N)):
if As[i-1] > As[i]:
k = ((As[i-1] // As[i] - 1).bit_length() + 1) // 2 * 2
numPluss[i] = k
numMinuss = [0] * (N+1... | s594079172 | Accepted | 1,816 | 41,692 | 722 | from math import ceil, log2
def getNums(As, N):
dp = list(range(16))
nums = [0] * N
for i in reversed(range(N - 1)):
dx = ceil( log2( As[i] / As[i+1] ) / 2 )
if dx <= 0:
dp0 = dp[0]
dp = [dp0] * (-dx) + dp[:16+dx]
else:
dp15 = dp[15]
k... |
s154940112 | p03493 | u431981421 | 2,000 | 262,144 | Wrong Answer | 2,103 | 2,940 | 215 | Snuke has a grid consisting of three squares numbered 1, 2 and 3. In each square, either `0` or `1` is written. The number written in Square i is s_i. Snuke will place a marble on each square that says `1`. Find the number of squares on which Snuke will place a marble. | a = list(map(int, input().split()))
c = 0
while True:
f = False
for i in a:
if i % 2 == 1:
f = True
if f == True:
break
for index, i in enumerate(a):
a[index] = i / 2
c += 1
print(c) | s289046769 | Accepted | 17 | 2,940 | 86 | li = list(input())
count = 0
for i in li:
if i == '1':
count += 1
print(count) |
s467976712 | p02694 | u019075898 | 2,000 | 1,048,576 | Wrong Answer | 20 | 9,076 | 107 | 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())
bank = 100
year = 0
while bank > X:
bank = bank * 101 // 100
year += 1
print(year) | s654090417 | Accepted | 21 | 9,100 | 107 | X = int(input())
bank = 100
year = 0
while bank < X:
bank = bank * 101 // 100
year += 1
print(year) |
s810717025 | p03067 | u848647227 | 2,000 | 1,048,576 | Wrong Answer | 17 | 2,940 | 90 | 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 c > a and c < b:
print("YES")
else:
print("NO") | s892450472 | Accepted | 17 | 3,060 | 125 | a,b,c = map(int,input().split(" "))
for i in range(min(a,b),max(a,b)+1):
if i == c:
print("Yes")
exit()
print("No") |
s947752375 | p03599 | u466478199 | 3,000 | 262,144 | Wrong Answer | 3,156 | 8,944 | 566 | 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())
l=[0]
ans=[]
m=int(f*e/100)
for i in range(int(f//a)):
for j in range((f-100*i)//b):
for k in range(m//c):
for n in range((m-k*c)//d):
X=100*a*i+100*b*j
Y=k*c+n*d
print(0)
if X+Y==0 or X+Y>f:
continue
else:
p=1... | s344025261 | Accepted | 125 | 3,316 | 484 | a,b,c,d,e,f=map(int,input().split())
x=set()
y=set()
m=f//(100*a)
for i in range(m+1):
for j in range(f//(100*b)+1):
x1=i*100*a+j*100*b
if x1<=f:
x.add(x1)
m=int(f*(e/100))
for i in range(0,m+1,c):
for j in range(0,m-i+1,d):
y.add(i+j)
x.remove(0)
z=[-1]
ans=[]
for i in x:
for j in y:
if ... |
s339565732 | p02409 | u527848444 | 1,000 | 131,072 | Wrong Answer | 30 | 6,724 | 229 | 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... | data = [[[0 for r in range(10)]for f in range(3)]for b in range(4)]
for b in range(4):
for f in range(3):
for r in range(10):
print(' {0}'.format(data[b][f][r]),end='')
print()
print('#' * 20) | s592157303 | Accepted | 40 | 6,720 | 364 | data = [[[0 for r in range(10)] for f in range(3)] for b in range(4)]
n = int(input())
for _ in range(n):
(b,f,r,v) = [int(i) for i in input().split()]
data[b - 1][f - 1][r - 1] += v
for b in range(4):
for f in range(3):
for r in range(10):
print('',data[b][f][r], end='')
p... |
s976831725 | p02744 | u459590249 | 2,000 | 1,048,576 | Wrong Answer | 171 | 14,048 | 445 | In this problem, we only consider strings consisting of lowercase English letters. Strings s and t are said to be **isomorphic** when the following conditions are satisfied: * |s| = |t| holds. * For every pair i, j, one of the following holds: * s_i = s_j and t_i = t_j. * s_i \neq s_j and t_i \neq t_j. F... | std=[]
n=int(input())
cmb=[[] for i in range(n)]
cmb[0].append("a")
tmp=[[] for i in range(n)]
if n==1:
print("a")
for i in range(1,n):
for j in range(len(cmb)):
for s in cmb[j]:
for k in range(0,j+1):
tmp[j].append(s+chr(ord("a")+k))
tmp[j+1].append(s+chr(ord("a")+k+1))
cmb=tmp
tmp=[[] for i in range(n... | s031895343 | Accepted | 184 | 14,048 | 437 | std=[]
n=int(input())
cmb=[[] for i in range(n)]
cmb[0].append("a")
tmp=[[] for i in range(n)]
for i in range(1,n):
for j in range(len(cmb)):
for s in cmb[j]:
for k in range(0,j+1):
tmp[j].append(s+chr(ord("a")+k))
tmp[j+1].append(s+chr(ord("a")+k+1))
#print(cmb)
cmb=tmp
tmp=[[] for i in range(n)]
lst=[... |
s994213251 | p02262 | u231136358 | 6,000 | 131,072 | Wrong Answer | 20 | 7,772 | 663 | Shell Sort is a generalization of [Insertion Sort](http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_1_A) to arrange a list of $n$ elements $A$. 1 insertionSort(A, n, g) 2 for i = g to n-1 3 v = A[i] 4 j = i - g 5 while j >= 0 && A[j] > v 6 A[j+... | def insertion_sort(A, N, gap):
cnt = 0
for i in range(gap, N):
tmp = A[i]
j = i - gap
while j>=0 and A[j] > tmp:
A[j+gap] = A[j]
j = j - gap
cnt = cnt + 1
A[j+gap] = tmp
return cnt
def shell_sort(A, N):
cnt = 0
m = 10
gaps = [i... | s858428445 | Accepted | 20,890 | 127,956 | 635 | def insertion_sort(A, N, gap):
global cnt
for i in range(gap, N):
tmp = A[i]
j = i - gap
while j>=0 and A[j] > tmp:
A[j+gap] = A[j]
j = j - gap
cnt += 1
A[j+gap] = tmp
def shell_sort(A, N):
gaps = [int((3**item-1)/2) for item in range(1, 1... |
s264951108 | p03565 | u759651152 | 2,000 | 262,144 | Wrong Answer | 17 | 3,064 | 675 | 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... | #-*-coding:utf-8-*-
def main():
s_hint = list(input())
t = list(input())
for i in range(len(s_hint)):
if s_hint[i] == t[0] and len(s_hint) - i <= len(s_hint):
arry = s_hint[i+1:i + len(t)]
if len(set(arry)) == 1:
start = i
for j in range(star... | s831577165 | Accepted | 17 | 3,064 | 390 | #-*-coding:utf-8-*-
def main():
s = input()
t = input()
i = -1
for j in range(len(s) - len(t) + 1):
if all(a == '?' or a == b for a, b in zip(s[j:], t)):
i = j
if i == -1:
print('UNRESTORABLE')
else:
ans = s[:i] + t + s[i+len(t):]
ans = ans.replace('... |
s970495965 | p02866 | u426108351 | 2,000 | 1,048,576 | Wrong Answer | 107 | 14,396 | 136 | Given is an integer sequence D_1,...,D_N of N elements. Find the number, modulo 998244353, of trees with N vertices numbered 1 to N that satisfy the following condition: * For every integer i from 1 to N, the distance between Vertex 1 and Vertex i is D_i. | n = int(input())
a = list(map(int, input().split()))
c = [0]*(n+1)
for i in a:
c[i] += 1
ans = 1
for i in c[1:]:
ans *= i
print(ans) | s106055838 | Accepted | 137 | 14,396 | 337 | n = int(input())
a = list(map(int, input().split()))
c = [0]*(n+1)
for i in a:
c[i] += 1
ans = 1
for i in range(n+1):
if c[-1] == 0:
c.pop()
else:
break
mod = 998244353
for i in range(len(c)-1):
ans *= pow(c[i], c[i+1], mod)
ans %= mod
if a[0] != 0:
ans *= 0
if c[0] != 1:
ans... |
s284462961 | p03591 | u102126195 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 80 | 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 ... | S = input()
print(S)
if S[:4] == "YAKI":
print("Yes")
else:
print("No")
| s612598907 | Accepted | 17 | 2,940 | 71 | S = input()
if S[:4] == "YAKI":
print("Yes")
else:
print("No")
|
s659753259 | p03386 | u035210736 | 2,000 | 262,144 | Wrong Answer | 29 | 9,120 | 161 | 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())
x = [i for i in range(a, min(a + k, b + 1))]
y = [i for i in range(max(a, b - k + 1), b + 1)]
for i in set(x + y):
print(i) | s151203240 | Accepted | 31 | 9,012 | 169 | a, b, k = map(int, input().split())
x = [i for i in range(a, min(a + k, b + 1))]
y = [i for i in range(max(a, b - k + 1), b + 1)]
for i in sorted(set(x + y)):
print(i) |
s966314704 | p00718 | u200148444 | 1,000 | 131,072 | Wrong Answer | 120 | 5,624 | 1,822 | Prof. Hachioji has devised a new numeral system of integral numbers with four lowercase letters "m", "c", "x", "i" and with eight digits "2", "3", "4", "5", "6", "7", "8", "9". He doesn't use digit "0" nor digit "1" in this system. The letters "m", "c", "x" and "i" correspond to 1000, 100, 10 and 1, respectively, and ... | n=int(input())
for i in range(n):
s0,s1=map(str,input().split())
ans=""
ans0=0
ans1=0
ans2=0
p=1
for j in range(len(s0)):
if s0[j]!="m" and s0[j]!="c" and s0[j]!="x" and s0[j]!="i" :
p=int(s0[j])
continue
if s0[j]=="m":
ans0+=p*1000
... | s350369353 | Accepted | 110 | 5,632 | 1,790 | n=int(input())
for i in range(n):
s0,s1=map(str,input().split())
ans=""
ans0=0
ans1=0
ans2=0
p=1
for j in range(len(s0)):
if s0[j]!="m" and s0[j]!="c" and s0[j]!="x" and s0[j]!="i" :
p=int(s0[j])
continue
if s0[j]=="m":
ans0+=p*1000
... |
s439363589 | p03693 | u481250941 | 2,000 | 262,144 | Wrong Answer | 73 | 16,232 | 921 | 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... | #
# abc064 a
#
import sys
from io import StringIO
import unittest
def input():
return sys.stdin.readline().rstrip()
class TestClass(unittest.TestCase):
def assertIO(self, input, output):
stdout, stdin = sys.stdout, sys.stdin
sys.stdout, sys.stdin = StringIO(), StringIO(input)
resolve()... | s394556162 | Accepted | 74 | 16,160 | 929 | #
# abc064 a
#
import sys
from io import StringIO
import unittest
def input():
return sys.stdin.readline().rstrip()
class TestClass(unittest.TestCase):
def assertIO(self, input, output):
stdout, stdin = sys.stdout, sys.stdin
sys.stdout, sys.stdin = StringIO(), StringIO(input)
resolve... |
s339910128 | p03861 | u278356323 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 136 | 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? | #ABC048b
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
a, b, x = map(int, input().split())
print((b - a + 1) // x) | s553162726 | Accepted | 17 | 3,060 | 176 | #ABC048b
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
a, b, x = map(int, input().split())
ans = b // x - a // x
if (a % x == 0):
ans += 1
print(ans) |
s881142082 | p02741 | u144203608 | 2,000 | 1,048,576 | Wrong Answer | 17 | 3,064 | 251 | Print the K-th element of the following sequence of length 32: 1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51 | K=int(input())
if K==32 :
print(51)
elif K==24 :
print(15)
elif K==16 :
print(14)
elif K==8 or 12 or 18 or 20 or 27 :
print(5)
elif K==4 or 6 or 9 or 10 or 14 or 21 or 22 or 25 or 26 :
print(2)
elif K==28 or 30 :
print(4)
else :
print(1) | s363039561 | Accepted | 17 | 3,064 | 485 | K=int(input())
if K==4 :
print(2)
elif K==6 :
print(2)
elif K==8 :
print(5)
elif K==9 :
print(2)
elif K==10 :
print(2)
elif K==12 :
print(5)
elif K==14 :
print(2)
elif K==16 :
print(14)
elif K==18 :
print(5)
elif K==20 :
print(5)
elif K==21 :
print(2)
elif K==22 :
print(2)
elif K==24 :
print(1... |
s552309579 | p02396 | u215335591 | 1,000 | 131,072 | Wrong Answer | 160 | 5,600 | 113 | In the online judge system, a judge file may include multiple datasets to check whether the submitted program outputs a correct answer for each test case. This task is to practice solving a problem with multiple datasets. Write a program which reads an integer x and print it as is. Note that multiple datasets are give... | count = 1
while True:
x = int(input())
if x == 0:
break
print("Case ",count,": ", x, sep="")
| s729417342 | Accepted | 150 | 5,600 | 128 | count = 1
while True:
x = int(input())
if x == 0:
break
print("Case ",count,": ", x, sep="")
count += 1
|
s770887964 | p03852 | u045793300 | 2,000 | 262,144 | Wrong Answer | 24 | 8,996 | 172 | Given a lowercase English letter c, determine whether it is a vowel. Here, there are five vowels in the English alphabet: `a`, `e`, `i`, `o` and `u`. | s303032703 | Accepted | 32 | 9,072 | 59 | s = input()
print('vowel' if s in 'aeiou' else 'consonant') | |
s510671342 | p03477 | u797016134 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 124 | 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())
if a+b>c+d:
print("Left")
if a+b<c+d:
print("Right")
else:
print("Balanced") | s200121897 | Accepted | 17 | 2,940 | 133 | a,b,c,d = map(int, input().split())
if a+b>c+d:
print("Left")
if a+b<c+d:
print("Right")
if a+b == c+d:
print("Balanced") |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.