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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
s510028665 | p02613 | u524557016 | 2,000 | 1,048,576 | Wrong Answer | 258 | 16,320 | 284 | 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`,... | # -*- coding: utf-8 -*-
N = int(input())
S = []
for i in range(N):
S.append(input())
count_map = {"AC": 0, "WA": 0, "TLE": 0, "RE": 0}
for s in S:
count_map[s] += 1
print(count_map)
for count_key, count in count_map.items():
print(count_key + " x " + str(count))
| s617064305 | Accepted | 150 | 16,252 | 263 | # -*- coding: utf-8 -*-
N = int(input())
S = []
for i in range(N):
S.append(input())
count_map = {"AC": 0, "WA": 0, "TLE": 0, "RE": 0}
for s in S:
count_map[s] += 1
for count_key, count in count_map.items():
print(count_key + " x " + str(count))
|
s977566304 | p03359 | u690037900 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 44 | In AtCoder Kingdom, Gregorian calendar is used, and dates are written in the "year-month-day" order, or the "month-day" order without the year. For example, May 3, 2018 is written as 2018-5-3, or 5-3 without the year. In this country, a date is called _Takahashi_ when the month and the day are equal as numbers. For ... | a,b=map(int,input().split())
print(a+(a<=b)) | s791628844 | Accepted | 21 | 3,316 | 46 | a,b=map(int,input().split())
print(a+(a<=b)-1) |
s725471583 | p03486 | u845937249 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 242 | You are given strings s and t, consisting of lowercase English letters. You will create a string s' by freely rearranging the characters in s. You will also create a string t' by freely rearranging the characters in t. Determine whether it is possible to satisfy s' < t' for the lexicographic order. | s = list(input())
t = list(input())
s.sort()
t.sort(reverse=True)
s = ''.join(s)
t = ''.join(t)
print(s)
print(t)
if s < t :
print('Yes')
else:
print('No')
| s620453729 | Accepted | 17 | 2,940 | 244 | s = list(input())
t = list(input())
s.sort()
t.sort(reverse=True)
s = ''.join(s)
t = ''.join(t)
#print(s)
#print(t)
if s < t :
print('Yes')
else:
print('No')
|
s698246303 | p03854 | u243312682 | 2,000 | 262,144 | Wrong Answer | 27 | 5,152 | 619 | You are given a string S consisting of lowercase English letters. Another string T is initially empty. Determine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times: * Append one of the following at the end of T: `dream`, `dreamer`, `erase` and `eraser`. | import re
def main():
s = list(input())
sr = ''.join(list(reversed(s)))
print(sr)
t = ['dream', 'dreamer', 'erase', 'eraser']
tr = list()
for i in t:
tr.append(''.join(list(reversed(i))))
while True:
for i in tr:
sr_split = re.split('^' + i, sr ,1)
pr... | s874782584 | Accepted | 79 | 4,900 | 530 | import re
def main():
s = list(input())
sr = ''.join(list(reversed(s)))
t = ['dream', 'dreamer', 'erase', 'eraser']
tr = list()
for i in t:
tr.append(''.join(list(reversed(i))))
while sr:
flag = False
for i in tr:
if sr.startswith(i):
sr = sr.... |
s153244137 | p02613 | u133236239 | 2,000 | 1,048,576 | Wrong Answer | 144 | 9,232 | 479 | 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`,... | loop_count = int(input())
ac_count = 0
wa_count = 0
tle_count = 0
re_count = 0
for i in range(loop_count):
result = input()
if result == 'AC':
ac_count += 1
elif result == 'WA':
wa_count += 1
elif result == 'TLE':
tle_count += 1
else:
re_count += 1
print("AC × {0}"... | s858245129 | Accepted | 145 | 9,152 | 468 | loop_count = int(input())
ac_count = 0
wa_count = 0
tle_count = 0
re_count = 0
for i in range(loop_count):
result = input()
if result == 'AC':
ac_count += 1
elif result == 'WA':
wa_count += 1
elif result == 'TLE':
tle_count += 1
else:
re_count += 1
print("AC x {0}"... |
s014126202 | p03545 | u626468554 | 2,000 | 262,144 | Wrong Answer | 17 | 3,064 | 598 | 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... | #n = int(input())
#n,k = map(int,input().split())
#x = list(map(int,input().split()))
s = list(map(int,list(input())))
li = [1,-1]
for i in range(1<<3):
ans = s[0]
for j in range(1,4):
if i>>(j-1)&1:
ans += s[j]
else:
ans -= s[j]
print(bin(i),ans)
if ans == 7:
... | s000178466 | Accepted | 17 | 3,064 | 599 | #n = int(input())
#n,k = map(int,input().split())
#x = list(map(int,input().split()))
s = list(map(int,list(input())))
li = [1,-1]
for i in range(1<<3):
ans = s[0]
for j in range(1,4):
if i>>(j-1)&1:
ans += s[j]
else:
ans -= s[j]
#print(bin(i),ans)
if ans == 7:... |
s815397559 | p03386 | u977389981 | 2,000 | 262,144 | Wrong Answer | 18 | 3,060 | 197 | 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 = []
k = min(k, b - a)
for i in range(k):
ans.append(a + i)
for i in range(k-1, -1, -1):
ans.append(b - i)
for i in set(ans):
print(i) | s916526990 | Accepted | 18 | 3,060 | 114 | a, b, k = map(int, input().split())
X = range(a, b + 1)
for i in sorted(set(X[: k]) | set(X[- k :])):
print(i) |
s333885629 | p03814 | u780206746 | 2,000 | 262,144 | Wrong Answer | 17 | 3,500 | 73 | 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 = input()
left, right = s.find('A'), s.rfind('B')
print(right-left+1)
| s106515843 | Accepted | 17 | 3,500 | 73 | s = input()
left, right = s.find('A'), s.rfind('Z')
print(right-left+1)
|
s080211025 | p03054 | u346308892 | 2,000 | 1,048,576 | Wrong Answer | 223 | 17,492 | 1,566 | We have a rectangular grid of squares with H horizontal rows and W vertical columns. Let (i,j) denote the square at the i-th row from the top and the j-th column from the left. On this grid, there is a piece, which is initially placed at square (s_r,s_c). Takahashi and Aoki will play a game, where each player has a st... |
import numpy as np
from functools import *
import sys
sys.setrecursionlimit(100000)
input = sys.stdin.readline
def acinput():
return list(map(int, input().split(" ")))
def factorial(n):
fact = 1
for integer in range(1, n + 1):
fact *= integer
return fact
def serch(x, count):
#print(... | s243025191 | Accepted | 1,750 | 19,424 | 1,438 |
import numpy as np
from functools import *
import sys
sys.setrecursionlimit(100000)
input = sys.stdin.readline
def acinput():
return list(map(int, input().split(" ")))
def factorial(n):
fact = 1
for integer in range(1, n + 1):
fact *= integer
return fact
H, W, NN = acinput()
initp = np... |
s442268462 | p02409 | u677859833 | 1,000 | 131,072 | Wrong Answer | 30 | 7,740 | 919 | 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... | buils = [
[
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]],
[
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]],
[
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0... | s679858353 | Accepted | 30 | 7,764 | 938 | buils = [
[
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]],
[
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]],
[
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0... |
s263848276 | p03944 | u198336369 | 2,000 | 262,144 | Wrong Answer | 86 | 9,228 | 711 | There is a rectangle in the xy-plane, with its lower left corner at (0, 0) and its upper right corner at (W, H). Each of its sides is parallel to the x-axis or y-axis. Initially, the whole region within the rectangle is painted white. Snuke plotted N points into the rectangle. The coordinate of the i-th (1 ≦ i ≦ N) po... | w,h,n = map(int, input().split())
s = [[1 for i in range(w)] for j in range(h)]
b = [[1,2,3,4,5],[6,7,8,9,10]]
print(b[1][0])
print(b)
alist = []
print(s)
for i in range(n):
x,y,a = map(int, input().split())
alist.append(a)
if a == 1:
for j in range(h):
for k in range(0,x):
... | s560829656 | Accepted | 78 | 9,228 | 678 | w,h,n = map(int, input().split())
s = [[1 for i in range(w)] for j in range(h)]
b = [[1,2,3,4,5],[6,7,8,9,10]]
alist = []
for i in range(n):
x,y,a = map(int, input().split())
alist.append(a)
if a == 1:
for j in range(h):
for k in range(0,x):
s[j][k] = 0
if a == 2:
... |
s086800368 | p02613 | u006738234 | 2,000 | 1,048,576 | Wrong Answer | 146 | 9,216 | 336 | 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())
c0 = 0
c1 = 0
c2 = 0
c3 = 0
for i in range(n):
a = input()
if(a == 'AC'):
c0 += 1
elif(a == 'WA'):
c1 += 1
elif(a == 'TLE'):
c2 += 1
elif(a == 'RE'):
c3 += 1
print('AC × ' + str(c0))
print('WA × ' + str(c1))
print('TLE × ' + str(c2))
print('RE × ' ... | s843719701 | Accepted | 153 | 9,216 | 332 | n = int(input())
c0 = 0
c1 = 0
c2 = 0
c3 = 0
for i in range(n):
a = input()
if(a == 'AC'):
c0 += 1
elif(a == 'WA'):
c1 += 1
elif(a == 'TLE'):
c2 += 1
elif(a == 'RE'):
c3 += 1
print('AC x ' + str(c0))
print('WA x ' + str(c1))
print('TLE x ' + str(c2))
print('RE x ' ... |
s817354585 | p03478 | u926566528 | 2,000 | 262,144 | Wrong Answer | 39 | 9,168 | 202 | Find the sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive). | N, A, B = map(int, input().split())
sum = 0
for n in range(1, N+1):
nsum = 0
while n != 0:
nsum += n % 10
n = n//10
if nsum >= A and nsum <= B:
sum += 1
print(sum)
| s416904861 | Accepted | 38 | 9,108 | 212 | N, A, B = map(int, input().split())
sum = 0
for n in range(1, N+1):
nsum = 0
m = n
while m != 0:
nsum += m % 10
m = m//10
if nsum >= A and nsum <= B:
sum += n
print(sum)
|
s054820623 | p03140 | u411858517 | 2,000 | 1,048,576 | Wrong Answer | 17 | 3,064 | 269 | You are given three strings A, B and C. Each of these is a string of length N consisting of lowercase English letters. Our objective is to make all these three strings equal. For that, you can repeatedly perform the following operation: * Operation: Choose one of the strings A, B and C, and specify an integer i bet... | N = int(input())
A = input()
B = input()
C = input()
ans = 0
for i in range(N):
if A[i] != B[i] != C[i]:
ans += 2
elif A[i] != B[i]:
ans += 1
elif A[i] != C[i]:
ans += 1
elif B[i] != C[i]:
ans += 1
print(ans) | s111916514 | Accepted | 18 | 3,064 | 289 | N = int(input())
A = input()
B = input()
C = input()
ans = 0
for i in range(N):
if A[i] == B[i] == C[i]:
ans += 0
elif A[i] == B[i]:
ans += 1
elif A[i] == C[i]:
ans += 1
elif B[i] == C[i]:
ans += 1
elif A[i] != B[i] and B[i] != C[i]:
ans += 2
print(ans) |
s252435316 | p03635 | u102242691 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 69 | In _K-city_ , there are n streets running east-west, and m streets running north-south. Each street running east-west and each street running north-south cross each other. We will call the smallest area that is surrounded by four streets a block. How many blocks there are in K-city? |
s = input()
number = len(s) - 2
print(s[0] + str(number) + s[-1])
| s499850822 | Accepted | 17 | 2,940 | 50 | n,m = map(int,input().split())
print((n-1)*(m-1))
|
s766449170 | p03759 | u131411061 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 91 | Three poles stand evenly spaced along a line. Their heights are a, b and c meters, from left to right. We will call the arrangement of the poles _beautiful_ if the tops of the poles lie on the same line, that is, b-a = c-b. Determine whether the arrangement of the poles is beautiful. | a,b,c = map(int,input().split())
if (b-a) == (c-a):
print('YES')
else:
print('NO') | s274646264 | Accepted | 17 | 2,940 | 91 | a,b,c = map(int,input().split())
if (b-a) == (c-b):
print('YES')
else:
print('NO') |
s036907592 | p03796 | u762540523 | 2,000 | 262,144 | Wrong Answer | 42 | 2,940 | 98 | Snuke loves working out. He is now exercising N times. Before he starts exercising, his _power_ is 1. After he exercises for the i-th time, his power gets multiplied by i. Find Snuke's power after he exercises N times. Since the answer can be extremely large, print the answer modulo 10^{9}+7. | n = int(input())
power = 1
for i in range(n):
power *= i + 1
power //= 1000000007
print(power) | s510121590 | Accepted | 46 | 2,940 | 97 | n = int(input())
power = 1
for i in range(n):
power *= i + 1
power %= 1000000007
print(power) |
s426000174 | p03555 | u669382434 | 2,000 | 262,144 | Wrong Answer | 17 | 3,060 | 140 | 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. | c=[[i for i in input()] for j in range(2)]
if c[0][0]==c[1][2] and c[0][1]==c[1][1] and c[0][2]==c[1][0]:
print("Yes")
else:
print("No") | s712965706 | Accepted | 17 | 3,060 | 140 | c=[[i for i in input()] for j in range(2)]
if c[0][0]==c[1][2] and c[0][1]==c[1][1] and c[0][2]==c[1][0]:
print("YES")
else:
print("NO") |
s506105797 | p04029 | u053535689 | 2,000 | 262,144 | Wrong Answer | 28 | 9,136 | 98 | 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())
candy = N * (N + 1) / 2
print(candy)
| s525234473 | Accepted | 26 | 9,080 | 102 |
N = int(input())
candy = int(N * (N + 1) / 2)
print(candy) |
s975217761 | p02237 | u564398841 | 1,000 | 131,072 | Wrong Answer | 20 | 7,608 | 344 | There are two standard ways to represent a graph $G = (V, E)$, where $V$ is a set of vertices and $E$ is a set of edges; Adjacency list representation and Adjacency matrix representation. An adjacency-list representation consists of an array $Adj[|V|]$ of $|V|$ lists, one for each vertex in $V$. For each $u \in V$, th... | if __name__ == '__main__':
N = int(input())
matrix = [[0] * N for _ in range(N)]
for i in matrix:
node_info = [int(i) for i in input().split()]
node_i = node_info[0] - 1
if not node_info[1] == 0:
for i in node_info[2:]:
matrix[node_i][i-1] = 1
[print(l... | s776458618 | Accepted | 20 | 7,744 | 360 | if __name__ == '__main__':
N = int(input())
matrix = [['0'] * N for _ in range(N)]
for i in matrix:
node_info = [int(i) for i in input().split()]
node_i = node_info[0] - 1
if not node_info[1] == 0:
for i in node_info[2:]:
matrix[node_i][i - 1] = '1'
[p... |
s695557823 | p02846 | u802963389 | 2,000 | 1,048,576 | Time Limit Exceeded | 2,107 | 3,064 | 370 | Takahashi and Aoki are training for long-distance races in an infinitely long straight course running from west to east. They start simultaneously at the same point and moves as follows **towards the east** : * Takahashi runs A_1 meters per minute for the first T_1 minutes, then runs at A_2 meters per minute for th... | T1, T2 = map(int, input().split())
A1, A2 = map(int, input().split())
B1, B2 = map(int, input().split())
D1 = T1 * (A1 - B1)
D2 = T2 * (A2 - B2)
li = [D1, D2]
li.sort()
pos = 0
cnt = 0
for _ in range(10000000):
pos += li[0]
pos1 = pos
pos += li[1]
pos2 = pos
if pos1 < 0 and pos2 >= 0:
cnt += 2
if cnt >=... | s948417501 | Accepted | 29 | 9,144 | 389 | t1, t2 = map(int, input().split())
a1, a2 = map(int, input().split())
b1, b2 = map(int, input().split())
if ((a1 - b1) * (a2 - b2) > 0) or (abs(a1 - b1) * t1 > abs(a2 - b2) * t2):
print(0)
elif abs(a1 - b1) * t1 == abs(a2 - b2) * t2:
print("infinity")
else:
d, m = divmod(abs(a1 - b1) * t1, abs(a2 - b2) * t2 - ab... |
s499792389 | p03474 | u020373088 | 2,000 | 262,144 | Wrong Answer | 19 | 3,060 | 255 | The postal code in Atcoder Kingdom is A+B+1 characters long, its (A+1)-th character is a hyphen `-`, and the other characters are digits from `0` through `9`. You are given a string S. Determine whether it follows the postal code format in Atcoder Kingdom. | a, b = map(int, input().split())
s = input()
if a+b+1 == len(s):
ok = True
else:
ok = False
for i in range(len(s)):
if i == a:
if s[i] != "-":
ok = False
if type(s[i]) != int:
ok = False
if ok:
print("Yes")
else:
print("No") | s207063617 | Accepted | 17 | 3,060 | 204 | a, b = map(int, input().split())
s = input()
ok = False
if s.count("-") == 1:
ind = s.index("-")
if len(s[:ind]) == a and len(s[ind+1:]) == b:
ok = True
if ok:
print("Yes")
else:
print("No") |
s245299220 | p03679 | u272377260 | 2,000 | 262,144 | Wrong Answer | 19 | 2,940 | 137 | Takahashi has a strong stomach. He never gets a stomachache from eating something whose "best-by" date is at most X days earlier. He gets a stomachache if the "best-by" date of the food is X+1 or more days earlier, though. Other than that, he finds the food delicious if he eats it not later than the "best-by" date. Ot... | x, a, b = map(int, input().split())
if a - b <= 0:
print('delicious')
elif a - b <= x:
print('safe')
else:
print('dangerous') | s946907287 | Accepted | 18 | 2,940 | 137 | x, a, b = map(int, input().split())
if a - b >= 0:
print('delicious')
elif b - a <= x:
print('safe')
else:
print('dangerous') |
s598379251 | p03455 | u038903257 | 2,000 | 262,144 | Wrong Answer | 34 | 4,336 | 155 | AtCoDeer the deer found two positive integers, a and b. Determine whether the product of a and b is even or odd. | import random
a=random.randint(1,10000)
b=random.randint(1,10000)
if (a+b)%2 == 0:
print(a+b)
print('even')
else:
print(a+b)
print('odd') | s946492829 | Accepted | 17 | 2,940 | 96 | a, b = input().split()
a=int(a)
b=int(b)
if (a*b)%2==0:
print("Even")
else:
print("Odd") |
s691152125 | p03377 | u701318346 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 97 | There are a total of A + B cats and dogs. Among them, A are known to be cats, but the remaining B are not known to be either cats or dogs. Determine if it is possible that there are exactly X cats among these A + B animals. | A, B, X = map(int, input().split())
if X >= A and X <= A + B:
print('Yes')
else:
print('No') | s906724979 | Accepted | 17 | 2,940 | 91 | A, B, X = map(int, input().split())
if A <= X <= A + B:
print('YES')
else:
print('NO')
|
s706844092 | p03997 | u369199820 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 84 | 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. | str = [int(input()) for i in range(3)]
area = (str[0]+str[1])*str[2]/2
print(area) | s917963482 | Accepted | 17 | 3,064 | 91 | str = [int(input()) for i in range(3)]
area = (str[0]+str[1])*str[2]/2
print(round(area)) |
s555344945 | p03455 | u534303019 | 2,000 | 262,144 | Wrong Answer | 29 | 8,904 | 90 | AtCoDeer the deer found two positive integers, a and b. Determine whether the product of a and b is even or odd. | a, b =map(int, input().split())
if (a*b)%2 == 0:
print('Odd')
else:
print('Even')
| s465160392 | Accepted | 28 | 8,856 | 90 | a, b =map(int, input().split())
if (a*b)%2 == 0:
print('Even')
else:
print('Odd')
|
s499766000 | p03597 | u371409687 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 49 | We have an N \times N square grid. We will paint each square in the grid either black or white. If we paint exactly A squares white, how many squares will be painted black? | a,b=[int(input()) for i in range(2)]
print(a*2-b) | s861818110 | Accepted | 17 | 2,940 | 49 | a,b=[int(input()) for i in range(2)]
print(a*a-b) |
s104337141 | p02393 | u754514998 | 1,000 | 131,072 | Wrong Answer | 20 | 5,604 | 105 | Write a program which reads three integers, and prints them in ascending order. | a, b, c = (int(x) for x in input().split())
if a > b:
a, b = b, a
if b > c:
b, c = c, b
print(a, b, c)
| s333270550 | Accepted | 20 | 5,600 | 128 | a, b, c = (int(x) for x in input().split())
if a > b:
a, b = b, a
if a > c:
a, c = c, a
if b > c:
b, c = c, b
print(a, b, c)
|
s419927850 | p03963 | u305965165 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 62 | There are N balls placed in a row. AtCoDeer the deer is painting each of these in one of the K colors of his paint cans. For aesthetic reasons, any two adjacent balls must be painted in different colors. Find the number of the possible ways to paint the balls. | n,k = (int(i) for i in input().split())
print(k+(k-1)**(n-1)) | s417701458 | Accepted | 18 | 2,940 | 62 | n,k = (int(i) for i in input().split())
print(k*(k-1)**(n-1)) |
s320808782 | p03944 | u177040005 | 2,000 | 262,144 | Wrong Answer | 150 | 12,508 | 360 | There is a rectangle in the xy-plane, with its lower left corner at (0, 0) and its upper right corner at (W, H). Each of its sides is parallel to the x-axis or y-axis. Initially, the whole region within the rectangle is painted white. Snuke plotted N points into the rectangle. The coordinate of the i-th (1 ≦ i ≦ N) po... | import numpy as np
W,H,N = map(int,input().split())
xl = 0
xr = W
yu = H
yd = 0
for i in range(N):
x,y,a = map(int, input().split())
print(x,y,a)
if a == 1:
xl = max(xl,x)
elif a == 2:
xr = min(xr,x)
elif a == 3:
yd = max(yd,y)
else:
yu = min(yu,y)
ans = max(... | s386093656 | Accepted | 18 | 3,064 | 323 | W,H,N = map(int,input().split())
xl = 0
xr = W
yu = H
yd = 0
for i in range(N):
x,y,a = map(int, input().split())
if a == 1:
xl = max(xl,x)
elif a == 2:
xr = min(xr,x)
elif a == 3:
yd = max(yd,y)
else:
yu = min(yu,y)
ans = max(0,xr - xl) * max(0,yu - yd)
print(an... |
s724735022 | p03862 | u767664985 | 2,000 | 262,144 | Wrong Answer | 191 | 14,544 | 477 | There are N boxes arranged in a row. Initially, the i-th box from the left contains a_i candies. Snuke can perform the following operation any number of times: * Choose a box containing at least one candy, and eat one of the candies in the chosen box. His objective is as follows: * Any two neighboring boxes con... | N, x = map(int, input().split())
a = list(map(int, input().split()))
ans1 = 0
for i in range(N - 1):
if a[i] + a[i + 1] > x:
res = a[i] + a[i + 1] - x
a[i + 1] -= max(a[i + 1], res)
a[i] -= max(0, a[i] - x)
ans1 += res
ans2 = 0
a = a[:: -1]
for i in range(N - 1):
if a[i] + a[i + ... | s283207091 | Accepted | 287 | 15,324 | 469 | from copy import copy
N, x = map(int, input().split())
A = list(map(int, input().split()))
a = copy(A)
ans1 = 0
for i in range(N-1):
if a[i] + a[i+1] > x:
surplus = a[i] + a[i+1] - x
a[i+1] -= min(a[i+1], surplus)
ans1 += surplus
a = copy(A)
ans2 = 0
for i in range(N-1):
if a[N-i-1] ... |
s599146241 | p03943 | u033524082 | 2,000 | 262,144 | Wrong Answer | 18 | 2,940 | 100 | Two students of AtCoder Kindergarten are fighting over candy packs. There are three candy packs, each of which contains a, b, and c candies, respectively. Teacher Evi is trying to distribute the packs between the two students so that each student gets the same number of candies. Determine whether it is possible. Not... | a,b,c=map(int,input().split())
if a==b+c or b==a+c or c==a+b:
print("YES")
else:
print("NO") | s215354156 | Accepted | 17 | 2,940 | 100 | a=list(map(int,input().split()))
a.sort()
if a[2]==a[1]+a[0]:
print("Yes")
else:
print("No") |
s472472317 | p02396 | u921541953 | 1,000 | 131,072 | Time Limit Exceeded | 40,000 | 7,424 | 139 | In the online judge system, a judge file may include multiple datasets to check whether the submitted program outputs a correct answer for each test case. This task is to practice solving a problem with multiple datasets. Write a program which reads an integer x and print it as is. Note that multiple datasets are give... | import sys
i = 1
while True:
x = sys.stdin.readline().strip()
if x == 0:
break
print('Case %d: %s' % (i, x))
i += 1 | s480319264 | Accepted | 50 | 7,376 | 141 | import sys
i = 1
while True:
x = sys.stdin.readline().strip()
if x == '0':
break
print('Case %d: %s' % (i, x))
i += 1 |
s265274824 | p02612 | u934609868 | 2,000 | 1,048,576 | Wrong Answer | 28 | 9,044 | 41 | We will buy a product for N yen (the currency of Japan) at a shop. If we use only 1000-yen bills to pay the price, how much change will we receive? Assume we use the minimum number of bills required. | N = int(input())
a = N//1000
print(a+1) | s377183884 | Accepted | 27 | 9,100 | 84 | N = int(input())
a = N//1000
b = ((a+1)*1000)-N
if b%1000 == 0:
b = 0
print(b) |
s647962506 | p03759 | u055941944 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 115 | 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. | #coding utf-8 -*-
a,b,c=map(int,input().split())
if abs(a-b) == abs(c-b):
print("Yes")
else:
print("No")
| s397234205 | Accepted | 18 | 2,940 | 159 | #coding utf-8 -*-
lis=list(map(int,input().split()))
lis_1=sorted(lis)
if lis_1[2] - lis_1[1] == lis_1[1] - lis_1[0]:
print("YES")
else:
print("NO")
|
s683822717 | p03738 | u177125607 | 2,000 | 262,144 | Wrong Answer | 27 | 9,072 | 118 | You are given two positive integers A and B. Compare the magnitudes of these numbers. | a = int(input())
b = int(input())
if a > b:
print('GRATER')
elif a < b:
print('LESS')
else:
print('EQUAL') | s226980238 | Accepted | 29 | 9,148 | 119 | a = int(input())
b = int(input())
if a > b:
print('GREATER')
elif a < b:
print('LESS')
else:
print('EQUAL') |
s996627148 | p03943 | u752898745 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 103 | 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... | x=list(map(int,input().split()))
x.sort()
if sum(x[:2]) == x[2]:
print("YES")
else:
print("NO") | s553574671 | Accepted | 17 | 2,940 | 111 | C = list(map(int, input().split()))
C.sort()
if C[2] == C[1] + C[0]:
print('Yes')
else:
print('No') |
s823035275 | p03139 | u227085629 | 2,000 | 1,048,576 | Wrong Answer | 17 | 2,940 | 61 | We conducted a survey on newspaper subscriptions. More specifically, we asked each of the N respondents the following two questions: * Question 1: Are you subscribing to Newspaper X? * Question 2: Are you subscribing to Newspaper Y? As the result, A respondents answered "yes" to Question 1, and B respondents answ... | n,a,b = map(int,input().split())
print(max(a+b-n,0),min(a,b)) | s088483589 | Accepted | 17 | 2,940 | 61 | n,a,b = map(int,input().split())
print(min(a,b),max(a+b-n,0)) |
s367978461 | p02613 | u560222605 | 2,000 | 1,048,576 | Wrong Answer | 198 | 9,212 | 242 | 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
b=0
c=0
d=0
for i in range(n):
s=input()
a+=s.count('AC')
b+=s.count('WA')
c+=s.count('TLE')
d+=s.count('RE')
print('AC × '+str(a))
print('WA × '+str(b))
print('TLE × '+str(c))
print('RE × '+str(d))
| s355232679 | Accepted | 202 | 9,208 | 237 | n=int(input())
a=0
b=0
c=0
d=0
for i in range(n):
s=input()
a+=s.count('AC')
b+=s.count('WA')
c+=s.count('TLE')
d+=s.count('RE')
print('AC x '+str(a))
print('WA x '+str(b))
print('TLE x '+str(c))
print('RE x '+str(d)) |
s882725142 | p03623 | u482969053 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 106 | 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... | # coding: utf-8
# Here your code !
n = input()
if n.find('9') >= 0:
print('Yes')
else:
print('No') | s489159880 | Accepted | 17 | 2,940 | 103 | x, a, b = list(map(int, input().split()))
if abs(x-a) < abs(x-b):
print('A')
else:
print('B')
|
s481299073 | p04030 | u342456871 | 2,000 | 262,144 | Wrong Answer | 17 | 3,060 | 192 | 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(str)
ans = ""
for i in range(len(s)):
if (s[i] == '0'):
ans += '0'
elif (s[i] == '1'):
ans += '0'
else:
if (len(ans) > 0):
ans = ans[:len(ans)-1]
print(ans) | s855262367 | Accepted | 17 | 3,060 | 182 | s = input()
ans = ''
for i in range(len(s)):
if (s[i] == '0'):
ans += '0'
elif (s[i] == '1'):
ans += '1'
else:
if (len(ans) != 0):
ans = ans[:-1]
print(ans) |
s203927583 | p03399 | u127856129 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 113 | You planned a trip using trains and buses. The train fare will be A yen (the currency of Japan) if you buy ordinary tickets along the way, and B yen if you buy an unlimited ticket. Similarly, the bus fare will be C yen if you buy ordinary tickets along the way, and D yen if you buy an unlimited ticket. Find the minimu... | a=int(input())
b=int(input())
c=int(input())
d=int(input())
if (a+c)<(b+d):
print(a+c)
else:
print(b+d)
| s369502266 | Accepted | 17 | 2,940 | 182 | a=int(input())
b=int(input())
c=int(input())
d=int(input())
if a<=b and c<=d:
print(a+c)
elif a<=b and d<=c:
print(a+d)
elif b<=a and c<=d:
print(b+c)
else:
print(b+d)
|
s307818145 | p03598 | u619819312 | 2,000 | 262,144 | Wrong Answer | 18 | 2,940 | 123 | There are N balls in the xy-plane. The coordinates of the i-th of them is (x_i, i). Thus, we have one ball on each of the N lines y = 1, y = 2, ..., y = N. In order to collect these balls, Snuke prepared 2N robots, N of type A and N of type B. Then, he placed the i-th type-A robot at coordinates (0, i), and the i-th t... | n=int(input())
k=int(input())
a=list(map(int,input().split()))
c=0
for i in range(n):
c+=min(abs(k-a[i]),a[i])
print(c) | s927899934 | Accepted | 18 | 2,940 | 125 | n=int(input())
k=int(input())
a=list(map(int,input().split()))
c=0
for i in range(n):
c+=2*min(abs(k-a[i]),a[i])
print(c) |
s693255605 | p02646 | u499998503 | 2,000 | 1,048,576 | Wrong Answer | 24 | 9,192 | 331 | 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 = input().split()
B,W = input().split()
A = int(A)
V = int(V)
B = int(B)
W = int(W)
T = int(input())
distance = B-A
closer = W-V
def solve():
if closer >= 0:
print("No")
return
if distance + (closer * T) <= 0:
print("Yes")
return
else:
print("No")
retu... | s594323183 | Accepted | 19 | 9,200 | 358 | A,V = input().split()
B,W = input().split()
A = int(A)
V = int(V)
B = int(B)
W = int(W)
T = int(input())
def solve():
distance = abs(B-A)
closer = abs(V-W)
if V <= W:
print("NO")
return
time = distance/closer
if time <= T:
print("YES")
return
else:
... |
s499558080 | p03486 | u835482198 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 96 | You are given strings s and t, consisting of lowercase English letters. You will create a string s' by freely rearranging the characters in s. You will also create a string t' by freely rearranging the characters in t. Determine whether it is possible to satisfy s' < t' for the lexicographic order. | a = sorted(input())[::-1]
b = sorted(input())
if a < b:
print("Yes")
else:
print("No")
| s119701433 | Accepted | 19 | 3,064 | 95 | a = sorted(input())
b = sorted(input())[::-1]
if a < b:
print("Yes")
else:
print("No")
|
s005382061 | p04029 | u496280557 | 2,000 | 262,144 | Wrong Answer | 20 | 9,060 | 58 | 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())
answer = (N + 1 ) * N / 2
print(answer) | s891647157 | Accepted | 28 | 9,068 | 39 | N =int(input())
print(N * (N+1) // 2)
|
s566963069 | p00002 | u073709667 | 1,000 | 131,072 | Wrong Answer | 20 | 7,620 | 57 | Write a program which computes the digit number of sum of two integers a and b. | a,b=map(int,input().split())
num=a+b
print(len(str(num))) | s324744366 | Accepted | 30 | 7,532 | 120 | while True:
try:
a,b=map(int,input().split())
except:
break
sum=str(a+b)
print(len(sum)) |
s114743263 | p02600 | u998008108 | 2,000 | 1,048,576 | Wrong Answer | 30 | 9,108 | 344 | M-kun is a competitor in AtCoder, whose highest rating is X. In this site, a competitor is given a _kyu_ (class) according to his/her highest rating. For ratings from 400 through 1999, the following kyus are given: * From 400 through 599: 8-kyu * From 600 through 799: 7-kyu * From 800 through 999: 6-kyu * Fr... | x=int(input())
if(x>=400 and x<=599):
print("8-kyu")
if(x>=600 and x<=799):
print("7-kyu")
if(x>=800 and x<=999):
print("6-kyu")
if(x>=1000 and x<=1199):
print("5-kyu")
if(x>=1200 and x<=1399):
print("4-kyu")
if(x>=1400 and x<=1599):
print("3-kyu")
if(x>=1600 and x<=1799):
print("2-kyu")
if(x>=1800 and x<... | s837700467 | Accepted | 27 | 9,176 | 313 | x=int(input())
if(x>=400 and x<=599):
print("8")
if(x>=600 and x<=799):
print("7")
if(x>=800 and x<=999):
print("6")
if(x>=1000 and x<=1199):
print("5")
if(x>=1200 and x<=1399):
print("4")
if(x>=1400 and x<=1599):
print("3")
if(x>=1600 and x<=1799):
print("2")
if(x>=1800 and x<=1999):
print("1")
|
s504641199 | p00008 | u075836834 | 1,000 | 131,072 | Wrong Answer | 40 | 7,596 | 325 | Write a program which reads an integer n and identifies the number of combinations of a, b, c and d (0 ≤ a, b, c, d ≤ 9) which meet the following equality: a + b + c + d = n For example, for n = 35, we have 4 different combinations of (a, b, c, d): (8, 9, 9, 9), (9, 8, 9, 9), (9, 9, 8, 9), and (9, 9, 9, 8). |
while True:
try:
n=int(input())
cnt=0
for a in range(10):
if a<=n:
for b in range(10):
if b<=n:
for c in range(10):
if c<=n:
d = n-(a+b+c)
if 0<=d<=9:
cnt+=1
else:
break
else:
break
else:
break
print(cnt)
except EOFError:
... | s401126203 | Accepted | 60 | 7,628 | 323 |
while True:
try:
n=int(input())
cnt=0
for a in range(10):
if a<=n:
for b in range(10):
if b<=n:
for c in range(10):
if c<=n:
d = n-(a+b+c)
if 0<=d<=9:
cnt+=1
else:
break
else:
break
else:
break
print(cnt)
except EOFError:
br... |
s339809465 | p03698 | u506287026 | 2,000 | 262,144 | Wrong Answer | 18 | 2,940 | 78 | You are given a string S consisting of lowercase English letters. Determine whether all the characters in S are different. | S = input()
if len(S) != len(set(S)):
print('yes')
else:
print('no')
| s262274545 | Accepted | 20 | 2,940 | 171 | S = input()
ans = []
is_Yes = True
for s in S:
if s in ans:
is_Yes = False
break
ans.append(s)
if is_Yes:
print('yes')
else:
print('no')
|
s310365486 | p00028 | u811733736 | 1,000 | 131,072 | Wrong Answer | 30 | 7,956 | 573 | Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. | import sys
from collections import Counter
if __name__ == '__main__':
# ??????????????\???
# data = [5, 6, 3, 5, 8, 7, 5, 3, 9, 7, 3, 4]
data = []
for line in sys.stdin:
data.append(int(line.strip()))
print(data)
c = Counter(data)
max_freq = c.most_common(1)[0][1]
modes... | s874083745 | Accepted | 30 | 7,952 | 575 | import sys
from collections import Counter
if __name__ == '__main__':
# ??????????????\???
# data = [5, 6, 3, 5, 8, 7, 5, 3, 9, 7, 3, 4]
data = []
for line in sys.stdin:
data.append(int(line.strip()))
# print(data)
c = Counter(data)
max_freq = c.most_common(1)[0][1]
mod... |
s691403719 | p03943 | u942280986 | 2,000 | 262,144 | Wrong Answer | 17 | 3,064 | 111 | Two students of AtCoder Kindergarten are fighting over candy packs. There are three candy packs, each of which contains a, b, and c candies, respectively. Teacher Evi is trying to distribute the packs between the two students so that each student gets the same number of candies. Determine whether it is possible. Not... | a,b,c = map(int,input().split())
if a==(b+c) or b ==(a+c) or c ==(a+b):
print('YES')
else:
print('NO') | s037376367 | Accepted | 17 | 2,940 | 111 | a,b,c = map(int,input().split())
if a==(b+c) or b ==(a+c) or c ==(a+b):
print('Yes')
else:
print('No') |
s932064541 | p03409 | u781262926 | 2,000 | 262,144 | Wrong Answer | 164 | 12,616 | 721 | On a two-dimensional plane, there are N red points and N blue points. The coordinates of the i-th red point are (a_i, b_i), and the coordinates of the i-th blue point are (c_i, d_i). A red point and a blue point can form a _friendly pair_ when, the x-coordinate of the red point is smaller than that of the blue point, ... | import numpy as np
n, *ABCD = map(int, open(0).read().split())
AB = sorted([(a, b) for a, b in zip(ABCD[:2*n:2], ABCD[1:2*n:2])])
CD = sorted([(c, d) for c, d in zip(ABCD[2*n::2], ABCD[2*n+1::2])])
table = np.zeros((n, n), dtype=np.int)
for i in range(n):
a, b = AB[i]
for j in range(n):
c, d = CD[j]
... | s565477321 | Accepted | 19 | 3,064 | 354 | n, *ABCD = map(int, open(0).read().split())
AB = sorted([(a, b) for a, b in zip(ABCD[:2*n:2], ABCD[1:2*n:2])], key=lambda x:-x[1])
CD = sorted([(c, d) for c, d in zip(ABCD[2*n::2], ABCD[2*n+1::2])])
for c, d in CD:
for i in range(len(AB)):
a, b = AB[i]
if a < c and b < d:
_ = AB.pop(i)
... |
s665629691 | p03729 | u320763652 | 2,000 | 262,144 | Wrong Answer | 17 | 3,060 | 161 | You are given three strings A, B and C. Check whether they form a _word chain_. More formally, determine whether both of the following are true: * The last character in A and the initial character in B are the same. * The last character in B and the initial character in C are the same. If both are true, print `Y... | a,b,c = input().split()
print(a[0].upper() + b[0].upper() + c[0].upper())
if a[len(a)-1] == b[0] and b[len(b)-1] == c[0]:
print("YES")
else:
print("NO") | s803456458 | Accepted | 17 | 2,940 | 111 | a,b,c = input().split()
if a[len(a)-1] == b[0] and b[len(b)-1] == c[0]:
print("YES")
else:
print("NO") |
s030312705 | p03759 | u059684599 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 68 | Three poles stand evenly spaced along a line. Their heights are a, b and c meters, from left to right. We will call the arrangement of the poles _beautiful_ if the tops of the poles lie on the same line, that is, b-a = c-b. Determine whether the arrangement of the poles is beautiful. | a,b,c = map(int, input().split())
print("Yes" if b-a==c-b else "No") | s954096756 | Accepted | 17 | 2,940 | 68 | a,b,c = map(int, input().split())
print("YES" if b-a==c-b else "NO") |
s759797996 | p02408 | u836133197 | 1,000 | 131,072 | Wrong Answer | 20 | 5,604 | 697 | Taro is going to play a card game. However, now he has only n cards, even though there should be 52 cards (he has no Jokers). The 52 cards include 13 ranks of each of the four suits: spade, heart, club and diamond. | a = int(input())
cards = [[False for x in range(13)] for y in range(4)]
for i in range(a):
s, v = map(str, input().split())
u = int(v)
if s == 'S':
cards[0][u-1] = True
elif s == 'H':
cards[1][u-1] = True
elif s == 'C':
cards[2][u-1] = True
else:
cards[3][u-1] = T... | s283653547 | Accepted | 20 | 5,620 | 818 | a = int(input())
cards = [[False for x in range(13)] for y in range(4)]
for i in range(a):
s, v = map(str, input().split())
u = int(v)
if s == 'S':
cards[0][u-1] = True
elif s == 'H':
cards[1][u-1] = True
elif s == 'C':
cards[2][u-1] = True
elif s == 'D':
cards[3]... |
s414446714 | p02608 | u149991748 | 2,000 | 1,048,576 | Wrong Answer | 157 | 9,092 | 611 | Let f(n) be the number of triples of integers (x,y,z) that satisfy both of the following conditions: * 1 \leq x,y,z * x^2 + y^2 + z^2 + xy + yz + zx = n Given an integer N, find each of f(1),f(2),f(3),\ldots,f(N). | import math
from itertools import combinations_with_replacement
def calc(t):
return t[0]*t[0] + t[1]*t[1] + t[2]*t[2] + t[0]*t[1] + t[1]*t[2] + t[2]*t[0]
n = int(input())
ans = [0]*n
n_root = math.floor(math.sqrt(n))
for pattern in combinations_with_replacement(range(1, n_root + 1), 3):
pattern = list(patte... | s449098453 | Accepted | 176 | 9,392 | 667 | import math
from itertools import combinations_with_replacement
def calc(t):
return t[0]*t[0] + t[1]*t[1] + t[2]*t[2] + t[0]*t[1] + t[1]*t[2] + t[2]*t[0]
n = int(input())
ans = [0]*n
n_root = math.floor(math.sqrt(n))+1
for pattern in combinations_with_replacement(range(1, n_root + 1), 3):
pattern = list(pat... |
s152023553 | p03610 | u366939485 | 2,000 | 262,144 | Wrong Answer | 27 | 10,132 | 41 | You are given a string s consisting of lowercase English letters. Extract all the characters in the odd-indexed positions and print the string obtained by concatenating them. Here, the leftmost character is assigned the index 1. | list_s = list(input())
print(list_s[::2]) | s025319865 | Accepted | 30 | 10,024 | 50 | list_s = list(input())
print("".join(list_s[::2])) |
s036869149 | p03998 | u969708690 | 2,000 | 262,144 | Wrong Answer | 2,205 | 9,040 | 340 | 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()
n=a
while True:
if n!="":
k=n[0]
if n==a:
a=a[1:]
elif k==b:
b=b[1:]
else:
c=c[1:]
if k=="a":
n=a
elif k=="b":
n=b
else:
n=c
else:
if n==a:
print("A")
elif n==b:
print("B")
else:
print("C")
... | s021579756 | Accepted | 25 | 8,956 | 427 | A=input()
B=input()
C=input()
moto=A
suji="a"
while True:
if len(moto)==0:
if suji=="a":
print("A")
exit()
if suji=="b":
print("B")
exit()
if suji=="c":
print("C")
exit()
s=moto[0]
if suji=="a":
A=A[1:]
if suji=="b":
B=B[1:]
if suji=="c":
C=C[1:]
i... |
s643963266 | p02600 | u512623857 | 2,000 | 1,048,576 | Wrong Answer | 30 | 9,204 | 337 | M-kun is a competitor in AtCoder, whose highest rating is X. In this site, a competitor is given a _kyu_ (class) according to his/her highest rating. For ratings from 400 through 1999, the following kyus are given: * From 400 through 599: 8-kyu * From 600 through 799: 7-kyu * From 800 through 999: 6-kyu * Fr... | X = int(input())
if (1800 <= X < 2000):
print("1級")
elif (1600 <= X < 1800):
print("2級")
elif (1400 <= X < 1600):
print("3級")
elif (1200 <= X < 1400):
print("4級")
elif (1000 <= X < 1200):
print("5級")
elif (800 <= X < 1000):
print("6級")
elif (600 <= X < 800):
print("7級")
elif (400 <= X < 600):
print("8級"... | s165286689 | Accepted | 27 | 9,200 | 297 | X = int(input())
if (1800 <= X < 2000):
print(1)
elif (1600 <= X < 1800):
print(2)
elif (1400 <= X < 1600):
print(3)
elif (1200 <= X < 1400):
print(4)
elif (1000 <= X < 1200):
print(5)
elif (800 <= X < 1000):
print(6)
elif (600 <= X < 800):
print(7)
elif (400 <= X < 600):
print(8) |
s122703869 | p02646 | u819911285 | 2,000 | 1,048,576 | Wrong Answer | 25 | 9,184 | 176 | 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 = input()
T = int(t)
d = b - a
dv = v - w
if int(d) <= int(dv) * T:
print('Yes')
else:
print('No') | s423850904 | Accepted | 27 | 9,204 | 221 | a, v = map(int, input().split())
b, w = map(int, input().split())
t = input()
T = int(t)
d = b - a
d = int(d)
dv = v - w
dv = int(dv)
d = abs(d)
if dv > 0 and abs(d) <= abs(dv) * T:
print('YES')
else:
print('NO') |
s106107889 | p02678 | u637175065 | 2,000 | 1,048,576 | Wrong Answer | 615 | 104,632 | 1,396 | 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 math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,copy,functools
import time,random
sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
mod2 = 998244353
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]
def LI(): return lis... | s443206379 | Accepted | 681 | 104,724 | 1,396 | import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,copy,functools
import time,random
sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
mod2 = 998244353
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]
def LI(): return lis... |
s309292939 | p03370 | u384679440 | 2,000 | 262,144 | Wrong Answer | 18 | 3,064 | 161 | Akaki, a patissier, can make N kinds of doughnut using only a certain powder called "Okashi no Moto" (literally "material of pastry", simply called Moto below) as ingredient. These doughnuts are called Doughnut 1, Doughnut 2, ..., Doughnut N. In order to make one Doughnut i (1 ≤ i ≤ N), she needs to consume m_i grams o... | N, X = map(int, input().split())
kind = []
num = 0
for i in range(N):
kind.append(int(input()))
X -= sum(kind)
num += len(kind)
num += X / min(kind)
print(num) | s544292255 | Accepted | 17 | 2,940 | 157 | N, X = map(int, input().split())
flavour = []
for i in range(N):
flavour.append(int(input()))
X -= flavour[i]
print(len(flavour) + int(X / min(flavour))) |
s637587064 | p03565 | u444856278 | 2,000 | 262,144 | Wrong Answer | 17 | 3,064 | 469 | E869120 found a chest which is likely to contain treasure. However, the chest is locked. In order to open it, he needs to enter a string S consisting of lowercase English letters. He also found a string S', which turns out to be the string S with some of its letters (possibly all or none) replaced with `?`. One mo... | s = input()
t = input()
ans = ""
if t in s:
ans = s.replace("?", "a")
else:
for i in range(len(s) - len(t) + 1):
if s[i] in t:
print("po")
if all([s[i - t.index(s[i]) + j] == t[j] or s[i + j] == "?" for j in range(len(t))]):
ans = s[:i] + t + s[i + len(t):]
... | s748984025 | Accepted | 17 | 3,064 | 493 | s = input()
t = input()
ans = ""
po = False
for i in range(len(s)-len(t)+1):
if s[i] in [t[0],"?"]:
if all([s[i + j] in [t[j], "?"]for j in range(len(t))]):
if not po:
ans = (s[:i] + t + s[i + len(t):]).replace("?","a")
po = True
temp = (s[:i] + t + s... |
s753890770 | p03545 | u680183386 | 2,000 | 262,144 | Wrong Answer | 17 | 3,064 | 391 | Sitting in a station waiting room, Joisino is gazing at her train ticket. The ticket is numbered with four digits A, B, C and D in this order, each between 0 and 9 (inclusive). In the formula A op1 B op2 C op3 D = 7, replace each of the symbols op1, op2 and op3 with `+` or `-` so that the formula holds. The given in... | import sys
num = [int(x) for x in input()]
sign = ["-","+"]
ans = str(num[0])
for x in range(2 ** (len(num)-1)):
sum = num[0]
for i in range(len(num) - 1):
if ((x >> (2-i)) & 1) == 1:
sum += num[i+1]
else:
sum -= num[i+1]
if sum == 7:
for i in range(len(num) - 1):
ans = "{}{}{}".form... | s506787092 | Accepted | 17 | 3,064 | 397 | import sys
num = [int(x) for x in input()]
sign = ["-","+"]
ans = str(num[0])
for x in range(2 ** (len(num)-1)):
sum = num[0]
for i in range(len(num) - 1):
if ((x >> (2-i)) & 1) == 1:
sum += num[i+1]
else:
sum -= num[i+1]
if sum == 7:
for i in range(len(num) - 1):
ans = "{}{}{}".form... |
s713949131 | p02610 | u899782392 | 2,000 | 1,048,576 | Wrong Answer | 2,215 | 59,428 | 1,119 | We have N camels numbered 1,2,\ldots,N. Snuke has decided to make them line up in a row. The happiness of Camel i will be L_i if it is among the K_i frontmost camels, and R_i otherwise. Snuke wants to maximize the total happiness of the camels. Find the maximum possible total happiness of the camel. Solve this probl... | def solve():
ans = 0
N = int(input())
KLR = []
for _ in range(N):
KLR.append(list(map(int, input().split())))
KLR.sort(key=lambda klr: -abs(klr[1] - klr[2]))
print(KLR)
train = [None] * N
for klr in KLR:
if klr[1] > klr[2]:
pos = klr[0] - 1
dir = -... | s322818729 | Accepted | 727 | 72,000 | 1,213 | import heapq
def priority(klr):
return abs(klr[1]-klr[2])
def process(KP):
q = []
for kp in KP:
if kp[0] < len(q) and len(q) > 0 and q[0] < kp[1]:
heapq.heappop(q)
if kp[0] >= len(q):
heapq.heappush(q, kp[1])
return sum(q)
def s... |
s410112912 | p03408 | u046187684 | 2,000 | 262,144 | Wrong Answer | 18 | 3,064 | 702 | 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... | def solve(string):
count = dict([])
n, *rest = string.split()
n = int(n)
blues = rest[:n]
m = rest[n]
reds = rest[n + 1:]
for key in blues:
if key in count:
count[key] += 1
else:
count[key] = 1
for key in reds:
if key in count:
... | s772086086 | Accepted | 21 | 3,316 | 473 | from collections import Counter
def solve(string):
n, *rest = string.split()
n = int(n)
count = Counter(rest[:n])
m = rest[n]
count -= Counter(rest[n + 1:])
return str(max(max(count.values()), 0)) if len(count) > 0 else "0"
if __name__ == '__main__':
n = int(input())
ins = '{}\n'.for... |
s940299746 | p03409 | u920299620 | 2,000 | 262,144 | Wrong Answer | 18 | 3,064 | 862 | On a two-dimensional plane, there are N red points and N blue points. The coordinates of the i-th red point are (a_i, b_i), and the coordinates of the i-th blue point are (c_i, d_i). A red point and a blue point can form a _friendly pair_ when, the x-coordinate of the red point is smaller than that of the blue point, ... | n=int(input())
data=[]
for i in range(n):
tmp=[0]*3
tmp[0],tmp[1]=map(int,input().split())
data.append(tmp)
for i in range(n):
tmp=[1]*3
tmp[0],tmp[1]=map(int,input().split())
data.append(tmp)
data.sort(key=lambda x:x[0])
print(data)
ans=0
j=2*n-1
while(data[j][2]==0):
j-=1
while(1... | s884231538 | Accepted | 19 | 3,188 | 1,063 | n=int(input())
data=[]
for i in range(n):
tmp=[0]*3
tmp[0],tmp[1]=map(int,input().split())
data.append(tmp)
for i in range(n):
tmp=[1]*3
tmp[0],tmp[1]=map(int,input().split())
data.append(tmp)
data.sort(key=lambda x:x[0])
ans=0
j=2*n-1
while(data[j][2]==0):
j-=1
ttmp=[]
while(1):
... |
s977604302 | p03730 | u679325651 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 181 | 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 math
a,b,c=[int(i) for i in input().split()]
ct=0
for i in range(b+1):
if i==0: continue
if (a*i)%b==c:
ct+=1
break
if ct==0:
print("NO")
| s099987011 | Accepted | 17 | 2,940 | 115 | a,b,c=[int(i) for i in input().split()]
if c in [(a*i)%b for i in range(b)]:
print("YES")
else:
print("NO") |
s472869034 | p03386 | u017415492 | 2,000 | 262,144 | Wrong Answer | 28 | 9,100 | 184 | 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=set()
for i in range(a,min(b,a+k)+1):
ans.add(i)
for i in range(b-min(a,k)+1,b+1):
ans.add(i)
ans=list(ans)
ans.sort()
for i in ans:
print(i) | s238790400 | Accepted | 30 | 9,076 | 213 | a,b,k=map(int,input().split())
ans=[]
for i in range(a,k+a):
if a<=i<=b:
ans.append(i)
for i in range(b-k+1,b+1):
if a<=i<=b:
ans.append(i)
ans=list(set(ans))
ans.sort()
for i in ans:
print(i)
|
s418044507 | p03485 | u407016024 | 2,000 | 262,144 | Wrong Answer | 18 | 2,940 | 105 | 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())
if (a+b)%2 == 0:
print(int((a+b)%2))
else:
print(int((a+b)%2)+1) | s711317814 | Accepted | 17 | 2,940 | 108 | a, b = map(int, input().split())
if ((a+b)%2) == 0:
print(int((a+b)/2))
else:
print(int((a+b)/2)+1) |
s640773468 | p03605 | u088974156 | 2,000 | 262,144 | Wrong Answer | 18 | 2,940 | 40 | It is September 9 in Japan now. You are given a two-digit integer N. Answer the question: Is 9 contained in the decimal notation of N? | print("Yes" if input() in "9" else "No") | s720595175 | Accepted | 18 | 2,940 | 40 | print("Yes" if "9" in input() else "No") |
s464851917 | p03671 | u879870653 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 69 | Snuke is buying a bicycle. The bicycle of his choice does not come with a bell, so he has to buy one separately. He has very high awareness of safety, and decides to buy two bells, one for each hand. The store sells three kinds of bells for the price of a, b and c yen (the currency of Japan), respectively. Find the m... | A = list(map(int,input().split()))
res = sum(A) - min(A)
print(res)
| s011272402 | Accepted | 17 | 2,940 | 69 | A = list(map(int,input().split()))
res = sum(A) - max(A)
print(res)
|
s009163917 | p02742 | u075303794 | 2,000 | 1,048,576 | Wrong Answer | 17 | 2,940 | 104 | 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())
a = w//2+1
b = a-1
a += b
if h%2==0:
print(a*h)
else:
print(a*h-b) | s603906374 | Accepted | 17 | 2,940 | 120 | h,w = map(int, input().split())
a = h*w
if h==1 or w==1:
print(1)
elif a%2==0:
print(a//2)
else:
print(a//2+1) |
s058896468 | p03829 | u842964692 | 2,000 | 262,144 | Wrong Answer | 79 | 14,228 | 190 | There are N towns on a line running east-west. The towns are numbered 1 through N, in order from west to east. Each point on the line has a one- dimensional coordinate, and a point that is farther east has a greater coordinate value. The coordinate of town i is X_i. You are now at town 1, and you want to visit all the... | N,A,B=map(int,input().split())
X=list(map(int,input().split()))
ans=0
pre=X[0]
for xi in X[1:]:
if (xi-pre)*A-B>0:
ans+=B
else:
ans+=(xi-pre)
pre=xi
print(ans) | s889370500 | Accepted | 79 | 15,020 | 192 | N,A,B=map(int,input().split())
X=list(map(int,input().split()))
ans=0
pre=X[0]
for xi in X[1:]:
if (xi-pre)*A-B>0:
ans+=B
else:
ans+=(xi-pre)*A
pre=xi
print(ans) |
s112162671 | p02613 | u455354923 | 2,000 | 1,048,576 | Wrong Answer | 140 | 16,212 | 187 | 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())
list = [input() for i in range(N)]
print("AC ×", list.count("AC"))
print("WA ×", list.count("WA"))
print("TLE ×", list.count("TLE"))
print("RE ×", list.count("RE"))
| s588120666 | Accepted | 139 | 16,220 | 183 | N = int(input())
list = [input() for i in range(N)]
print("AC x", list.count("AC"))
print("WA x", list.count("WA"))
print("TLE x", list.count("TLE"))
print("RE x", list.count("RE"))
|
s240739208 | p03636 | u789565565 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 50 | 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()
x = len(s)
print(s[0]+'str(x)'+s[x-1]) | s966402282 | Accepted | 19 | 2,940 | 50 | s = input()
x = len(s)
print(s[0]+str(x-2)+s[x-1]) |
s562714793 | p03693 | u982471399 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 98 | 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 = list(map(int,input().split()))
A=r*100+g*10+b
if A==0:
print("YES")
else:
print("NO") | s399119225 | Accepted | 17 | 2,940 | 100 | r,g,b = list(map(int,input().split()))
A=r*100+g*10+b
if A%4==0:
print("YES")
else:
print("NO") |
s475074354 | p02613 | u772261431 | 2,000 | 1,048,576 | Wrong Answer | 168 | 16,132 | 206 | Takahashi is participating in a programming contest called AXC002, and he has just submitted his code to Problem A. The problem has N test cases. For each test case i (1\leq i \leq N), you are given a string S_i representing the verdict for that test case. Find the numbers of test cases for which the verdict is `AC`,... | N = int(input())
s = [input() for i in range(N)]
row = ['AC', 'WA', 'TLE', 'RE']
for r in row:
count = 0
for col in s:
if col == r:
count += 1
print(r, '×', count, sep=' ')
| s296570108 | Accepted | 160 | 16,268 | 205 | N = int(input())
s = [input() for i in range(N)]
row = ['AC', 'WA', 'TLE', 'RE']
for r in row:
count = 0
for col in s:
if col == r:
count += 1
print(r, 'x', count, sep=' ')
|
s281538156 | p03544 | u905582793 | 2,000 | 262,144 | Wrong Answer | 18 | 2,940 | 76 | It is November 18 now in Japan. By the way, 11 and 18 are adjacent Lucas numbers. You are given an integer N. Find the N-th Lucas number. Here, the i-th Lucas number L_i is defined as follows: * L_0=2 * L_1=1 * L_i=L_{i-1}+L_{i-2} (i≥2) | a=[2,1]
for i in range(90):
a.append(a[-1]+a[-2])
print(a[int(input())-1]) | s421505145 | Accepted | 17 | 2,940 | 74 | a=[2,1]
for i in range(90):
a.append(a[-1]+a[-2])
print(a[int(input())]) |
s400176411 | p03457 | u691072882 | 2,000 | 262,144 | Wrong Answer | 624 | 31,468 | 776 | 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())
All = [list(map(int, input().split())) for _ in range(N)]
t = [row[0] for row in All]
x = [row[1] for row in All]
y = [row[2] for row in All]
pre_x = 0
pre_y = 0
pre_t = 0
can = True
for n in range(N):
can2 = False
T = abs(t[n] - pre_t)
dx = abs(x[n] - pre_x)
dy = abs(y[n] - pre_y)
... | s153924080 | Accepted | 419 | 27,380 | 487 | N = int(input())
All = [list(map(int, input().split())) for _ in range(N)]
pre_x = 0
pre_y = 0
pre_t = 0
can = True
for n in range(N):
can2 = False
T = All[n][0] - pre_t
d = abs(All[n][1] - pre_x) + abs(All[n][2] - pre_y)
# print(T, d)
if d <= T and T % 2 == d % 2:
can2 = True
if can2... |
s073616476 | p00029 | u300946041 | 1,000 | 131,072 | Wrong Answer | 30 | 7,744 | 374 | Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separate... | # -*- coding: utf-8 -*-
from collections import defaultdict
d = defaultdict(int)
_input = input()
sentence = [e for e in _input.split()]
l = []
for word in sentence:
d[word] += 1
times = sorted(d.items(), key=lambda item: item[1], reverse=True)
lengths = sorted(d.items(), key=lambda item: len(item[0]), reverse=T... | s045143891 | Accepted | 30 | 7,748 | 334 | # -*- coding: utf-8 -*-
from collections import defaultdict
d = defaultdict(int)
_input = input()
for word in _input.split():
d[word] += 1
times = sorted(d.items(), key=lambda item: item[1], reverse=True)
lengths = sorted(d.items(), key=lambda item: len(item[0]), reverse=True)
print(times[0][0], end=' ')
print(... |
s512822453 | p04030 | u105099610 | 2,000 | 262,144 | Wrong Answer | 25 | 9,016 | 215 | 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 = list(input())
n = len(s)
ans = []
for i in range(n):
if s[i] == 0:
ans.append('0')
elif s[i] == 1:
ans.append('1')
elif ans == []:
continue
else:
ans.pop()
print(''.join(ans))
| s617374223 | Accepted | 23 | 9,020 | 219 | s = list(input())
n = len(s)
ans = []
for i in range(n):
if s[i] == '0':
ans.append('0')
elif s[i] == '1':
ans.append('1')
elif ans == []:
continue
else:
ans.pop()
print(''.join(ans))
|
s424675154 | p02646 | u888092736 | 2,000 | 1,048,576 | Wrong Answer | 22 | 9,172 | 221 | 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())
delta_v = V - W
if delta_v <= 0:
print('No')
elif (abs(A - B) + delta_v - 1) // delta_v > T:
print('No')
else:
print('Yes')
| s302881884 | Accepted | 21 | 9,172 | 221 | A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())
delta_v = V - W
if delta_v <= 0:
print('NO')
elif (abs(A - B) + delta_v - 1) // delta_v > T:
print('NO')
else:
print('YES')
|
s452651606 | p03486 | u485566817 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 115 | You are given strings s and t, consisting of lowercase English letters. You will create a string s' by freely rearranging the characters in s. You will also create a string t' by freely rearranging the characters in t. Determine whether it is possible to satisfy s' < t' for the lexicographic order. | s = str(input())
t = str(input())
s2 = sorted(s)
t2 = sorted(t)
if s2 < t2:
print('yes')
else:
print('no') | s814603388 | Accepted | 17 | 2,940 | 124 | s = input()
t = input()
s_r = sorted(s)
t_r = sorted(t, reverse=True)
if s_r < t_r:
print("Yes")
else:
print("No") |
s836742595 | p03229 | u060736237 | 2,000 | 1,048,576 | Wrong Answer | 231 | 8,516 | 335 | You are given N integers; the i-th of them is A_i. Find the maximum possible sum of the absolute differences between the adjacent elements after arranging these integers in a row in any order you like. | N = int(input())
A = sorted([int(input()) for _ in range(N)], reverse=True)
result = 0
if N % 2 == 0:
k = [2]*((N-2)//2)
k += [1]
k += [-1]
a = [-2]*((N-2)//2)
k = k+a
else:
k = [2]*(N//2-1)
k += [1]
k += [1]
a = [-2]*(N//2)
k = k+a
for a, keisu in zip(A, k):
result += a*keis... | s706429595 | Accepted | 263 | 8,612 | 607 | N = int(input())
A = sorted([int(input()) for _ in range(N)], reverse=True)
result = 0
if N % 2 == 0:
k = [2]*((N-2)//2)
k += [1]
k += [-1]
a = [-2]*((N-2)//2)
k = k+a
for a, keisu in zip(A, k):
result += a*keisu
else:
k = [2]*(N//2-1)
k += [1]
k += [1]
a = [-2]*(N//2)
... |
s719191845 | p03827 | u016881126 | 2,000 | 262,144 | Wrong Answer | 26 | 9,144 | 241 | 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... | import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)
INF = float('inf')
N = int(input())
S = input()
ans = S.count("I") - S.count("D")
print(ans) | s064609375 | Accepted | 28 | 8,968 | 312 | import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)
INF = float('inf')
N = int(input())
S = input()
ans = 0
x = 0
for s in S:
if s == "I":
x += 1
else:
x -= 1
ans = max(ans, x)
print(ans) |
s667808684 | p03998 | u548303713 | 2,000 | 262,144 | Wrong Answer | 19 | 3,188 | 927 | 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=list(input())
b=list(input())
c=list(input())
a_num,b_num,c_num=len(a),len(b),len(c)
now="A"
ans="A"
flag=True
def delete(now):
global a_num
global b_num
global c_num
global ans
global flag
if now=="A":
change(a[0])
del a[0]
a_num-=1
if a_num==0:
... | s416592028 | Accepted | 20 | 3,064 | 1,106 |
a=list(input())
b=list(input())
c=list(input())
a_num,b_num,c_num=len(a),len(b),len(c)
now="A"
ans="A"
flag=True
def delete(now):
global a_num
global b_num
global c_num
global ans
global flag
if now=="A":
if a_num==0:
ans="A"
flag=False
return
... |
s332708147 | p02694 | u608007704 | 2,000 | 1,048,576 | Time Limit Exceeded | 2,205 | 9,136 | 99 | Takahashi has a deposit of 100 yen (the currency of Japan) in AtCoder Bank. The bank pays an annual interest rate of 1 % compounded annually. (A fraction of less than one yen is discarded.) Assuming that nothing other than the interest affects Takahashi's balance, in how many years does the balance reach X yen or abo... | N=int(input())
v=100
count=0
while True:
if N<v:
break
count+=1
v*1.01//1
print(count) | s159444167 | Accepted | 23 | 9,168 | 108 |
N=int(input())
v=100
count=0
while True:
if N<=v:
break
count+=1
v*=1.01
v=int(v)
print(count) |
s665858880 | p03545 | u743164083 | 2,000 | 262,144 | Wrong Answer | 17 | 3,064 | 256 | 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... | n = list(input())
ni = map(int,n)
ns = sorted(ni, reverse=True)
ans = 0
op = []
for i in ns:
ans += i
if ans > 7:
ans -= i
op += "-"
else:
op += "+"
print("%d%s%d%s%d%s%d=7" % (ns[0],op[0],ns[1],op[1],ns[2],op[2],ns[3])) | s682038479 | Accepted | 29 | 9,124 | 277 | n = input()
for x in range(1 << 3):
opr = ["-"] * 3
for i in range(3):
if x & (1 << i):
opr[i] = "+"
shiki = "%s%s%s%s%s%s%s" % (n[0], opr[0], n[1], opr[1], n[2], opr[2], n[3])
if eval(shiki) == 7:
print("%s=7" % shiki)
break |
s607826044 | p03455 | u503901534 | 2,000 | 262,144 | Wrong Answer | 17 | 2,940 | 114 | AtCoDeer the deer found two positive integers, a and b. Determine whether the product of a and b is even or odd. | p = list(map(int,input().split()))
if (p[0] or p[1]) % 2 == 0:
print('Even')
else:
print('Odd')
| s074725453 | Accepted | 17 | 2,940 | 103 | p = list(map(int,input().split()))
if (p[0] * p[1]) % 2 == 0:
print('Even')
else:
print('Odd') |
s382797534 | p03854 | u901447859 | 2,000 | 262,144 | Wrong Answer | 2,111 | 3,188 | 253 | You are given a string S consisting of lowercase English letters. Another string T is initially empty. Determine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times: * Append one of the following at the end of T: `dream`, `dreamer`, `erase` and `eraser`. | s = input()
cpos = 0
while True:
for b in ['dream', 'dreamer', 'erase', 'eraser']:
pos = s.find(b)
if pos == cpos:
cpos += len(b)
break
if cpos == len(s)-1:
print('YES')
break
elif pos == -1:
print('NO')
break
| s789269874 | Accepted | 19 | 3,188 | 124 | s = input().replace('eraser',"").replace('erase',"").replace('dreamer',"").replace('dream',"")
print(['YES','NO'][0<len(s)]) |
s280784710 | p02850 | u417365712 | 2,000 | 1,048,576 | Wrong Answer | 2,105 | 24,800 | 691 | Given is a tree G with N vertices. The vertices are numbered 1 through N, and the i-th edge connects Vertex a_i and Vertex b_i. Consider painting the edges in G with some number of colors. We want to paint them so that, for each vertex, the colors of the edges incident to that vertex are all different. Among the colo... | import sys
from collections import defaultdict
inputs = sys.stdin.readlines()
n = int(inputs[0])
nodes = [tuple(map(int, x.split())) for x in inputs[1:]]
tree = defaultdict(tuple)
for i in range(1, n+1):
tree[i] = tuple(n[1] for n in nodes if n[0] == i)
colors = list(range(1, max([len(x) for x in tree.values()])+2... | s920196390 | Accepted | 342 | 36,048 | 514 | import sys
from collections import deque
inputs = sys.stdin.readlines()
n = int(inputs[0])
edges = [tuple(map(int, x.split())) for x in inputs[1:]]
to_edges = [e[1] for e in edges]
tree = [[] for _ in range(n + 1)]
for x, y in edges:
tree[x].append(y)
queue = deque([1])
colors = [0] * (n + 1)
while queue:
x... |
s417997671 | p02400 | u613534067 | 1,000 | 131,072 | Wrong Answer | 20 | 5,612 | 73 | Write a program which calculates the area and circumference of a circle for given radius r. | import math
r = float(input())
print(2.0 * math.pi * r, math.pi * r * r)
| s232453269 | Accepted | 20 | 5,620 | 99 | import math
r = float(input())
print("{0:.6f} {1:.6f}".format(math.pi * r * r, 2.0 * math.pi * r))
|
s968603758 | p03487 | u970449052 | 2,000 | 262,144 | Wrong Answer | 102 | 14,268 | 273 | You are given a sequence of positive integers of length N, a = (a_1, a_2, ..., a_N). Your objective is to remove some of the elements in a so that a will be a **good sequence**. Here, an sequence b is a **good sequence** when the following condition holds true: * For each element x in b, the value x occurs exactly ... | n=int(input())
al=list(map(int,input().split()))
al.sort()
ans=0
t=0
cnt=0
for i in range(n):
if al[i]!=t:
ans+=cnt-t if cnt>t else cnt
t=al[i]
cnt=0
else:
cnt+=1
else:
if al[i]!=t:
ans+=cnt-t if cnt>t else cnt
print(ans) | s756595614 | Accepted | 107 | 14,692 | 254 | n=int(input())
al=list(map(int,input().split()))
al.sort()
ans=0
t=0
cnt=0
for i in range(n):
if al[i]!=t:
ans+=cnt-t if cnt>=t else cnt
t=al[i]
cnt=1
else:
cnt+=1
else:
ans+=cnt-t if cnt>=t else cnt
print(ans) |
s733717794 | p03162 | u901598613 | 2,000 | 1,048,576 | Wrong Answer | 2,319 | 127,900 | 308 | Taro's summer vacation starts tomorrow, and he has decided to make plans for it now. The vacation consists of N days. For each i (1 \leq i \leq N), Taro will choose one of the following activities and do it on the i-th day: * A: Swim in the sea. Gain a_i points of happiness. * B: Catch bugs in the mountains. Gain... | n=int(input())
l=[list(map(int,input().split())) for i in range(n)]
dp=[[0,0,0] for _ in range(n)]
dp[0]=l[0]
for i in range(1,n):
dp[i][0]=l[i][0]+max(dp[i-1][1],dp[i-1][2])
dp[i][1]=l[i][1]+max(dp[i-1][0],dp[i-1][2])
dp[i][2]=l[i][2]+max(dp[i-1][0],dp[i-1][1])
print(dp)
print(max(dp[-1])) | s913472462 | Accepted | 390 | 49,960 | 296 | n=int(input())
l=[list(map(int,input().split())) for i in range(n)]
dp=[[0,0,0] for _ in range(n)]
dp[0]=l[0]
for i in range(1,n):
dp[i][0]=l[i][0]+max(dp[i-1][1],dp[i-1][2])
dp[i][1]=l[i][1]+max(dp[i-1][0],dp[i-1][2])
dp[i][2]=l[i][2]+max(dp[i-1][0],dp[i-1][1])
print(max(dp[-1]))
|
s431996527 | p02831 | u483230733 | 2,000 | 1,048,576 | Wrong Answer | 2,108 | 27,224 | 253 | Takahashi is organizing a party. At the party, each guest will receive one or more snack pieces. Takahashi predicts that the number of guests at this party will be A or B. Find the minimum number of pieces that can be evenly distributed to the guests in both of the cases predicted. We assume that a piece cannot be ... | a, b = map(int, input().split())
count = 1
an = []
bn = []
eee = min(a,b)
for ii in range(1, eee+2):
bbb = b * ii
bn.append(bbb)
while True:
aaa = a * count
print(aaa)
if aaa in bn:
print(aaa)
break
count += 1 | s835242123 | Accepted | 43 | 2,940 | 147 | a, b = map(int, input().split())
count = 1
while True:
aaa = a * count
if aaa % b == 0:
print(aaa)
break
count += 1 |
s478962280 | p02608 | u092061507 | 2,000 | 1,048,576 | Wrong Answer | 850 | 9,436 | 258 | Let f(n) be the number of triples of integers (x,y,z) that satisfy both of the following conditions: * 1 \leq x,y,z * x^2 + y^2 + z^2 + xy + yz + zx = n Given an integer N, find each of f(1),f(2),f(3),\ldots,f(N). | N = int(input())
ret = [0 for i in range(N)]
for x in range(1,100):
for y in range(1,100):
for z in range(1,100):
a = x**2 + y**2 + z**2 + x*y + y*z + z*x
if a < N:
ret[a] += 1
for i in ret:
print(i)
| s383919477 | Accepted | 857 | 9,200 | 269 | N = int(input())
#N = 20
ret = [0 for i in range(N)]
for x in range(1,100):
for y in range(1,100):
for z in range(1,100):
a = x**2 + y**2 + z**2 + x*y + y*z + z*x
if a <= N:
ret[a-1] += 1
for i in ret:
print(i)
|
s912044622 | p00016 | u150984829 | 1,000 | 131,072 | Wrong Answer | 20 | 5,768 | 149 | When a boy was cleaning up after his grand father passing, he found an old paper: In addition, other side of the paper says that "go ahead a number of steps equivalent to the first integer, and turn clockwise by degrees equivalent to the second integer". His grand mother says that Sanbonmatsu was standing at t... | import cmath,math,sys
z=0;p=90
for e in sys.stdin:
r,d=map(int,e.split(','))
z+=cmath.rect(r,math.radians(p))
p-=d
print(int(z.real),int(z.imag))
| s767857086 | Accepted | 20 | 5,772 | 161 | import cmath,math,sys
z=0;p=90
for e in sys.stdin:
r,d=map(int,e.split(','))
z+=cmath.rect(r,math.radians(p))
p-=d
print(int(z.real),'\n',int(z.imag),sep='')
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.