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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
s943902063 | p03485 | u088751997 | 2,000 | 262,144 | Wrong Answer | 24 | 9,068 | 47 | You are given two positive integers a and b. Let x be the average of a and b. Print x rounded up to the nearest integer. | a,b = map(int,input().split())
print((a+b+1)/2) | s974140512 | Accepted | 19 | 9,152 | 48 | a,b = map(int,input().split())
print((a+b+1)//2) |
s793821573 | p00015 | u358919705 | 1,000 | 131,072 | Wrong Answer | 20 | 7,536 | 156 | 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... | for _ in range(int(input())):
a = int(input())
b = int(input())
s = a + b
if s >= 1e79:
print('overflow')
else:
print(s) | s344466035 | Accepted | 20 | 7,640 | 160 | for _ in range(int(input())):
a = int(input())
b = int(input())
s = a + b
if s >= 10 ** 80:
print('overflow')
else:
print(s) |
s147912963 | p03214 | u879870653 | 2,525 | 1,048,576 | Wrong Answer | 17 | 2,940 | 158 | Niwango-kun is an employee of Dwango Co., Ltd. One day, he is asked to generate a thumbnail from a video a user submitted. To generate a thumbnail, he needs to select a frame of the video according to the following procedure: * Get an integer N and N integers a_0, a_1, ..., a_{N-1} as inputs. N denotes the numbe... | N = int(input())
A = list(map(int,input().split()))
p = sum(A)/N
q = 10**9+7
for i in range(N) :
r = abs(p - A[i])
if r < q :
r = q
ans = i
print(ans)
| s667189035 | Accepted | 17 | 3,060 | 193 | N = int(input())
L = list(map(int,input().split()))
mean = sum(L)/N
q = 10**9+7
ans = -1
for i in range(N) :
di = abs(mean - L[i])
if di < q :
q = di
ans = i
print(ans)
|
s801258553 | p03637 | u503901534 | 2,000 | 262,144 | Wrong Answer | 63 | 15,020 | 354 | We have a sequence of length N, a = (a_1, a_2, ..., a_N). Each a_i is a positive integer. Snuke's objective is to permute the element in a so that the following condition is satisfied: * For each 1 ≤ i ≤ N - 1, the product of a_i and a_{i + 1} is a multiple of 4. Determine whether Snuke can achieve his objective. | n = int(input())
a = list(map(int,input().split()))
b_4 = 0
b_2 = 0
kisu = 0
for i in range(n):
if a[i] % 4 ==1 or 3:
kisu = kisu + 1
elif a[i] % 2 == 2:
b_2 = b_2 + 1
else:
b_4 = b_4 + 1
if b_2 == 0 and kisu - b_4 < 2:
print('Yes')
elif b_2 > 1 and b_4 - kisu <2:
... | s828455711 | Accepted | 84 | 14,252 | 359 | n = int(input())
a = list(map(int,input().split()))
zero = 0
two = 0
odd = 0
for i in range(len(a)):
if a[i] % 4 == 1 or a[i] % 4 == 3:
odd = odd + 1
elif a[i] % 4 == 0:
zero = zero + 1
else:
two = two + 1
if zero >= odd -1 and two == 0:
print('Yes')
elif zero >= odd:
... |
s674619843 | p03836 | u952491523 | 2,000 | 262,144 | Wrong Answer | 17 | 3,060 | 213 | Dolphin resides in two-dimensional Cartesian plane, with the positive x-axis pointing right and the positive y-axis pointing up. Currently, he is located at the point (sx,sy). In each second, he can move up, down, left or right by a distance of 1. Here, both the x\- and y-coordinates before and after each movement ... | sx, sy, tx, ty = map(int,input().split())
dx = (tx - sx)
dy = (ty - sy)
s = 'U' * dy + 'R' * dx
s += 'D' * dy + 'L' * dx
s += 'L' + 'U' * (dy+1) + 'R' * (dx+1)
s += 'R' + 'D' * (dy+1) + 'L' * (dx+1)
print(s) | s919263215 | Accepted | 17 | 3,060 | 225 | sx, sy, tx, ty = map(int,input().split())
dx = (tx - sx)
dy = (ty - sy)
s = 'U' * dy + 'R' * dx
s += 'D' * dy + 'L' * dx
s += 'L' + 'U' * (dy+1) + 'R' * (dx+1) + 'D'
s += 'R' + 'D' * (dy+1) + 'L' * (dx+1) + 'U'
print(s) |
s449987266 | p03433 | u374802266 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 64 | 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,A=int(input()),int(input())
print('Yes' if N%500==A else 'No') | s335801963 | Accepted | 27 | 9,160 | 81 | n=int(input())
a=int(input())
if n%500<=a:
print('Yes')
else:
print('No') |
s983748047 | p02388 | u646500971 | 1,000 | 131,072 | Wrong Answer | 20 | 5,572 | 31 | Write a program which calculates the cube of a given integer x. | x = int(input())
x = x * x * x
| s409559849 | Accepted | 20 | 5,572 | 40 | x = int(input())
x = x * x * x
print(x)
|
s469645560 | p04043 | u490489966 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 180 | 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 ... | #ABC042 A
a,b,c=map(int,input().split())
if a==b==5 and c==7:
print("Yes")
elif a==c==5 and b==7:
print("Yes")
elif b==c==5 and a==7:
print("Yes")
else:
print("No") | s768929509 | Accepted | 18 | 3,060 | 181 | #ABC042 A
a,b,c=map(int,input().split())
if a==b==5 and c==7:
print("YES")
elif a==c==5 and b==7:
print("YES")
elif b==c==5 and a==7:
print("YES")
else:
print("NO") |
s833055545 | p02467 | u978863922 | 1,000 | 131,072 | Wrong Answer | 20 | 5,600 | 499 | Factorize a given integer n. |
try:
n = int(input())
except:
exit
max_len = n
work = [1 for i in range(0,max_len+1)]
prime = []
soinsu = []
for i in range(2,max_len+1):
if (work[i] == 1 ):
prime.append(i)
j = i * 2
while ( j <= max_len ):
work[j] = 0
j += i
t = n
while (t > 1):
for... | s428600987 | Accepted | 20 | 5,664 | 499 | import math
n = int(input())
soinsu = []
c = n
if (c % 2 == 0):
while True:
soinsu.append(2)
c = c // 2
if ( c % 2 != 0):
break
len = int(math.sqrt(c)) + 1
for i in range (3,len,2):
while True:
if ( c % i != 0):
break
soinsu.append(i)
... |
s055254215 | p03964 | u831695469 | 2,000 | 262,144 | Wrong Answer | 2,102 | 3,444 | 2,059 | AtCoDeer the deer is seeing a quick report of election results on TV. Two candidates are standing for the election: Takahashi and Aoki. The report shows the ratio of the current numbers of votes the two candidates have obtained, but not the actual numbers of votes. AtCoDeer has checked the report N times, and when he c... | N = input()
t = []
a = []
for i in range(int(N)):
t_n, a_n = input().split() ... | s759791907 | Accepted | 118 | 5,332 | 1,197 | import math
from decimal import Decimal
N = input()
t = []
a = [] ... |
s987969113 | p03555 | u538127485 | 2,000 | 262,144 | Wrong Answer | 18 | 2,940 | 161 | 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. | line1 = input().strip()
line2 = input().strip()
if line1[0] == line2[2] and line1[1] == line2[1] and line1[2] == line2[0]:
print(True)
else:
print(False) | s732150951 | Accepted | 17 | 2,940 | 162 | line1 = input().strip()
line2 = input().strip()
if line1[0] == line2[2] and line1[1] == line2[1] and line1[2] == line2[0]:
print("YES")
else:
print("NO") |
s728323558 | p03494 | u707870100 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 191 | 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. | # -*- coding: utf-8 -*-
tmp = input().split()
num = len(tmp)
max = 0
for j in tmp:
d = int(j)
n = 0
while(d % 2 == 0):
n=n+1
d=d/2
# print(j)
# print(n)
if(max<n):
max=n
print(n)
| s221120878 | Accepted | 19 | 2,940 | 218 | # -*- coding: utf-8 -*-
tmp = input()
tmp = input().split()
num = len(tmp)
min = int(tmp[0])
#print (min)
for j in tmp:
d = int(j)
n = 0
while(d % 2 == 0):
n=n+1
d=d/2
if(min>n):
min=n
# print(n)
print(min)
|
s987214880 | p03555 | u967835038 | 2,000 | 262,144 | Wrong Answer | 17 | 3,064 | 231 | You are given a grid with 2 rows and 3 columns of squares. The color of the square at the i-th row and j-th column is represented by the character C_{ij}. Write a program that prints `YES` if this grid remains the same when rotated 180 degrees, and prints `NO` otherwise. | a=str(input())
b=str(input())
c=0
d=0
for i in range(3):
slice=a[c:c+1]
c=c+1
for j in range(3):
slice=b[d:d+1]
d=d+1
if(a[0:1]==b[2:3] and a[1:2]==b[1:2] and a[2:3]==b[0:1]):
print("Yes")
else:
print("No")
| s987451998 | Accepted | 17 | 3,064 | 85 | a=str(input())
b=str(input())
if(a==b[::-1]):
print("YES")
else:
print("NO")
|
s982804065 | p03494 | u681444474 | 2,000 | 262,144 | Time Limit Exceeded | 2,104 | 3,060 | 215 | 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(input().split())
b = [int(i) for i in a]
ans=0
def cal2(k):
return k /2
while True:
if sum(b)% 2 == 0:
b = list(map(cal2,b))
ans+=1
else:
print(ans)
print(ans) | s897609274 | Accepted | 164 | 12,484 | 190 | import numpy as np
N=int(input())
A=list(map(int,input().split()))
A=np.array(A)
ans=2**9
for i in A:
cnt=0
while i%2==0:
i=i/2
cnt+=1
if ans > cnt:
ans=cnt
print(ans) |
s459228690 | p03456 | u546417841 | 2,000 | 262,144 | Wrong Answer | 18 | 2,940 | 176 | 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. | a=input()
a=a.replace(' ','')
a=int(a)
print(a)
flag=False
for i in range(100):
if i*i == a:
flag=True
if flag:
print('Yes')
else:
print('No')
| s921168047 | Accepted | 17 | 2,940 | 158 | a=input()
a=a.replace(' ','')
a=int(a)
flag=False
for i in range(350):
if i*i == a:
flag=True
if flag:
print('Yes')
else:
print('No')
|
s389572635 | p03351 | u477343425 | 2,000 | 1,048,576 | Wrong Answer | 17 | 3,060 | 192 | 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())
check_between_c_a = c - a <= d
check_between_cb_a = c-b <= d and b - a <= d
if(check_between_c_a and check_between_cb_a):
print('Yes')
else:
print('No') | s255637876 | Accepted | 18 | 2,940 | 142 | a,b,c,d = map(int, input().split())
check1 = abs(c-a) <= d
check2 = abs(b-a) <= d and abs(c-b) <= d
print('Yes' if check1 or check2 else 'No') |
s100279190 | p03761 | u238510421 | 2,000 | 262,144 | Wrong Answer | 18 | 3,064 | 692 | Snuke loves "paper cutting": he cuts out characters from a newspaper headline and rearranges them to form another string. He will receive a headline which contains one of the strings S_1,...,S_n tomorrow. He is excited and already thinking of what string he will create. Since he does not know the string on the headlin... | n = int(input())
s_list = list()
for i in range(n):
s_list.append(input())
dictionary_list = list()
for s in s_list:
dictionary = dict()
for w in s:
if w in dictionary:
dictionary[w] += 1
else:
dictionary[w] = 1
dictionary_list.append(dictionary)
first = di... | s464460458 | Accepted | 25 | 3,444 | 788 | from collections import OrderedDict
n = int(input())
s_list = list()
for i in range(n):
s_list.append(input())
dictionary_list = list()
for s in s_list:
dictionary = dict()
for w in s:
if w in dictionary:
dictionary[w] += 1
else:
dictionary[w] = 1
dictionary... |
s097666104 | p02613 | u945065638 | 2,000 | 1,048,576 | Wrong Answer | 152 | 17,388 | 211 | 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())
i = []
for x in range(n):
x = input()
i.append(x)
print(i)
print('AC x ',i.count('AC'))
print('WA x ',i.count('WA'))
print('TLE x ',i.count('TLE'))
print('RE x ',i.count('RE')) | s794638825 | Accepted | 150 | 16,124 | 199 | n = int(input())
i = []
for x in range(n):
x = input()
i.append(x)
print('AC x',i.count('AC'))
print('WA x',i.count('WA'))
print('TLE x',i.count('TLE'))
print('RE x',i.count('RE')) |
s592928919 | p03377 | u280552586 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 69 | There are a total of A + B cats and dogs. Among them, A are known to be cats, but the remaining B are not known to be either cats or dogs. Determine if it is possible that there are exactly X cats among these A + B animals. | a,b,c=map(int, input().split())
print('YES' if a+b<=c<=a+b else 'NO') | s810202669 | Accepted | 17 | 2,940 | 75 | a, b, x = map(int, input().split())
print('YES' if a <= x <= b+a else 'NO') |
s174718681 | p02845 | u329407311 | 2,000 | 1,048,576 | Wrong Answer | 416 | 14,396 | 244 | N people are standing in a queue, numbered 1, 2, 3, ..., N from front to back. Each person wears a hat, which is red, blue, or green. The person numbered i says: * "In front of me, exactly A_i people are wearing hats with the same color as mine." Assuming that all these statements are correct, find the number of p... | n=int(input())
List=list(map(int,input().split()))
arr = [0,0,0]
ans = 1
for i in range(len(List)):
a = List[i]
b = arr.count(a)
if b > 0:
j = arr.index(a)
arr[j] = a + 1
ans = ans * b
print(b)
print(ans) | s687719095 | Accepted | 310 | 14,020 | 287 | n=int(input())
List=list(map(int,input().split()))
arr = [0,0,0]
ans = 1
MOD = 1000000007
for i in range(len(List)):
a = List[i]
b = arr.count(a)
if b > 0:
j = arr.index(a)
arr[j] = a + 1
ans = ans * b
else:
ans = 0
break
print(ans%MOD) |
s557256150 | p03695 | u030726788 | 2,000 | 262,144 | Wrong Answer | 17 | 3,060 | 145 | In AtCoder, a person who has participated in a contest receives a _color_ , which corresponds to the person's rating as follows: * Rating 1-399 : gray * Rating 400-799 : brown * Rating 800-1199 : green * Rating 1200-1599 : cyan * Rating 1600-1999 : blue * Rating 2000-2399 : yellow * Rating 2400-2799 : or... | n=int(input())
a=list(map(int,input().split()))
s=set()
fr=0
for i in a:
x=i//400
if(x<8):s.add(x)
else:fr+=1
ki=len(s)
print(min(ki+fr,8)) | s298658727 | Accepted | 17 | 3,060 | 161 | n=int(input())
a=list(map(int,input().split()))
s=set()
fr=0
for i in a:
x=i//400
if(x<8):s.add(x)
else:fr+=1
ki=len(s)
ma=ki+fr
mi=max(ki,1)
print(mi,ma)
|
s989092144 | p03079 | u902151549 | 2,000 | 1,048,576 | Wrong Answer | 17 | 2,940 | 100 | You are given three integers A, B and C. Determine if there exists an equilateral triangle whose sides have lengths A, B and C. | hen=list(map(int,input().split()))
if max(hen)>sum(hen)-max(hen):
print("Yes")
else:
print("No") | s385554985 | Accepted | 17 | 2,940 | 90 | hen=set(list(map(int,input().split())))
if len(hen)==1:
print("Yes")
else:
print("No") |
s315142745 | p03680 | u148981246 | 2,000 | 262,144 | Wrong Answer | 150 | 9,124 | 254 | 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 ... | n = int(input())
cnt = 0
for i in range(n):
a = int(input())
if i ==0 and a==2:
print(0)
break
else:
if a == 2:
print(i)
break
if a == 1:
print(-1)
break | s395041101 | Accepted | 171 | 12,708 | 225 | n = int(input())
a = [0]
for i in range(n):
a.append(int(input()))
cnt = 0
a_before = 1
while cnt <= n:
cnt += 1
if a[a_before] == 2:
print(cnt)
break
a_before = a[a_before]
else:
print(-1) |
s343031642 | p03352 | u603234915 | 2,000 | 1,048,576 | Wrong Answer | 18 | 2,940 | 159 | 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. | n = int(input())
l = []
for i in range(1,101):
for j in range(1,11):
k = i**j
if k <=n:
l.append(k)
print('{}'.format(max(l)))
| s986291108 | Accepted | 17 | 2,940 | 159 | n = int(input())
l = []
for i in range(1,101):
for j in range(2,11):
k = i**j
if k <=n:
l.append(k)
print('{}'.format(max(l)))
|
s410035971 | p00042 | u798803522 | 1,000 | 131,072 | Wrong Answer | 20 | 7,736 | 1,272 | 宝物がたくさん収蔵されている博物館に、泥棒が大きな風呂敷を一つだけ持って忍び込みました。盗み出したいものはたくさんありますが、風呂敷が耐えられる重さが限られており、これを超えると風呂敷が破れてしまいます。そこで泥棒は、用意した風呂敷を破らず且つ最も価値が高くなるようなお宝の組み合わせを考えなくてはなりません。 風呂敷が耐えられる重さ W、および博物館にある個々のお宝の価値と重さを読み込んで、重さの総和が W を超えない範囲で価値の総和が最大になるときの、お宝の価値総和と重さの総和を出力するプログラムを作成してください。ただし、価値の総和が最大になる組み合わせが複数あるときは、重さの総和が小さいものを出力することとします。 | while True:
cnt = 0
cnt += 1
maxweight = int(input())
if maxweight == 0:
break
length = int(input())
tresure = []
dp = [[0 for n in range(length+1)] for m in range(maxweight + 1)]
answeight = 0
ansvalue = 0
for l in range(length):
v,w = (int(n) for n in input().sp... | s068463580 | Accepted | 1,740 | 19,760 | 1,268 | cnt = 0
while True:
cnt += 1
maxweight = int(input())
if maxweight == 0:
break
length = int(input())
tresure = []
dp = [[0 for n in range(length+1)] for m in range(maxweight + 1)]
answeight = 0
ansvalue = 0
for l in range(length):
v,w = (int(n) for n in input().split(... |
s840811124 | p02613 | u925242392 | 2,000 | 1,048,576 | Wrong Answer | 147 | 9,176 | 217 | 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())
dic={}
dic["AC"]=0
dic["WA"]=0
dic["TLE"]=0
dic["RE"]=0
for x in range(n):
a=input()
dic[a]=dic[a]+1
print("AC",x,dic["AC"])
print("WA",x,dic["WA"])
print("TLE",x,dic["TLE"])
print("RE",x,dic["RE"]) | s249081013 | Accepted | 144 | 9,092 | 225 | n=int(input())
dic={}
dic["AC"]=0
dic["WA"]=0
dic["TLE"]=0
dic["RE"]=0
for x in range(n):
a=input()
dic[a]=dic[a]+1
print("AC","x",dic["AC"])
print("WA","x",dic["WA"])
print("TLE","x",dic["TLE"])
print("RE","x",dic["RE"]) |
s581377062 | p02692 | u257162238 | 2,000 | 1,048,576 | Wrong Answer | 242 | 35,740 | 4,577 | There is a game that involves three variables, denoted A, B, and C. As the game progresses, there will be N events where you are asked to make a choice. Each of these choices is represented by a string s_i. If s_i is `AB`, you must add 1 to A or B then subtract 1 from the other; if s_i is `AC`, you must add 1 to A or ... | from collections import deque
from itertools import product
import sys
import math
import numpy as np
import bisect
sys.setrecursionlimit(200000)
input = sys.stdin.readline
def read():
N, A, B, C = map(int, input().strip().split())
S = []
for i in range(N):
s = input().strip()
S.append(s)... | s262193642 | Accepted | 245 | 35,760 | 4,648 | from collections import deque
from itertools import product
import sys
import math
import numpy as np
import bisect
sys.setrecursionlimit(200000)
input = sys.stdin.readline
def read():
N, A, B, C = map(int, input().strip().split())
S = []
for i in range(N):
s = input().strip()
S.append(s)... |
s181583031 | p00004 | u560214129 | 1,000 | 131,072 | Wrong Answer | 20 | 7,348 | 126 | Write a program which solve a simultaneous equation: ax + by = c dx + ey = f The program should print x and y for given a, b, c, d, e and f (-1,000 ≤ a, b, c, d, e, f ≤ 1,000). You can suppose that given equation has a unique solution. | a, b, c, d, e, f=map(float,input().split())
k=(a*e)-(b*d)
xval=(c*e)-(b*f)
yval=(a*f)-(c*d)
print("%.3f %.3f"%(xval/k,yval/k)) | s014085899 | Accepted | 20 | 7,376 | 263 | import sys
for line in sys.stdin.readlines():
a, b, c, d, e, f=map(float,line.split())
k=(a*e)-(b*d)
xval=(c*e)-(b*f)
yval=(a*f)-(c*d)
g=xval/k
h=yval/k
if(xval==0):
g=0
if(yval==0):
h=0
print("%.3f %.3f"%(g,h)) |
s625439149 | p03555 | u454866339 | 2,000 | 262,144 | Wrong Answer | 27 | 9,024 | 126 | 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. | x = list(input())
y = list(input())
if x[0] == y[2] and x[1] == y[1] and x[2] == y[0]:
print('yes')
else:
print('no') | s634251991 | Accepted | 29 | 9,020 | 126 | x = list(input())
y = list(input())
if x[0] == y[2] and x[1] == y[1] and x[2] == y[0]:
print('YES')
else:
print('NO') |
s751404197 | p03730 | u503111914 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 141 | 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... | import sys
A,B,C = map(int,input().split())
for i in range(1,B+1):
if A * i % B == C:
print("Yes")
sys.exit()
print("No") | s416403599 | Accepted | 22 | 2,940 | 141 | import sys
A,B,C = map(int,input().split())
for i in range(1,B+1):
if A * i % B == C:
print("YES")
sys.exit()
print("NO") |
s252065093 | p03759 | u390762426 | 2,000 | 262,144 | Wrong Answer | 18 | 2,940 | 43 | 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. | s=input()
print(s[0]+str((len(s)-2))+s[-1]) | s748849329 | Accepted | 18 | 2,940 | 78 | a,b,c=map(int,input().split())
if b-a==c-b:
print("YES")
else:
print("NO") |
s378129446 | p03155 | u642012866 | 2,000 | 1,048,576 | Wrong Answer | 26 | 9,052 | 73 | It has been decided that a programming contest sponsored by company A will be held, so we will post the notice on a bulletin board. The bulletin board is in the form of a grid with N rows and N columns, and the notice will occupy a rectangular region with H rows and W columns. How many ways are there to choose where ... | N = int(input())
H = int(input())
W = int(input())
print((H-N+1)*(W-N+1)) | s053291541 | Accepted | 31 | 9,060 | 73 | N = int(input())
H = int(input())
W = int(input())
print((N-H+1)*(N-W+1)) |
s997821785 | p02697 | u748241164 | 2,000 | 1,048,576 | Wrong Answer | 69 | 9,272 | 80 | You are going to hold a competition of one-to-one game called AtCoder Janken. _(Janken is the Japanese name for Rock-paper-scissors.)_ N players will participate in this competition, and they are given distinct integers from 1 through N. The arena has M playing fields for two players. You need to assign each playing fi... | N, M = map(int, input().split())
for i in range(M):
print(i + 1, N - i)
| s367436038 | Accepted | 71 | 9,264 | 274 | N, M = map(int, input().split())
x = int(M // 2)
if M % 2 == 0:
for i in range(x):
print(i + 1, M + 1 - i)
print(M + 2 + i, 2 * M + 1 - i)
else:
for i in range(x):
print(i + 1, M - i)
for j in range(x + 1):
print(M + 1 + j, 2 * M + 1 - j)
|
s051099295 | p03565 | u674569298 | 2,000 | 262,144 | Wrong Answer | 17 | 3,064 | 612 | 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())
t = list(input())
ans = []
ok = -1
f = -1
for i in range(len(s)-len(t)+1):
# print(s[i])
a = 0
if s[i] == '?' or s[i] == t[0]:
if f is -1:
f=i
for j in range(len(t)):
# print(i,j,s[i+j],t[j])
if s[i+j] != '?' and s[i+j] != t[j]:
... | s562031808 | Accepted | 18 | 3,064 | 664 | s = list(input())
t = list(input())
ans = []
ok = -1
f = -1
if len(s)<len(t):
print('UNRESTORABLE')
exit()
for i in range(len(s)-len(t)+1):
# print(s[i])
a = 0
if s[i] == '?' or s[i] == t[0]:
if f is -1:
f=i
for j in range(len(t)):
# print(i,j,s[i+j],t[j])
... |
s045164713 | p03455 | u054935796 | 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())
c = a*b
if c%2 == 1:
print("odd")
else:
print("even") | s866643052 | Accepted | 17 | 2,940 | 91 | a , b = map(int, input().split())
c = a*b
if c%2 == 1:
print("Odd")
else:
print("Even") |
s547464341 | p03957 | u397531548 | 1,000 | 262,144 | Wrong Answer | 18 | 2,940 | 184 | This contest is `CODEFESTIVAL`, which can be shortened to the string `CF` by deleting some characters. Mr. Takahashi, full of curiosity, wondered if he could obtain `CF` from other strings in the same way. You are given a string s consisting of uppercase English letters. Determine whether the string `CF` can be obtai... | s=input()
for i in range(len(s)):
for j in range(i,len(s)):
if s[i]=="C":
if s[j]=="F":
print("Yes")
break
else:
print("No") | s682122582 | Accepted | 19 | 2,940 | 173 | s=input()
a="No"
for i in range(len(s)):
for j in range(i,len(s)):
if s[i]=="C":
if s[j]=="F":
a="Yes"
break
print(a) |
s717069604 | p03719 | u871596687 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 91 | 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 <= b <= c:
print("Yes")
else:
print("No")
| s339452222 | Accepted | 17 | 2,940 | 93 | a,b,c = map(int,input().split())
if a <= c and b>=c:
print("Yes")
else:
print("No")
|
s571674793 | p02744 | u948524308 | 2,000 | 1,048,576 | Wrong Answer | 17 | 3,064 | 451 | 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... | N=int(input())
def combi(N,K):
ans1=1
ans2=1
for i in range(K):
ans1=ans1*(N-i)
ans2=ans2*(K-i)
ans=ans1//ans2
return ans
def rec(n):
if n==1:
return 1
else:
ans=0
for i in range(1,n+1):
if i==1:
ans+=1
elif i... | s120689659 | Accepted | 302 | 13,172 | 414 | N=int(input())
if N==1:
print("a")
exit()
from collections import deque
from collections import Counter
abc="abcdefghijklmnopqrstuvwxyz"
ans=["a"]
for i in range(1,N):
d=deque(ans)
ans=[]
while d:
temp=d.popleft()
temp2=list(temp)
cnt=Counter(temp2)
L=len(cnt)
... |
s592183528 | p03657 | u623349537 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 120 | Snuke is giving cookies to his three goats. He has two cookie tins. One contains A cookies, and the other contains B cookies. He can thus give A cookies, B cookies or A+B cookies to his goats (he cannot open the tins). Your task is to determine whether Snuke can give cookies to his three goats so that each of them ca... | A, B = map(int, input().split())
if A % 3 == 0 or B % 3 == 0 or (A + B) % 3 == 0:
print("Yes")
else:
print("No") | s255059557 | Accepted | 17 | 2,940 | 133 | A, B = map(int, input().split())
if A % 3 == 0 or B % 3 == 0 or (A + B) % 3 == 0:
print("Possible")
else:
print("Impossible") |
s080353474 | p00107 | u742505495 | 1,000 | 131,072 | Wrong Answer | 30 | 7,672 | 241 | Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size _A_ × _B_ × _C_. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each entrance is a rounded hole having its own radius _R_. Coul... | import math
while True:
d,w,h = map(int,input().split())
if d == 0:
break
n = int(input())
dist = [d**2+w**2, d**2+h**2, w**2+h**2]
leng = min(dist)
for i in range(n):
if leng-int(input()) > 0:
print('OK')
else:
print('NA') | s793509210 | Accepted | 30 | 7,760 | 276 | import math
while True:
d,w,h = map(int,input().split())
if d == 0:
break
n = int(input())
dist = [math.sqrt(d**2+w**2), math.sqrt(d**2+h**2), math.sqrt(w**2+h**2)]
leng = min(dist)
for i in range(n):
if 2*int(input())-leng > 0:
print('OK')
else:
print('NA') |
s490610853 | p03828 | u463858127 | 2,000 | 262,144 | Wrong Answer | 197 | 3,188 | 1,246 | You are given an integer N. Find the number of the positive divisors of N!, modulo 10^9+7. | import math
N = int(input())
class remainder():
def __init__(self, mod=(10**9 + 7)):
self.mod = mod
def mul(self, a, b):
return ((a % self.mod) * (b % self.mod)) % self.mod
def pow(self, a, b):
bp = []
#bp.append(1)
bp.append(a)
n = len(bin(b)) - 2
... | s627500885 | Accepted | 192 | 3,064 | 1,231 | import math
N = int(input())
class remainder():
def __init__(self, mod=(10**9 + 7)):
self.mod = mod
def mul(self, a, b):
return ((a % self.mod) * (b % self.mod)) % self.mod
def pow(self, a, b):
bp = []
#bp.append(1)
bp.append(a)
n = len(bin(b)) - 2
... |
s598215113 | p03140 | u410118019 | 2,000 | 1,048,576 | Wrong Answer | 17 | 3,064 | 218 | You are given three strings A, B and C. Each of these is a string of length N consisting of lowercase English letters. Our objective is to make all these three strings equal. For that, you can repeatedly perform the following operation: * Operation: Choose one of the strings A, B and C, and specify an integer i bet... | import sys
n = int(input())
a,b,c = sys.stdin
count = 0
for i in range(n):
if a[i] == b[i] == c[i]:
continue
elif a[i] == b[i] or a[i] == b[i] or b[i] == c[i]:
count += 1
else:
count += 2
print(count) | s932841753 | Accepted | 17 | 3,060 | 218 | import sys
n = int(input())
a,b,c = sys.stdin
count = 0
for i in range(n):
if a[i] == b[i] == c[i]:
continue
elif a[i] == b[i] or a[i] == c[i] or b[i] == c[i]:
count += 1
else:
count += 2
print(count) |
s762852531 | p03545 | u197553307 | 2,000 | 262,144 | Wrong Answer | 18 | 3,064 | 264 | Sitting in a station waiting room, Joisino is gazing at her train ticket. The ticket is numbered with four digits A, B, C and D in this order, each between 0 and 9 (inclusive). In the formula A op1 B op2 C op3 D = 7, replace each of the symbols op1, op2 and op3 with `+` or `-` so that the formula holds. The given in... | A, B, C, D = list(input())
oplist = ['+', '-']
for op1 in oplist:
for op2 in oplist:
for op3 in oplist:
f = A + op1 + B + op2 + C + op3 + D
ans = eval(f)
if ans == 7:
print(f)
quit() | s249978029 | Accepted | 18 | 3,060 | 271 | A, B, C, D = list(input())
oplist = ['+', '-']
for op1 in oplist:
for op2 in oplist:
for op3 in oplist:
f = A + op1 + B + op2 + C + op3 + D
ans = eval(f)
if ans == 7:
print(f + "=7")
quit() |
s749269357 | p03456 | u600537133 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 102 | 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. | num = int(input().replace(' ', ''))
if (num ** .5).is_integer():
print('OK')
else:
print('NG') | s194203642 | Accepted | 17 | 2,940 | 103 | num = int(input().replace(' ', ''))
if (num ** .5).is_integer():
print('Yes')
else:
print('No') |
s962966150 | p02694 | u721425712 | 2,000 | 1,048,576 | Wrong Answer | 23 | 9,156 | 128 | 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... | # B
x = int(input())
deposit = 100
count = 0
while x >= deposit:
deposit += deposit*1//100
count += 1
print(count) | s980755080 | Accepted | 22 | 9,164 | 127 | # B
x = int(input())
deposit = 100
count = 0
while x > deposit:
deposit += deposit*1//100
count += 1
print(count) |
s097941875 | p04043 | u391059484 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 97 | 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 ... | def iroha(a,b,c):
if a*b*c == 5*5*7 and (a == b or a ==c):
return YES
else:
return NO | s020373792 | Accepted | 17 | 2,940 | 87 | a,b,c = map(int, input().split())
if a*b*c == 5*5*7:
print('YES')
else:
print('NO') |
s279302538 | p03457 | u991269553 | 2,000 | 262,144 | Wrong Answer | 858 | 3,444 | 204 | 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())
for i in range(n):
t,x,y = map(int,input().split())
if t-(x+y)%2 == 0 or t == x + y:
print('Yes')
elif t-(x+y) == 1:
print('No')
else:
print('no') | s759753983 | Accepted | 459 | 34,604 | 415 | n = int(input())
a = [input().split() for l in range(n)]
b = 0
t = [0]
x = [0]
y = [0]
for i in range(n):
t.append(a[i][0])
x.append(a[i][1])
y.append(a[i][2])
for k in range(n):
o = int(t[k+1])-int(t[k])
p = int(x[k+1])-int(x[k])
q = int(y[k+1])-int(y[k])
if (o >= p+q) and ((o - (p+q))%2 =... |
s212142684 | p00018 | u519227872 | 1,000 | 131,072 | Wrong Answer | 20 | 7,652 | 64 | Write a program which reads five numbers and sorts them in descending order. | l = list(map(int,input().split()))
l.sort(reverse=True)
print(l) | s832074292 | Accepted | 20 | 7,716 | 98 | l = list(map(int,input().split()))
l.sort(reverse=True)
l = [str(i) for i in l]
print(' '.join(l)) |
s646559695 | p03477 | u630211216 | 2,000 | 262,144 | Wrong Answer | 23 | 9,128 | 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")
elif A+B<C+D:
print("Right")
else:
print("Balanced")
| s685979367 | Accepted | 29 | 9,088 | 124 | 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")
|
s710846000 | p02607 | u347640436 | 2,000 | 1,048,576 | Wrong Answer | 26 | 9,000 | 86 | We have N squares assigned the numbers 1,2,3,\ldots,N. Each square has an integer written on it, and the integer written on Square i is a_i. How many squares i satisfy both of the following conditions? * The assigned number, i, is odd. * The written integer is odd. | N, *a = map(int, open(0).read().split())
print(sum(e for e in a[::2] if e % 2 == 1))
| s259704906 | Accepted | 25 | 8,984 | 76 | N, *a = map(int, open(0).read().split())
print(sum(e % 2 for e in a[::2]))
|
s171595344 | p02831 | u347600233 | 2,000 | 1,048,576 | Wrong Answer | 17 | 3,060 | 203 | Takahashi is organizing a party. At the party, each guest will receive one or more snack pieces. Takahashi predicts that the number of guests at this party will be A or B. Find the minimum number of pieces that can be evenly distributed to the guests in both of the cases predicted. We assume that a piece cannot be ... | def gcd(a, b):
if a < b:
a, b = b, a
while b != 0 :
a, b = b, a % b
return a
def lcm(a, b):
return (a * b) / gcd(a, b)
a , b = map(int, input().split())
print(lcm(a, b)) | s987107140 | Accepted | 29 | 9,100 | 77 | from math import gcd
a, b = map(int, input().split())
print(a*b // gcd(a, b)) |
s794866495 | p04043 | u121698457 | 2,000 | 262,144 | Wrong Answer | 16 | 2,940 | 106 | 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 ... | lis = sorted(input().split())
print(lis)
if lis == ['5', '5', '7']:
print('Yes')
else:
print('No') | s472482786 | Accepted | 17 | 2,940 | 95 | lis = sorted(input().split())
if lis == ['5', '5', '7']:
print('YES')
else:
print('NO') |
s383452364 | p03696 | u623687794 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 117 | You are given a string S of length N consisting of `(` and `)`. Your task is to insert some number of `(` and `)` into S to obtain a _correct bracket sequence_. Here, a correct bracket sequence is defined as follows: * `()` is a correct bracket sequence. * If X is a correct bracket sequence, the concatenation of... | n=int(input())
s=input()
r=0;l=0
for i in s:
if i=="(":
r+=1
else:
l+=1
print("("*l+s+")"*r)
| s159653495 | Accepted | 17 | 2,940 | 172 | n=int(input())
s=input()
r=0;l=0
for i in s:
if i=="(":
r+=1
else:
if r==0:
l+=1
continue
r-=1
print("("*l+s+")"*r)
|
s228556908 | p03693 | u226779434 | 2,000 | 262,144 | Wrong Answer | 24 | 9,008 | 78 | AtCoDeer has three cards, one red, one green and one blue. An integer between 1 and 9 (inclusive) is written on each card: r on the red card, g on the green card and b on the blue card. We will arrange the cards in the order red, green and blue from left to right, and read them as a three-digit integer. Is this i... | r,g,b =map(int,input().split())
print("YES" if r*100+g*10+b % 4 ==0 else "NO") | s000748598 | Accepted | 27 | 8,904 | 78 | r,g,b =map(int,input().split())
print("YES" if (r*100+g*10+b)%4 ==0 else "NO") |
s196335164 | p04043 | u530786533 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 118 | 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 ... | x = [int(i) for i in input().split()]
if (x.count(5) == 2 and x.count(7) == 1):
print('Yes')
else:
print('No')
| s977928684 | Accepted | 17 | 2,940 | 118 | x = [int(i) for i in input().split()]
if (x.count(5) == 2 and x.count(7) == 1):
print('YES')
else:
print('NO')
|
s216644142 | p02393 | u936401118 | 1,000 | 131,072 | Wrong Answer | 20 | 7,616 | 86 | Write a program which reads three integers, and prints them in ascending order. | a,b,c = map(int, input().split())
if a < b < c :
print ("Yes")
else:
print ("No") | s495797604 | Accepted | 10 | 7,688 | 66 | a = list(map(int, input().split()))
a.sort()
print(a[0],a[1],a[2]) |
s614060138 | p02742 | u065137691 | 2,000 | 1,048,576 | Wrong Answer | 17 | 2,940 | 98 | We have a board with H horizontal rows and W vertical columns of squares. There is a bishop at the top-left square on this board. How many squares can this bishop reach by zero or more movements? Here the bishop can only move diagonally. More formally, the bishop can move from the square at the r_1-th row (from the to... | a, b= map(int, input().split())
if (a * b)%2 == 0:
print((a*b)/2)
else:
print((a*b)-(a+b)) | s977610608 | Accepted | 17 | 2,940 | 232 | def main():
a, b= map(int, input().split())
if a == 1 or b == 1:
print('1')
else:
if (a*b)%2 == 0:
print(round((a*b)/2))
else:
print(round(((a//2)+(a%2))*b)-(b//2))
main() |
s169428084 | p03827 | u441320782 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 95 | You have an integer variable x. Initially, x=0. Some person gave you a string S of length N, and using the string you performed the following operation N times. In the i-th operation, you incremented the value of x by 1 if S_i=`I`, and decremented the value of x by 1 if S_i=`D`. Find the maximum value taken by x duri... | N=int(input())
S=input()
x=0
for i in S:
if i=="I":
x+=1
elif i=="D":
x-=1
print(x) | s682570765 | Accepted | 17 | 2,940 | 126 | N=int(input())
S=input()
x=0
ans=[0]
for i in S:
if i=="I":
x+=1
elif i=="D":
x-=1
ans.append(x)
print(max(ans)) |
s638013638 | p02742 | u137667583 | 2,000 | 1,048,576 | Wrong Answer | 18 | 2,940 | 67 | We have a board with H horizontal rows and W vertical columns of squares. There is a bishop at the top-left square on this board. How many squares can this bishop reach by zero or more movements? Here the bishop can only move diagonally. More formally, the bishop can move from the square at the r_1-th row (from the to... | h,w = map(int,input().split())
print(int(h/2+0.5)*w-(w%2)*int(w/2)) | s656089514 | Accepted | 17 | 2,940 | 90 | h,w = map(int,input().split())
print((int(h/2+0.5)*w-(h%2)*int(w/2))if(h-1)and(w-1)else 1) |
s817461287 | p03997 | u137228327 | 2,000 | 262,144 | Wrong Answer | 24 | 9,096 | 69 | 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) | s916102295 | Accepted | 26 | 9,104 | 74 |
a = int(input())
b = int(input())
h = int(input())
print(int((a+b)*h/2)) |
s001213161 | p02420 | u587193722 | 1,000 | 131,072 | Wrong Answer | 30 | 7,612 | 168 | Your task is to shuffle a deck of n cards, each of which is marked by a alphabetical letter. A single shuffle action takes out h cards from the bottom of the deck and moves them to the top of the deck. The deck of cards is represented by a string as follows. abcdeefab The first character and the las... | while True:
s = input()
if s == '-':
break
m = int(input())
for mi in range(m):
h = int(input())
s = s[:h] + s[h:]
print(s) | s135208956 | Accepted | 20 | 7,592 | 168 | while True:
s = input()
if s == '-':
break
m = int(input())
for mi in range(m):
h = int(input())
s = s[h:] + s[:h]
print(s) |
s094343799 | p03699 | u133936772 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 63 | You are taking a computer-based examination. The examination consists of N questions, and the score allocated to the i-th question is s_i. Your answer to each question will be judged as either "correct" or "incorrect", and your grade will be the sum of the points allocated to questions that are answered correctly. When... | _,*l=map(int,open(0).read().split());s=sum(l);print(s*(s%10>0)) | s936894796 | Accepted | 18 | 3,060 | 103 | _,*l=map(int,open(0))
s=b=0
m=100
for i in l:
s+=i
if i%10: b=1; m=min(m,i)
print((s-m*(s%10<1))*b) |
s684047893 | p03852 | u816631826 | 2,000 | 262,144 | Wrong Answer | 17 | 3,060 | 159 | 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`. | s=['a','i','o','u','e']
x=input()
falg=0
for i in s:
if (i==x):
falg=1
break
if falg==0:
print('consonant.g')
else:
print("vowel.") | s763610304 | Accepted | 17 | 3,060 | 156 | s=['a','i','o','u','e']
x=input()
falg=0
for i in s:
if (i==x):
falg=1
break
if falg==0:
print('consonant')
else:
print("vowel") |
s827293891 | p03607 | u398846051 | 2,000 | 262,144 | Wrong Answer | 190 | 7,072 | 238 | You are playing the following game with Joisino. * Initially, you have a blank sheet of paper. * Joisino announces a number. If that number is written on the sheet, erase the number from the sheet; if not, write the number on the sheet. This process is repeated N times. * Then, you are asked a question: How many... | N = int(input())
a = [int(input()) for _ in range(N)]
a.sort
ans = 0
now = 0
cnt = 0
for x in a:
if x == now:
cnt += 1
continue
if cnt % 2 == 1:
ans += 1
cnt = 1
if cnt % 2 == 1:
ans += 1
print(ans) | s240295238 | Accepted | 223 | 7,488 | 252 | N = int(input())
a = [int(input()) for _ in range(N)]
a.sort()
ans = 0
now = 0
cnt = 0
for x in a:
if x == now:
cnt += 1
continue
if cnt % 2 == 1:
ans += 1
cnt = 1
now = x
if cnt % 2 == 1:
ans += 1
print(ans) |
s971469195 | p02390 | u602702913 | 1,000 | 131,072 | Wrong Answer | 20 | 5,580 | 76 | Write a program which reads an integer $S$ [second] and converts it to $h:m:s$ where $h$, $m$, $s$ denote hours, minutes (less than 60) and seconds (less than 60) respectively. | S=int(input())
h=S//3600
m=(S%3600)//60
s=S-((h*3600)+(m*60))
print(h,m,s)
| s413336025 | Accepted | 20 | 5,588 | 86 | S=int(input())
h=S//3600
m=(S%3600)//60
s=S-((h*3600)+(m*60))
print(h,m,s, sep=':')
|
s638911658 | p02417 | u184749404 | 1,000 | 131,072 | Wrong Answer | 20 | 5,564 | 136 | Write a program which counts and reports the number of each alphabetical letter. Ignore the case of characters. | import sys
s = sys.stdin.readlines()
for i in range(26):
s.count(chr(97+i))
print(chr(97+i)+" : "+str(s.count(chr(97+i))))
| s798338174 | Accepted | 20 | 5,560 | 144 | import sys
s=sys.stdin.read().lower()
for i in range(26):
s.count(chr(97+i))
print(chr(97+i)+" : "+str(s.count(chr(97+i))))
|
s709010509 | p04043 | u760794812 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 272 | 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())
list = []
if a == 5 or a == 7:
if b == 5 or b == 7:
if a == b and a == 7:
Answer = 'NO'
elif c == 5:
Answer = 'YES'
else:
Answer = 'NO'
else:
Answer = 'NO'
else:
Answer = 'NO'
print(Answer)
| s095600312 | Accepted | 17 | 2,940 | 143 | List = [i for i in input().split()]
List.sort()
if List[0] == '5' and List[1] == '5' and List[2] == '7':
print('YES')
else:
print('NO') |
s415562444 | p03386 | u282657760 | 2,000 | 262,144 | Wrong Answer | 17 | 3,060 | 188 | 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())
ans = []
for i in range(A, A+K):
ans.append(i)
for i in range(B-K+1, B+1):
ans.append(i)
ans = set(ans)
for i in ans:
if i>=A and i<=B:
print(i) | s348602668 | Accepted | 17 | 3,064 | 218 | A,B,K = map(int, input().split())
ans = []
for i in range(A, A+K):
ans.append(i)
for i in range(B-K+1, B+1):
ans.append(i)
ans = list(set(ans))
ans.sort(reverse=False)
for i in ans:
if i>=A and i<=B:
print(i) |
s696133734 | p03493 | u270962921 | 2,000 | 262,144 | Wrong Answer | 19 | 2,940 | 18 | 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. | input().count('1') | s936706212 | Accepted | 17 | 2,940 | 25 | print(input().count('1')) |
s931949810 | p04043 | u325956328 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 110 | 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.count(5) == 2 and s.count(7) == 1:
print('Yes')
else:
print('No')
| s928532314 | Accepted | 18 | 2,940 | 110 | s = list(map(int, input().split()))
if s.count(5) == 2 and s.count(7) == 1:
print('YES')
else:
print('NO')
|
s045065126 | p03861 | u408958033 | 2,000 | 262,144 | Wrong Answer | 17 | 3,060 | 278 | 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? | def cin():
return map(int,input().split())
def cino(test=False):
if not test:
return int(input())
else:
return input()
def cina():
return list(map(int,input().split()))
def ssplit():
return list(input().split())
a,b,c = cin()
print(b//c - a//c) | s071034883 | Accepted | 21 | 3,316 | 300 | def cin():
return map(int,input().split())
def cino(test=False):
if not test:
return int(input())
else:
return input()
def cina():
return list(map(int,input().split()))
def ssplit():
return list(input().split())
import math
a,b,c = cin()
print(b//c - a//c+(a%c==0)) |
s220378007 | p02613 | u665090185 | 2,000 | 1,048,576 | Wrong Answer | 153 | 16,336 | 298 | 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 = "AC"
WA = "WA"
TLE = "TLE"
RE = "RE"
list = []
for i in range(N):
string = input()
list.append(string)
C0 = list.count(AC)
C1 = list.count(WA)
C2 = list.count(TLE)
C3 = list.count(RE)
print(AC+f" x {C0}")
print(AC+f" x {C1}")
print(AC+f" x {C2}")
print(AC+f" x {C3}")
| s914582828 | Accepted | 156 | 16,284 | 268 | N = int(input())
C0 = "AC"
C1 = "WA"
C2 = "TLE"
C3 = "RE"
list = []
for i in range(N):
string = input()
list.append(string)
print(f"{C0} x {list.count(C0)}")
print(f"{C1} x {list.count(C1)}")
print(f"{C2} x {list.count(C2)}")
print(f"{C3} x {list.count(C3)}")
|
s705860859 | p02613 | u952968889 | 2,000 | 1,048,576 | Wrong Answer | 172 | 23,892 | 49 | 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 = [[input()] for i in range(n)] | s477408104 | Accepted | 152 | 16,164 | 210 | n=int(input())
a = []
for _ in range(n):
a.append(input())
print("AC x " + str(a.count("AC")))
print("WA x " + str(a.count("WA")))
print("TLE x " + str(a.count("TLE")))
print("RE x " + str(a.count("RE")))
|
s687399188 | p02602 | u453623947 | 2,000 | 1,048,576 | Wrong Answer | 302 | 31,428 | 191 | M-kun is a student in Aoki High School, where a year is divided into N terms. There is an exam at the end of each term. According to the scores in those exams, a student is given a grade for each term, as follows: * For the first through (K-1)-th terms: not given. * For each of the K-th through N-th terms: the m... | n,k = map(int,input().split())
a = list(map(int,input().split()))
for i in range(n-k) :
print(a[1+i],a[k+i])
if a[0+i] < a[k+i] :
print("Yes")
else :
print("No")
| s549885573 | Accepted | 155 | 31,600 | 166 | n,k = map(int,input().split())
a = list(map(int,input().split()))
for i in range(n-k) :
if a[0+i] < a[k+i] :
print("Yes")
else :
print("No")
|
s319760189 | p03474 | u136843617 | 2,000 | 262,144 | Wrong Answer | 19 | 3,188 | 422 | 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. | def solve():
A,B = map(int,input().split())
S = input()
seq = [str(x) for x in range(10)]
print(seq)
for i in range(A+B+1):
if i== A:
if S[i] != "-":
return False
else:
if not(S[i] in seq):
return False
return True
if __na... | s117122584 | Accepted | 17 | 3,060 | 407 | def solve():
A,B = map(int,input().split())
S = input()
seq = [str(x) for x in range(10)]
for i in range(A+B+1):
if i== A:
if S[i] != "-":
return False
else:
if not(S[i] in seq):
return False
return True
if __name__ == '__main... |
s594514287 | p02663 | u597455618 | 2,000 | 1,048,576 | Wrong Answer | 19 | 9,108 | 88 | In this problem, we use the 24-hour clock. Takahashi gets up exactly at the time H_1 : M_1 and goes to bed exactly at the time H_2 : M_2. (See Sample Inputs below for clarity.) He has decided to study for K consecutive minutes while he is up. What is the length of the period in which he can start studying? | h1, m1, h2, m2, k = map(int, input().split())
print(min(0, (h2*60+m2) - (h1*60+m1) - k)) | s755834845 | Accepted | 20 | 9,168 | 88 | h1, m1, h2, m2, k = map(int, input().split())
print(max(0, (h2*60+m2) - (h1*60+m1) - k)) |
s853126443 | p03943 | u407158193 | 2,000 | 262,144 | Wrong Answer | 18 | 2,940 | 119 | Two students of AtCoder Kindergarten are fighting over candy packs. There are three candy packs, each of which contains a, b, and c candies, respectively. Teacher Evi is trying to distribute the packs between the two students so that each student gets the same number of candies. Determine whether it is possible. Not... | A = list(map(int,input().split()))
A.sort(reverse = True)
if A[0] == (A[1] + A[2]):
print('YES')
else:
print('NO') | s429486488 | Accepted | 17 | 2,940 | 119 | A = list(map(int,input().split()))
A.sort(reverse = True)
if A[0] == (A[1] + A[2]):
print('Yes')
else:
print('No') |
s176363960 | p02394 | u217069758 | 1,000 | 131,072 | Wrong Answer | 40 | 7,768 | 181 | 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. | def check(W, H, x, y, r):
if W - x < r or H - y < r:
return "No"
else:
return "Yes"
L = list(map(int, input().split()))
check(L[0], L[1], L[2], L[3], L[4]) | s173881592 | Accepted | 20 | 7,772 | 124 | W, H, x, y, r = [int(x) for x in input().split()]
print("Yes" if (W - x >= r and H - y >= r and x > 0 and y > 0) else "No") |
s584524587 | p03719 | u846150137 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 73 | 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=[int(i) for i in input().split()]
print("YES" if a<=c<=b else "NO") | s351650989 | Accepted | 17 | 2,940 | 73 | a,b,c=[int(i) for i in input().split()]
print("Yes" if a<=c<=b else "No") |
s556145573 | p02843 | u699944218 | 2,000 | 1,048,576 | Time Limit Exceeded | 2,104 | 3,064 | 292 | 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())
flag = 0
for a in range(0,1001):
for b in range(0,1001):
for c in range(0,1001):
for d in range(0,1001):
for e in range(0,1001):
for f in range(0,1001):
if 100*a+101*b+102*c+103*d+104*e+105*f == X:
flag += 1
print(flag) | s380574770 | Accepted | 18 | 2,940 | 114 | X = int(input())
flag = 0
for C in range(X+1):
if 100*C <= X and 105*C >= X:
flag += 1
break
print(flag) |
s081303966 | p03494 | u766407523 | 2,000 | 262,144 | Time Limit Exceeded | 2,104 | 2,940 | 274 | 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())
Astr = input().split()
An = []
for A in Astr:
An.append(int(A))
count = 0
end = 0
while end == 0:
for A in An:
if A%2==1:
print(count)
end = 1
break
else:
A /= 2
count += 1
| s546750340 | Accepted | 19 | 3,060 | 272 | N = int(input())
Astr = input().split()
A = []
for A_i in Astr:
A.append(int(A_i))
candidate = 0
end = 0
while end == 0:
for A_i in A:
if (A_i/2**(candidate))%2 != 0:
end = 1
break
else:
candidate += 1
print(candidate)
|
s604387747 | p03192 | u886274153 | 2,000 | 1,048,576 | Wrong Answer | 17 | 2,940 | 117 | You are given an integer N that has exactly four digits in base ten. How many times does `2` occur in the base-ten representation of N? | suuji = input()
print('input', suuji)
kaisu = 0
for i in suuji:
if i == "2":
kaisu += 1
else:
pass
print(kaisu) | s624553729 | Accepted | 18 | 2,940 | 95 | suuji = input()
kaisu = 0
for i in suuji:
if i == "2":
kaisu += 1
else:
pass
print(kaisu) |
s740761938 | p04043 | u242580186 | 2,000 | 262,144 | Wrong Answer | 32 | 9,360 | 457 | Iroha loves _Haiku_. Haiku is a short form of Japanese poetry. A Haiku consists of three phrases with 5, 7 and 5 syllables, in this order. To create a Haiku, Iroha has come up with three different phrases. These phrases have A, B and C syllables, respectively. Determine whether she can construct a Haiku by using each ... | import sys
from heapq import heappush, heappop, heapify
import math
from math import gcd
import itertools as it
from collections import deque
input = sys.stdin.readline
def inp():
return int(input())
def inpl():
return list(map(int, input().split()))
INF = 1001001001
# -------------------------------------... | s949187482 | Accepted | 29 | 9,392 | 457 | import sys
from heapq import heappush, heappop, heapify
import math
from math import gcd
import itertools as it
from collections import deque
input = sys.stdin.readline
def inp():
return int(input())
def inpl():
return list(map(int, input().split()))
INF = 1001001001
# -------------------------------------... |
s113026844 | p02393 | u138661634 | 1,000 | 131,072 | Wrong Answer | 20 | 7,528 | 71 | Write a program which reads three integers, and prints them in ascending order. | a, b, c = map(int, input().split())
print("Yes" if a < b < c else "No") | s965220581 | Accepted | 20 | 7,664 | 66 | l = map(int, input().split())
print(' '.join(map(str, sorted(l)))) |
s277358779 | p03407 | u267242314 | 2,000 | 262,144 | Wrong Answer | 19 | 2,940 | 83 | An elementary school student Takahashi has come to a variety store. He has two coins, A-yen and B-yen coins (yen is the currency of Japan), and wants to buy a toy that costs C yen. Can he buy it? Note that he lives in Takahashi Kingdom, and may have coins that do not exist in Japan. | A, B, C = map(int,input().split())
if A+B>C:
print('yes')
else:
print('no') | s155757948 | Accepted | 17 | 2,940 | 84 | A, B, C = map(int,input().split())
if A+B>=C:
print('Yes')
else:
print('No') |
s298694437 | p03795 | u314057689 | 2,000 | 262,144 | Wrong Answer | 22 | 3,316 | 54 | 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())
x = N*800
y = int(N//15)
print(x-y) | s506029143 | Accepted | 20 | 3,316 | 70 | N = int(input())
x = N*800
y = int(N//15) * 200
print(x-y) |
s991625954 | p01131 | u591052358 | 8,000 | 131,072 | Wrong Answer | 60 | 5,636 | 1,722 | Alice さんは Miku さんに携帯電話でメールを送ろうとしている。 携帯電話には入力に使えるボタンは数字のボタンしかない。 そこで、文字の入力をするために数字ボタンを何度か押して文字の入力を行う。携帯電話の数字ボタンには、次の文字が割り当てられており、ボタン 0 は確定ボタンが割り当てられている。この携帯電話では 1 文字の入力が終わったら必ず確定ボタンを押すことになっている。 * 1: . , ! ? (スペース) * 2: a b c * 3: d e f * 4: g h i * 5: j k l * 6: m n o * 7: p q r s * 8: t u v ... | def moji(x,ans):
if ans == 0:
return
if x == 1:
if(ans%4==1):
str = '.'
elif(ans%4==2):
str =','
elif(ans%4==3):
str='!'
else:
str = '?'
if x == 2:
if(ans%3==1):
str = 'a'
elif(ans%3==2):
... | s375463520 | Accepted | 60 | 5,632 | 1,765 | def moji(x,ans):
if ans == 0:
return
if x == 1:
if(ans%5==1):
str = '.'
elif(ans%5==2):
str =','
elif(ans%5==3):
str='!'
elif ans%5==4:
str='?'
else:
str = ' '
if x == 2:
if(ans%3==1):
... |
s175899855 | p03645 | u248670337 | 2,000 | 262,144 | Wrong Answer | 574 | 11,948 | 189 | 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())
sa=set()
sb=set()
for i in range(m):
a,b=map(int,input().split())
if a==1:sb.add(b)
if b==1:sa.add(a)
print("IMPOSSIBLE" if len(sa&sb)==0 else "POSSIBLE") | s163992938 | Accepted | 621 | 18,892 | 245 | n,m=map(int,input().split())
L1=set()
Ln=set()
for i in range(m):
a,b=map(int,input().split())
if a==1 or b==1:
L1.add(a if b==1 else b)
if a==n or b==n:
Ln.add(a if b==n else b)
print('POSSIBLE' if len(L1&Ln)!=0 else 'IMPOSSIBLE') |
s673659364 | p02613 | u905329882 | 2,000 | 1,048,576 | Wrong Answer | 156 | 9,200 | 315 | 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())
lis = [0 for i in range(4)]
mo = ["AC","WA","TLE","RE"]
for ii in range(n):
i = input()
if i=="AC":
lis[0]+=1
elif i=="WA":
lis[1]+=1
elif i=="TLE":
lis[2]+=1
elif i == "RE":
lis[3]+=1
for i in range(4):
print(str(mo[i])+" × "+str(lis[i]))
| s983406356 | Accepted | 152 | 9,212 | 332 | n = int(input())
lis = [0 for i in range(4)]
mo = ["AC","WA","TLE","RE"]
for ii in range(n):
i = input()
if i=="AC":
lis[0]+=1
elif i=="WA":
lis[1]+=1
elif i=="TLE":
lis[2]+=1
elif i == "RE":
lis[3]+=1
for i in range(4):
tmp = "{0} x {1}".format(mo[i],lis[i])
... |
s278796681 | p02268 | u742013327 | 1,000 | 131,072 | Wrong Answer | 30 | 7,596 | 939 | 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. | #http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_4_B&lang=jp
def binary_search(list_1, list_2):
count = 0
for b in list_2:
left_index = 0
right_index = len(list_1)
while left_index < right_index:
center = int((left_index + right_index) / 2)
... | s841477520 | Accepted | 430 | 17,012 | 935 | #http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_4_B&lang=jp
def binary_search(list_1, list_2):
count = 0
for b in list_2:
left_index = 0
right_index = len(list_1)
while left_index < right_index:
center = int((left_index + right_index) / 2)
... |
s607536406 | p03251 | u106181248 | 2,000 | 1,048,576 | Wrong Answer | 18 | 3,064 | 349 | Our world is one-dimensional, and ruled by two empires called Empire A and Empire B. The capital of Empire A is located at coordinate X, and that of Empire B is located at coordinate Y. One day, Empire A becomes inclined to put the cities at coordinates x_1, x_2, ..., x_N under its control, and Empire B becomes incli... | n, m, x, y = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = max(a)+1
d = min(b)
e = 0
if c > d:
print("War")
else:
for i in range(c,d+1):
if x < i and i <= y:
print("No War")
print(i)
e = 1
break
if... | s311948413 | Accepted | 17 | 3,064 | 328 | n, m, x, y = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = max(a)+1
d = min(b)
e = 0
if c > d:
print("War")
else:
for i in range(c,d+1):
if x < i and i <= y:
print("No War")
e = 1
break
if e == 0:
prin... |
s439247976 | p03814 | u083960235 | 2,000 | 262,144 | Wrong Answer | 60 | 6,888 | 337 | 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... |
s=str(input())
atoz=[]
for i in range(len(s)):
if(s[i]=="A"):
a=i
break
#print(a)
for i in range(a,len(s)):
atoz.append(s[i])
s_l=list(atoz)
#print(s_l)
r_s=[]
s_l_kep=s_l
for i in (reversed(s_l)):
#print(i)
if(i!="Z"):
s_l.pop()
# print(s_l)
else:
break
# r_s.append(i)
#print(s_l)
str_s_l=''.join(s_... | s563922489 | Accepted | 61 | 6,632 | 358 |
s=str(input())
atoz=[]
for i in range(len(s)):
if(s[i]=="A"):
a=i
break
#print(a)
for i in range(a,len(s)):
atoz.append(s[i])
s_l=list(atoz)
#print(s_l)
r_s=[]
s_l_kep=s_l
for i in (reversed(s_l)):
#print(i)
if(i!="Z"):
s_l.pop()
# print(s_l)
else:
break
# r_s.append(i)
#print(s_l)
str_s_l=''.join(s_... |
s029920390 | p02842 | u169138653 | 2,000 | 1,048,576 | Wrong Answer | 18 | 2,940 | 89 | 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).... | import math
n=int(input())
if (n+1)//1.08-n//1.08>0:
print(n//1.08)
else:
print(':(') | s321768754 | Accepted | 30 | 2,940 | 92 | n=int(input())
for i in range(n+1):
if int(1.08*i)==n:
print(i)
exit()
print(':(') |
s139382468 | p03090 | u707124227 | 2,000 | 1,048,576 | Wrong Answer | 23 | 3,612 | 250 | You are given an integer N. Build an undirected graph with N vertices with indices 1 to N that satisfies the following two conditions: * The graph is simple and connected. * There exists an integer S such that, for every vertex, the sum of the indices of the vertices adjacent to that vertex is S. It can be proved... | n=int(input())
if n%2==0:
for i in range(1,n):
for j in range(i+1,n+1):
if i+j!=n+1:
print(i,j)
else:
for i in range(1,n):
for j in range(i+1,n+1):
if i+j!=n:
print(i,j)
| s538883585 | Accepted | 26 | 4,124 | 318 | n=int(input())
ans=[]
if n%2==0:
for i in range(1,n):
for j in range(i+1,n+1):
if i+j!=n+1:
ans.append([i,j])
else:
for i in range(1,n):
for j in range(i+1,n+1):
if i+j!=n:
ans.append([i,j])
print(len(ans))
for i,j in ans:
print(i,j)
|
s186389528 | p02409 | u427088273 | 1,000 | 131,072 | Wrong Answer | 20 | 7,648 | 457 | 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... | def create_List():
re_list = [[],[],[],[]]
for i in range(4):
for j in range(3):
re_list[i].append([0 for k in range(10)])
return re_list
num = create_List()
for _ in range(int(input())):
data = list(map(int,input().split()))
num[data[0]-1][data[1]-1][data[2]-1] = data[3]
# ????????????
for i in range(4):
... | s984048473 | Accepted | 20 | 7,704 | 484 | def create_List():
re_list = [[],[],[],[]]
for i in range(4):
for j in range(3):
re_list[i].append([0 for k in range(10)])
return re_list
num = create_List()
for _ in range(int(input())):
data = list(map(int,input().split()))
num[data[0]-1][data[1]-1][data[2]-1] += data[3]
# ????????????
for i in range(4):... |
s667171834 | p00905 | u509278866 | 8,000 | 131,072 | Wrong Answer | 500 | 9,124 | 2,337 | _Stylish_ is a programming language whose syntax comprises _names_ , that are sequences of Latin alphabet letters, three types of _grouping symbols_ , periods ('.'), and newlines. Grouping symbols, namely round brackets ('(' and ')'), curly brackets ('{' and '}'), and square brackets ('[' and ']'), must match and be ne... | import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(0,-1),(1,0),(0,1),(-1,0)]
ddn = [(0,-1),(1,-1),(1,0),(1,1),(0,1),(-1,-1),(-1,0),(-1,1)]
def LI(): return [int(x) for x in sys.stdin.... | s799660551 | Accepted | 430 | 9,116 | 2,395 | import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(0,-1),(1,0),(0,1),(-1,0)]
ddn = [(0,-1),(1,-1),(1,0),(1,1),(0,1),(-1,-1),(-1,0),(-1,1)]
def LI(): return [int(x) for x in sys.stdin.... |
s809440122 | p03457 | u798073524 | 2,000 | 262,144 | Wrong Answer | 325 | 3,060 | 162 | 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())
for i in range(n):
t, x, y = map(int, input().split())
if (x + y) > n or (x + y + t) % 2:
print("NO")
exit()
print("YES") | s464098713 | Accepted | 319 | 3,060 | 162 | n = int(input())
for i in range(n):
t, x, y = map(int, input().split())
if (x + y) > t or (x + y + t) % 2:
print("No")
exit()
print("Yes") |
s633612254 | p03080 | u163320134 | 2,000 | 1,048,576 | Wrong Answer | 17 | 2,940 | 125 | 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()
count=0
for i in s:
if i=='B':
count+=1
if count>(n-count):
print('Yes')
else:
print('No') | s587939876 | Accepted | 17 | 2,940 | 125 | n=int(input())
s=input()
count=0
for i in s:
if i=='R':
count+=1
if count>(n-count):
print('Yes')
else:
print('No') |
s263211290 | p03545 | u589578850 | 2,000 | 262,144 | Wrong Answer | 18 | 3,064 | 473 | Sitting in a station waiting room, Joisino is gazing at her train ticket. The ticket is numbered with four digits A, B, C and D in this order, each between 0 and 9 (inclusive). In the formula A op1 B op2 C op3 D = 7, replace each of the symbols op1, op2 and op3 with `+` or `-` so that the formula holds. The given in... | s = input()
a = int(s[0])
b = int(s[1])
c = int(s[2])
d = int(s[3])
one = -1
flg = False
for i in range(2):
for j in range(2):
for k in range(2):
if a + b*one**i + c*one**j + d*one**k == 7:
print(i,j,k)
flg = True
break
if flg:
break
if flg:
break
if i == 0 :
i_flg = "+"
e... | s529855060 | Accepted | 19 | 3,188 | 456 | s = input()
a = int(s[0])
b = int(s[1])
c = int(s[2])
d = int(s[3])
one = -1
flg = False
for i in range(2):
for j in range(2):
for k in range(2):
if a + b*one**i + c*one**j + d*one**k == 7:
flg = True
break
if flg:
break
if flg:
break
if i == 0 :
i_flg = "+"
else:
i_flg = "-"... |
s631988679 | p03845 | u646352133 | 2,000 | 262,144 | Wrong Answer | 23 | 3,316 | 240 | Joisino is about to compete in the final round of a certain programming competition. In this contest, there are N problems, numbered 1 through N. Joisino knows that it takes her T_i seconds to solve problem i(1≦i≦N). Also, there are M kinds of drinks offered to the contestants, numbered 1 through M. If Joisino takes d... | n = int(input())
t = list(map(int,input().split()))
m = int(input())
origin,ans = [],[]
for i in range(m):
p,x = map(int,input().split())
origin.append(t[p-1])
t[p-1] = x
ans.append(sum(t))
t[p-1] = origin[0]
origin = []
print(ans) | s945570505 | Accepted | 23 | 3,064 | 262 | n = int(input())
t = list(map(int,input().split()))
m = int(input())
origin,ans = [],[]
for _ in range(m):
p,x = map(int,input().split())
origin.append(t[p-1])
t[p-1] = x
ans.append(sum(t))
t[p-1] = origin[0]
origin = []
for i in range(m):
print(ans[i]) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.