This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def binsearch(l, x): | |
f, t = 0, len(l) - 1 | |
j = (f + t) // 2 | |
while f <= t: | |
j = (f + t) // 2 | |
if l[j] == x: | |
break | |
elif l[j] < x: | |
f = j + 1 | |
else: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
X, A, D, N = map(int, input().split()) | |
first = min(A, A + D * (N - 1)) | |
last = max(A, A + D * (N - 1)) | |
if X <= first: | |
print(abs(first - X)) | |
elif X >= last: | |
print(abs(X - last)) | |
else: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
N, K = map(int, input().split()) | |
A = list(map(int, input().split())) | |
P = [[0, 0]] | |
for i in range(N): | |
P.append(list(map(int, input().split()))) | |
distance = [] | |
for i in range(1, N + 1): | |
d = [] | |
for j in A: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
R, C = map(int, input().split()) | |
A = [] | |
for i in range(2): | |
A.append(list(map(int, input().split()))) | |
print(A[R - 1][C - 1]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
i = 0; s = 0 | |
while s < 1000: | |
i += 1 | |
s += i ** 3 | |
print(i, s) | |
print(i - 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
i = 0; s2 = '' | |
while i < 5: | |
i += 1 | |
s2 = s2 + 'Q' * i + '\n' | |
print(s2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
i = 0; s = 0 | |
while s < 10: | |
i = i + 1 | |
s = s + i | |
print(i, s) | |
print(i - 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BUILD FAILED (OS X 10.13 using python-build 20160602) | |
Inspect or clean up the working tree at /var/folders/nq/5pyc_js10jz0kq7wps9b5gkm0000gn/T/python-build.20171004122245.24032 | |
Results logged to /var/folders/nq/5pyc_js10jz0kq7wps9b5gkm0000gn/T/python-build.20171004122245.24032.log | |
Last 10 log lines: | |
import pip | |
File "/var/folders/nq/5pyc_js10jz0kq7wps9b5gkm0000gn/T/tmpr17v5c3y/pip-9.0.1-py2.py3-none-any.whl/pip/__init__.py", line 26, in <module> | |
File "/var/folders/nq/5pyc_js10jz0kq7wps9b5gkm0000gn/T/tmpr17v5c3y/pip-9.0.1-py2.py3-none-any.whl/pip/utils/__init__.py", line 27, in <module> | |
File "/var/folders/nq/5pyc_js10jz0kq7wps9b5gkm0000gn/T/tmpr17v5c3y/pip-9.0.1-py2.py3-none-any.whl/pip/_vendor/pkg_resources/__init__.py", line 35, in <module> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
session_start(); | |
if((!isset($_SESSION["'sesLoginID'"]))||(!isset($_SESSION["'PHPSESSID'"]))){ | |
session_destroy(); | |
header("Location: ../index.html"); | |
exit; | |
} | |
?> | |
<?xml version="1.0" encoding="euc-jp"?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
session_start(); | |
if((!isset($_SESSION['sesLoginID']))||(!isset($_SESSION['PHPSESSID']))){ | |
session_destroy(); | |
header("Location: ../index.html"); | |
exit; | |
} | |
?> | |
NewerOlder