s_id stringlengths 10 10 | p_id stringlengths 6 6 | u_id stringlengths 10 10 | date stringlengths 10 10 | language stringclasses 1
value | original_language stringclasses 11
values | filename_ext stringclasses 1
value | status stringclasses 1
value | cpu_time stringlengths 1 5 | memory stringlengths 1 7 | code_size stringlengths 1 6 | code stringlengths 1 539k |
|---|---|---|---|---|---|---|---|---|---|---|---|
s023595713 | p03549 | u329407311 | 1590540357 | Python | Python (3.4.3) | py | Runtime Error | 339 | 3060 | 198 | import math
N,M = map(int,input().split())
T = M * 1900 + (N-M) * 100
p = (1/2)**M
p2 = (1/2)**M
ans = 0
for i in range(1,500000):
ans += T * p2 * i
p2 = p2 * (1-p)
print(math.round(ans))
|
s007424536 | p03549 | u056358163 | 1590109494 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 63 | n,m=map(int,input().split())
s=m*1900+(n-m)*100
print(sec*2**m) |
s138565862 | p03549 | u686036872 | 1586487406 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 158 | N, M = int(input().split())
ans = 0
for i in range(1, 100000):
p = ((1/2)**M)*(1-(1/2)**M)**(i-1)
ans += (100*(N-M) + 1900*M)*i*p
print(round(ans)) |
s844246031 | p03549 | u686036872 | 1586487278 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 159 | N, M = int(input().split())
ans = 0
for i in range(1, 1000000):
p = ((1/2)**M)*(1-(1/2)**M)**(i-1)
ans += (100*(N-M) + 1900*M)*i*p
print(round(ans)) |
s970360429 | p03549 | u686036872 | 1586486863 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 157 | N, M = int(input().split())
ans = 0
for i in range(1, 1000000):
p = ((1/2)**M)*(1-(1/2)**M)**(i-1)
ans += (100*(N-M) + 1900*M)*i*p
print(int(ans)) |
s039307527 | p03549 | u714378447 | 1581627158 | Python | Python (3.4.3) | py | Runtime Error | 20 | 3064 | 239 | from sys import exit
N = int(input())
A = [int(x) for x in input().split()]
m1 = 0
m2 = 0
m4 = 0
for a in A:
if a%4==0:
m4 += 1
elif a%2==0:
m2 += 1
else:
m1 += 1
m1 = m1 + (m2>0)
if m4>=m1-1:
print('Yes')
else:
print('No') |
s272261662 | p03549 | u896741788 | 1575650171 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 53 | n,m=map(int,input().split())
print(2**m*(100n+1800m)) |
s994535892 | p03549 | u797994565 | 1573972780 | Python | PyPy3 (2.4.0) | py | Runtime Error | 162 | 38256 | 62 | N,M = map(int,input().split())
print((1900*M+100*(N-m))*2**M)
|
s682190875 | p03549 | u527261492 | 1570499878 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 57 | n,m=map(int,input().split())
print((1800*m+100*n)*2(**m)) |
s122871607 | p03549 | u814986259 | 1568912069 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3060 | 68 | N,M=map(input().split())
ans=(M*1900 +(N-M)*100)*(2**M)
print(ans) |
s025669245 | p03549 | u798316285 | 1568139264 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 47 | n,m=map(int,input())
print((100*n+1800*m)*2**m) |
s658731425 | p03549 | u231936499 | 1567883347 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 57 | N,M=map(int,input())
ans=(1900M+100(N-M))*2^M
print(ans) |
s494097058 | p03549 | u231936499 | 1567883274 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 55 | N,M=map(int,input())
ans=1900M+100(N-M)*2^M
print(ans) |
s218030547 | p03549 | u231936499 | 1567883212 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 44 | N,M=map(int,input())
ans=1900M+100(N-M)*2^M |
s653920505 | p03549 | u252828980 | 1565474669 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 55 | a , b = map(int,input())
print((1900*b+(a-b)*100)*2**b) |
s473440179 | p03549 | u736729525 | 1564848814 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 77 | N, M = [int(x) for x in input().split()]
print(M * 1900+(N-M)*100)*(2**M)
|
s032304810 | p03549 | u736729525 | 1564848758 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 125 | N, M = [int(x) for x in input().split()]
if N == M:
print((1900*M)/(2**N))
else:
print(M * 1900+(N-M)*100)*(2**M)
|
s338559869 | p03549 | u845620905 | 1561848860 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 66 | n, m = map(int, input().split())
print(1900*m + 100(n - m) * 2**m) |
s491331019 | p03549 | u463655976 | 1560023106 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 743 | N, M = map(int, input().split())
B = [list(map(int, input().split())) for _ in range(M)][::-1]
S = []
pt = []
G = [-1] * (N+1)
idx = 0
cnt = 0
for pair in B:
d = []
for i, x in enumerate(pair):
if G[x] >= 0:
d.append(G[x])
if len(d) <= 0:
pt.append(1)
for x in pair:
... |
s664246048 | p03549 | u921199520 | 1556234191 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 130 | a = input().split()
b = input().split()
if a[0] == b[2] and a[1]==b[1] and a[2] == b[0]):
print("YES")
else :
print("NO")
|
s709730820 | p03549 | u771532493 | 1554653204 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 74 | import math
a,b,c=map(int,input(),split())
a-=c
print(math.floor(a/(b+c))) |
s293330435 | p03549 | u844646164 | 1554250940 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 138 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
cout << (1900*m + 100 * (n-m)) * pow(2, m);
} |
s697452786 | p03549 | u676496404 | 1552957165 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 72 | n,m = map(int,input().split(''))
res = (1900*m+100(n-m))*2**m
print(res) |
s193655526 | p03549 | u676496404 | 1552956503 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 61 | n,m = map(int,input().split())
print((1900*m+100(n-m))*2**m)
|
s170991649 | p03549 | u905715926 | 1552880066 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 57 | a,b = map(int,input().split())
print(100*b+pow(2,m)*1900) |
s615258836 | p03549 | u807772568 | 1552172906 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 64 | n,m = map(int,input().split())
print((1990*m + 100(n-m))*2**m ) |
s009772756 | p03549 | u845333844 | 1551638246 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 53 | n,m=map(int,input().split())
print(1800*m+100*n)*2**m |
s580689595 | p03549 | u740284863 | 1551548595 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 106 | import sys
input = sys.stdin.readline
n,m = map(int, input().split())
print((1900*m + 100*(n − m))*2**m) |
s235155897 | p03549 | u740284863 | 1551548552 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 105 | import sys
input = sys.stdin.readline
n,m = map(int, input().split())
print((1900*m + 100(N − M))*2**m) |
s994213682 | p03549 | u663101675 | 1535491111 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3064 | 365 | import bisect
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
A = A.sort()
B = B.sort()
C = C.sort()
Sum = 0
for i in range(N):
Start_B = bisect.bisect_left(B,A[i]+1)
for j in range(Start_B, N):
Start_C = bisect.bisect_left(C,B... |
s529074297 | p03549 | u359856428 | 1535035790 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 110 | n = int(input())
i = 1;
while(True):
if((i ** 2 + i) // 2 >= n):
print(i)
break
i += 1 |
s003720531 | p03549 | u698479721 | 1529118775 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 82 | N,M = map(int, input().split())
ans = (1900*M + 100*(N − M)) * (2**M)
print(ans) |
s780047963 | p03549 | u698479721 | 1529118733 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 83 | N,M = map(int, input().split())
ans = (1900*M + 100*(N − M)) × (2**M)
print(ans) |
s553490955 | p03549 | u335295553 | 1528418393 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 63 | N, M = map(int,input().split())
print((1900*M + 100(N-M))*2**M) |
s912082851 | p03549 | u335295553 | 1528418355 | Python | PyPy3 (2.4.0) | py | Runtime Error | 184 | 39536 | 63 | N, M = map(int,input().split())
print((1900*M + 100(N-M))*2**M) |
s803657897 | p03549 | u591295155 | 1525292987 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 61 | N,M=map(int,input().split())
print((1900*M+100*(N-M))*(2**M)
|
s909172521 | p03549 | u591295155 | 1525292884 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 59 | N,K=map(int,input().split())
print((1900*M+100*(N-M))*2**M) |
s708469297 | p03549 | u989559177 | 1522540743 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 3 | k |
s922698245 | p03549 | u632369368 | 1521674492 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 68 | N, M = map(int, input())
x = (1900 * M + 100 * (N - M)) / (2 ** M)
|
s254055570 | p03549 | u632369368 | 1521674087 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 66 | N, M = map(int, input())
x = (1900 * M + 100 * (N - M)) / 2 ** M
|
s739880951 | p03549 | u550574002 | 1514527421 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 52 | n,m=map(int,input().split())
print(2**m*(18m+n)*100) |
s787899439 | p03549 | u499259667 | 1514071640 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 67 | N ,M=map(float,input().split())
print(int((1900*M+100*(N-M)*2**M))
|
s392123304 | p03549 | u019584841 | 1511407997 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 70 | N,M=input().split()
ans=((N-M)*100+M*1900)*pow(2,M)
print(str(ans))
|
s724776499 | p03549 | u319612498 | 1510453501 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 10 | asdfghjkl; |
s435848237 | p03550 | u023229441 | 1597240342 | Python | Python (3.8.2) | py | Runtime Error | 26 | 9272 | 108 | n,z,w=map(int,input().split())
A=list(map(int,input().split()))
print(max( abs(A[-1]-w),abs(A[-2]-A[-1]) )) |
s470322207 | p03550 | u869790980 | 1596778528 | Python | PyPy2 (7.3.0) | py | Runtime Error | 376 | 84524 | 203 | n,z,w = map(int, raw_input().split() ) #3 100 1000
ais = = map(int, raw_input().split()) #10 100 100
m = abs(z - w)
for u,v in zip(ais, ais[1:]):
m = max(m, (u - v))
m = max(m, abs(ais[-1] - w))
print m |
s746639089 | p03550 | u617515020 | 1595612541 | Python | Python (3.8.2) | py | Runtime Error | 31 | 9312 | 129 | N,Z,W=map(int,input().split())
a=list(map(int,input().split()))
print(abs(W-a[0])if n==1 else max(abs(W-a[-1]),abs(a[-1]-a[-2]))) |
s992964931 | p03550 | u617515020 | 1595612469 | Python | Python (3.8.2) | py | Runtime Error | 28 | 9312 | 129 | N,Z,W=map(int,input().split())
a=list(map(int,input().split()))
print(abs(w-a[0])if n==1 else max(abs(w-a[-1]),abs(a[-1]-a[-2]))) |
s412600833 | p03550 | u107639613 | 1595606615 | Python | PyPy3 (7.3.0) | py | Runtime Error | 351 | 81460 | 1498 | import sys
def input(): return sys.stdin.readline().strip()
def main():
N, Z, W = map(int, input().split())
A = list(map(int, input().split()))
"""
O(N^2)dpでも行けるそうです。以下写経:
https://atcoder.jp/contests/abc078/submissions/14886969
dp[turn][top]の2引数だけでいいのか、[x][y]の2引数も必要ではないかと思うが、
考えてみれば
... |
s218906183 | p03550 | u107639613 | 1595606031 | Python | Python (3.8.2) | py | Runtime Error | 2206 | 10728 | 1149 | import sys
from functools import lru_cache
def input(): return sys.stdin.readline().strip()
def main():
N, Z, W = map(int, input().split())
A = list(map(int, input().split()))
"""
O(N^2)dpでも行けるそうです。以下写経:
https://atcoder.jp/contests/abc078/submissions/14886969
dpテーブルが訳分からなくなったら@lru_cache使うのが楽。
... |
s637295869 | p03550 | u107639613 | 1595606019 | Python | Python (3.8.2) | py | Runtime Error | 619 | 13680 | 1148 | import sys
from functools import lru_cache
def input(): return sys.stdin.readline().strip()
def main():
N, Z, W = map(int, input().split())
A = list(map(int, input().split()))
"""
O(N^2)dpでも行けるそうです。以下写経:
https://atcoder.jp/contests/abc078/submissions/14886969
dpテーブルが訳分からなくなったら@lru_cache使うのが楽。
... |
s463819230 | p03550 | u107639613 | 1595605311 | Python | Python (3.8.2) | py | Runtime Error | 618 | 13560 | 1149 | import sys
from functools import lru_cache
def input(): return sys.stdin.readline().strip()
def main():
N, Z, W = map(int, input().split())
A = list(map(int, input().split()))
"""
O(N^2)dpでも行けるそうです。以下写経:
https://atcoder.jp/contests/abc078/submissions/14886969
dpテーブルが訳分からなくなったら@lru_cache使うのが楽。
... |
s172125814 | p03550 | u107639613 | 1595604706 | Python | PyPy3 (7.3.0) | py | Runtime Error | 2208 | 111228 | 1149 | import sys
from functools import lru_cache
def input(): return sys.stdin.readline().strip()
def main():
N, Z, W = map(int, input().split())
A = list(map(int, input().split()))
"""
O(N^2)dpでも行けるそうです。以下写経:
https://atcoder.jp/contests/abc078/submissions/14886969
dpテーブルが訳分からなくなったら@lru_cache使うのが楽。
... |
s143995975 | p03550 | u046158516 | 1592396084 | Python | PyPy3 (2.4.0) | py | Runtime Error | 181 | 38768 | 105 | n,z,w=map(int,input().split())
a=list(map(int,input().split()))
print(max(abs(a[-1]-w),abs(a[-2]-a[-1]))) |
s319721201 | p03550 | u588794534 | 1591151945 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 148 | n,z,w=map(int,input().split())
card=list(map(int,input.split()))
if n==1:
print(abs(card[0]-w))
else:
print(max(abs(n[-2]-n[-1]),abs(n[-1]-w))) |
s060937316 | p03550 | u093041722 | 1590625191 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3188 | 119 | N,Z,W = (int(x) for x in input().split())
a = list(map(int, input().split()))
print(max(abs(a[-1]-W),abs(a[-1]-a[-2]))) |
s368583725 | p03550 | u726872801 | 1590103059 | Python | Python (3.4.3) | py | Runtime Error | 24 | 3808 | 362 | import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy
N, Z, W = map(int, input().split())
A = list(map(int, input().split()))
... |
s158401751 | p03550 | u493130708 | 1589864754 | Python | PyPy3 (2.4.0) | py | Runtime Error | 170 | 38640 | 2780 | # -*- coding: utf-8 -*-
#############
# Libraries #
#############
import sys
input = sys.stdin.readline
import math
import bisect
from collections import defaultdict
from collections import deque
from functools import lru_cache
#############
# Constants #
#############
MOD = 10**9+7
INF = float('inf')
##########... |
s500465702 | p03550 | u493130708 | 1589864707 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3192 | 2800 | # -*- coding: utf-8 -*-
#############
# Libraries #
#############
import sys
input = sys.stdin.readline
import math
from math import gcd
import bisect
from collections import defaultdict
from collections import deque
from functools import lru_cache
#############
# Constants #
#############
MOD = 10**9+7
INF = flo... |
s017712709 | p03550 | u020604402 | 1589652256 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3188 | 142 | N, Z, W = map(int,input().split())
A = list(map(int,input().split()))
idea = abs(A[-1] - W)
idea2 = abs(A[-2] - A[-1])
print(max(idea,idea2))
|
s710369259 | p03550 | u198062737 | 1589399178 | Python | PyPy3 (2.4.0) | py | Runtime Error | 2111 | 66784 | 617 | N, Z, W = map(int, input().split(' '))
a = list(map(int, input().split(' ')))
dp = [{} for _ in range(N)]
def search(i, X, Y, turn):
if i == N:
return abs(X - Y)
if (X, Y, turn) in dp[i]:
return dp[i][(X, Y, turn)]
if turn == 1:
ans = 0
for j in range(i, N):
ans... |
s327338131 | p03550 | u980783809 | 1589038794 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 15936 | 1090 | dic = {}
def getX(x, y, cards, idx):
if len(cards)==1:
return abs(cards[0]-y)
lgst = 0
tmpcards = cards.copy()
for ex, i in enumerate(cards):
if(ex==len(cards)-1):
return max(abs(i-y),lgst)
tmpcards.remove(i)
idx += 1
#if (i,y,idx) in dic:
... |
s355110546 | p03550 | u980783809 | 1589038579 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 16684 | 1090 | dic = {}
def getX(x, y, cards, idx):
if len(cards)==1:
return abs(cards[0]-y)
lgst = 0
tmpcards = cards.copy()
for ex, i in enumerate(cards):
if(ex==len(cards)-1):
return max(abs(i-y),lgst)
tmpcards.remove(i)
idx += 1
if (i,y,idx) in dic:
... |
s989417710 | p03550 | u980783809 | 1589038435 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 16684 | 1090 | dic = {}
def getX(x, y, cards, idx):
if len(cards)==1:
return abs(cards[0]-y)
lgst = 0
tmpcards = cards.copy()
for ex, i in enumerate(cards):
if(ex==len(cards)-1):
return max(abs(i-y),lgst)
tmpcards.remove(i)
idx += 1
if (i,y,idx) in dic:
... |
s900516811 | p03550 | u566529875 | 1588822841 | Python | PyPy3 (2.4.0) | py | Runtime Error | 167 | 38512 | 148 | n,z,w=map(int,input().split())
a=list(map(int,input().split()))
if n = 1:
print(abs(a[0]-w))
else:
print(max(abs(a[-1]-w),abs(a[-1]-a[-2]))) |
s125535442 | p03550 | u683134447 | 1588715440 | Python | PyPy3 (2.4.0) | py | Runtime Error | 189 | 38640 | 189 | n,z,w = map(int,input().split())
al = list(map(int,input().split()))
if len(al) == 1:
print(abs(al[-1] - w))
ans1 = abs(al[-1] - al[-2])
ans2 = abs(al[-1] - w)
print(max(ans1, ans2))
|
s228672584 | p03550 | u683134447 | 1588715387 | Python | PyPy3 (2.4.0) | py | Runtime Error | 186 | 38640 | 146 | n,z,w = map(int,input().split())
al = list(map(int,input().split()))
ans1 = abs(al[-1] - al[-2])
ans2 = abs(al[-1] - w)
print(max(ans1, ans2))
|
s906073014 | p03550 | u007550226 | 1587770353 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 4016 | 292 | n,_,y= map(int,input().split())
a= [-1] + list(map(int,input().split()))
def gs(s,ik,at):
if ik==n: return abs(a[n]-at)
else:
if s=='x': return max(gs('x',ik+1,at),gs('y',ik+1,a[ik]))
elif s=='y':return min(gs('y',ik+1,at),gs('x',ik+1,a[ik]))
print(gs('x',1,y)) |
s371935147 | p03550 | u287500079 | 1586261334 | Python | PyPy3 (2.4.0) | py | Runtime Error | 190 | 38384 | 1646 | import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin, log, log10, gcd
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string ... |
s645228936 | p03550 | u863442865 | 1585348344 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3572 | 690 | #どっちで出すか注意, rstrip注意
#提出前に見返すこと!
def main():
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
#from collections import defaultdict
from itertools import combinations, permutations, accumulate
#from itertools import product
from bis... |
s564126452 | p03550 | u021548497 | 1583613837 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3188 | 579 | n, z, w = map(int, input().split())
a = [int(x) for x in input().split()]
turn = True
flag = False
p= max(a)
for i in range(n-1):
if turn:
if a[i] <= a[i+1]:
continue
elif a[i] < z and a[i] != p:
continue
else:
z = a[i]
turn = False
if a[i] < z and a[i] == p:
q = min... |
s975739124 | p03550 | u021548497 | 1583613754 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3188 | 566 | n, z, w = map(int, input().split())
a = [int(x) for x in input().split()]
turn = True
p= max(a)
for i in range(n-1):
if turn:
if a[i] <= a[i+1]:
continue
elif a[i] < z and a[i] != p:
continue
else:
z = a[i]
turn = False
if a[i] < z and a[i] == p:
q = min(a[i+1:])
e... |
s330419570 | p03550 | u021548497 | 1583611385 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3188 | 566 | n, z, w = map(int, input().split())
a = [int(x) for x in input().split()]
turn = True
p= max(a)
for i in range(n-1):
if turn:
if a[i] <= a[i+1]:
continue
elif a[i] < z and a[i] != p:
continue
else:
z = a[i]
turn = False
if a[i] < z and a[i] == p:
q = min(a[i+1:])
e... |
s956972232 | p03550 | u021548497 | 1583610552 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 146 | n, z, w = map(int, input().split)
a = [int(x) for x in input().split()]
p = max(a)
q = min(a)
if z < p:
z = p
if w > q:
w = q
print(abs(p-q)) |
s417683647 | p03550 | u298297089 | 1581404880 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 130 | n,z,w= map(int, input().split())
a = list(map(int, input().split())
print(max(abs(a[-1] - w), abs(a[-2] - a[-1]) if n > 1 else 0)) |
s650704222 | p03550 | u735069283 | 1575690669 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3188 | 160 | N,Z,W=map(int,input().split())
A=[int(x) for x in input().split()]
if N==1:
answer=abs(A[1]-W)
else:
answer=max(abs(W-A[-1]),abs(A[-1]-A[-2]))
print(answer) |
s929634171 | p03550 | u735069283 | 1575690576 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3188 | 122 | N,Z,W=map(int,input().split())
A=[int(x) for x in input().split()]
answer=max(abs(W-A[-1]),abs(A[-1]-A[-2]))
print(answer) |
s896387401 | p03550 | u583276018 | 1575671588 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 120 | n, z, w = map(int, input().split())
a = list(map(int, input().split()))
print(max(abs(a[n-1] - w), abs(a[n-2] - a[n-1]) |
s532623159 | p03550 | u672220554 | 1573593420 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3188 | 115 | n,Z,W=map(int,input().split())
a=list(map(int,input().split()))
res = max(abs(a[-1]-W),abs(a[-1]-a[-2]))
print(res) |
s271319920 | p03550 | u595893956 | 1571788745 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 97 | n,z,w=map(int,input().split())
a[] = map(int,input().split())
print(max(abs(a[-1]-w,a[-1]-a[-2])) |
s174835862 | p03550 | u644907318 | 1570886742 | Python | Python (3.4.3) | py | Runtime Error | 77 | 4176 | 564 | memof = {}
def f(x,y,i):
if i==N-1:
return abs(A[N-1]-y)
if (x,y,i) in memof:
return memo[(x,y,i)]
b = abs(A[N-1]-y)
for j in range(i,N-1):
b = max(b,g(A[j],y,j+1))
memof[(x,y,i)]=b
return b
memog = {}
def g(x,y,i):
if i==N-1:
return abs(x-A[N-1])
if (x,y,... |
s591433509 | p03550 | u644907318 | 1570886173 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 4160 | 389 | def f(x,y,i):
if i==N-1:
return abs(A[N-1]-y)
b = abs(A[N-1]-y)
for j in range(i,N-1):
b = max(b,g(A[j],y,j+1))
return b
def g(x,y,i):
if i==N-1:
return abs(x-A[N-1])
b = abs(x-A[N-1])
for j in range(i,N-1):
b = min(b,f(x,A[j],j+1))
return b
N,Z,W = map(in... |
s239920412 | p03550 | u186838327 | 1568810988 | Python | PyPy3 (2.4.0) | py | Runtime Error | 242 | 41072 | 1055 | n, z, w = map(int, input().split())
l = list(map(int, input().split()))
def trial(n, z, w, t):
# n: 残りの枚数
# z: Xの手持ち
# w: Yの手持ち
# t: これまでに引いた枚数
min_score = [0]*n
min_j = [0]*n
for i in range(t,t+n):
if i == t+n-1:
min_score[n-1] = abs(l[t+n-1]-w)
break
temp = l[i]
temp_min = 10**... |
s598732181 | p03550 | u186838327 | 1568810833 | Python | PyPy3 (2.4.0) | py | Runtime Error | 240 | 41968 | 1052 | n, z, w = map(int, input().split())
l = list(map(int, input().split()))
def trial(n, z, w, t):
# n: 残りの枚数
# z: Xの手持ち
# w: Yの手持ち
# t: これまでに引いた枚数
min_score = [0]*n
min_j = [0]*n
for i in range(t,t+n):
if i == t+n-1:
min_score[n-1] = abs(l[t+n-1]-w)
break
temp = l[i]
temp_min = 10**... |
s345810430 | p03550 | u950708010 | 1568146355 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3188 | 330 | import sys
input = sys.stdin.readline
def solve():
n,z,w = (int(i) for i in input().split())
a = list(int(i) for i in input().split())
if n == 1:
ans = abs(w-a[0])
else:
ans = 0
#最小化する方向に動く
tmp = abs([n-2]-a[n-1])
tmp2 = abs(a[n-1]-w)
ans = max(tmp,tmp2)
print(ans)
solve()
|
s177158010 | p03550 | u981931040 | 1568044925 | Python | Python (3.4.3) | py | Runtime Error | 196 | 4652 | 1249 | from pprint import pprint
'''
## O(1)のパターン
N , Z , W = map(int , input().split())
a = list(map(int , input().split()))
print(max(abs(a[N - 2] - a[N - 1]), abs(a[N - 1] - W)))
'''
## DPを使って解くとき
N , Z , W = map(int , input().split())
a = list(map(int , input().split()))
a.reverse()
a += [W]
#print(a)
memo = [[-1]* (N +... |
s532588612 | p03550 | u844789719 | 1567796010 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3188 | 579 | N, Z, W = [int(_) for _ in input().split()]
A = [int(_) for _ in input().split()]
#[abs(a-A[-1]) for a in A[i:-1]]が広義単調増加になるような最小のiを選ぶと、
#Xさんは最初にA[i]までとるのが最善策の候補
#このときYさんは最後までとるのが最善
#ただしabs(A[i]-A[-1])がWより小さいならXさんは最初に全部とってしまうのが最善
ans = 0
b = A[-1]
j = N - 2
for i in range(N - 3, -1, -1):
if abs(A[i] - b) <= abs(A[i... |
s756641847 | p03550 | u952022797 | 1564174359 | Python | PyPy3 (2.4.0) | py | Runtime Error | 181 | 38768 | 957 | # -*- coding: utf-8 -*-
import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import math
# NO, PAY-PAY
#import numpy as np
#import statistics
#from statistics import mean, median,variance,stdev
... |
s798098041 | p03550 | u263830634 | 1563652187 | Python | Python (3.4.3) | py | Runtime Error | 1748 | 4980 | 1529 | import sys
sys.setrecursionlimit(2000)
N, Z, W = map(int, input().split())
a = list(map(int, input().split()))
a.reverse()
a += [W] #最後にYさんの手札を加えておく
dp_T = [-1] * (N + 1) #Xの手番
dp_F = [-1] * (N + 1) #Yの手番
def calc(n, flag): #n: 残りの山の枚数 flag: ターンの管理
#既に計算済みの場合その値を返す
if flag == True and dp_T[n] != -1:
r... |
s276770225 | p03550 | u532966492 | 1562776202 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3188 | 562 | n=int(input())
p=[list(map(int,input().split())) for _ in [0]*(n-1)]
g=[[] for _ in [0]*n]
[g[a-1].append(b-1) for a,b in p]
[g[b-1].append(a-1) for a,b in p]
memo=[False for _ in [0]*n]
q=[0]
memo[0]=True
last=0
while(q):
qq=[]
for i in q:
for j in g[i]:
if memo[j]==False:
memo[j]=True
last=j
qq.a... |
s689525281 | p03550 | u895515293 | 1559716479 | Python | PyPy3 (2.4.0) | py | Runtime Error | 208 | 41328 | 1746 | N,Z,W=map(int, input().split())
INL = list(map(int,input().split()))
INVL = {v:i for i, v in enumerate(INL)}
class BitMAX:
def __init__(self, n):
self.size = n
self.tree = [0] * (n + 1)
def sum(self, i):
s = 0
while i > 0:
s = max(self.tree[i],s)
i -= i... |
s336139536 | p03550 | u166306121 | 1559584031 | Python | Python (3.4.3) | py | Runtime Error | 36 | 5076 | 1623 | import sys
# gcd
from fractions import gcd
# 切り上げ,切り捨て
# from math import ceil, floor
# リストの真のコピー(変更が伝播しない)
# from copy import deepcopy
# 累積和。list(accumulate(A))としてAの累積和
from itertools import accumulate
# l = ['a', 'b', 'b', 'c', 'b', 'a', 'c', 'c', 'b', 'c', 'b', 'a']
# S = Counter(l) # カウンタークラスが作られる。S=Counter({'b': ... |
s058069564 | p03550 | u788137651 | 1559580394 | Python | PyPy3 (2.4.0) | py | Runtime Error | 172 | 38896 | 2867 | #
# ,. -─────────‐- .、
# // ̄ ̄\ / ̄ ̄\\
# / \
# / :::::::::::::::::::::::::::::::: \
# / / / ̄\\::::;;;;;;;;;;;;;;;;;:::::// ̄\\ \
# / | |. ┃ .| | ::::;;;;;;;;;;;;;::::| |. ┃ .| | \
# / \ \_... |
s729406604 | p03550 | u037430802 | 1559495642 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3188 | 752 | """
n=1の時、山札とYの初期手札が答え
n>=2の時、
・Xは得点の最大化を狙う
・Yは得点の最小化を狙う=Xの邪魔をする
山札内の得点の最大化をできるカードをXが選んでも、Yはそれを邪魔する動きをとるので、真に最大化すること(Xの狙いを達成すること)はできない
→選べるのはYの初期値&山札最後(Xがすべて取る)か、最後とその一つ手前の比較(Xが一枚残してすべて取る)のどちらかにするのがましな選択
"""
n,x,y = map(int, input().split())
a = list(map(int, input().split()))
if n == 1:
print(abs(a[-1] ... |
s445928891 | p03550 | u470542271 | 1558427166 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3188 | 202 | n, z, w = map(int, input().split())
a = list(map(int, input().split()))
score = []
# only X
score.append(abs(a[-1] - w))
if n > 1:
# X -> Y
score.append(abs(a[i] - a[-1]))
print(max(score))
|
s870613552 | p03550 | u623819879 | 1557948658 | Python | PyPy3 (2.4.0) | py | Runtime Error | 177 | 40624 | 157 | n,z,w=map(int,input().split())
a=[int(i) for i in input().split()]
if n>=2:
print(max(abs(a[-1]-w),abs(a[-1]-a[-2]) ))
else:
print(max(abs(a[-1]-w))) |
s622151512 | p03550 | u623819879 | 1557948595 | Python | PyPy3 (2.4.0) | py | Runtime Error | 175 | 39280 | 110 | n,z,w=map(int,input().split())
a=[int(i) for i in input().split()]
print(max(abs(a[-1]-w),abs(a[-1]-a[-2]) ))
|
s364684138 | p03550 | u623819879 | 1557948511 | Python | PyPy3 (2.4.0) | py | Runtime Error | 171 | 38384 | 100 | n,z,w=map(int,input())
a=[int(i) for i in input().split()]
print(max(abs(a[-1]-w),abs(a[-1]-a[-2]))) |
s100684231 | p03550 | u677393869 | 1556234026 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3188 | 257 | A,B,C=map(int,input().split())
N=[ _ for _ in map(int, input().split())]
N.reverse
Max=0
Min=100000000000000000
for i in N:
if Max<i:
Max=i
if Min>i:
Min=i
G=max(N[-1],B)
H=min(N[-2],C)
if Max< G:
Max=G
elif Min>H:
Min=H
print(Max-Min) |
s581522844 | p03550 | u222138979 | 1554847526 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3060 | 209 | a,b,c = int(input().split())
z = [int(input().split())]
if a == 1:
sco = abs(z-c)
else:
if abs(z[-1] - c) > abs(z[-2] - z[-1]):
sco = abs(z[-1] - c)
else:
sco = abs(z[-2] - z[-1])
print(sco) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.