2019-11-15: init

This commit is contained in:
2019-11-15 03:29:24 +09:00
commit 9780f1b736
32 changed files with 633 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
print("""\ /\\
) ( ')
( / )
\(__)|""")

View File

@@ -0,0 +1,9 @@
from sys import *
c=0
D=[]
I=[ord(i)-97 for i in stdin.readline().rstrip()]
for i in range(26):
try:D.append(I.index(i))
except:D.append(-1)
D=list(map(str,D))
print(" ".join(D))

View File

@@ -0,0 +1,10 @@
N = range(int(input()))
[print(
sum(
map(
int,input().split()
)
)
)
for i in N
]

View File

@@ -0,0 +1,5 @@
while True:
s = sum(map(int, input().split()))
if s == 0:
break
print(s)

View File

@@ -0,0 +1,17 @@
N, K = map(int, input().split())
A = [int(input())for i in range(N)]
r = 0
back = 1
while K != 0:
for i in A:
if i > K:
r += K // back
K %= back
break
back = i
else:
r += K // back
K %= back
print(r)

View File

@@ -0,0 +1,6 @@
while True:
i = input()
if i == 'END':
break
i = i[::-1]
print(i)

View File

@@ -0,0 +1 @@
print("<EFBFBD>")

View File

@@ -0,0 +1 @@
for i in range(int(input().split()[0])):print(input()[::-1])

View File

@@ -0,0 +1,5 @@
d=1;n=int(input())
while n>=d:
if(n==d):print(1);break
d*=2
else:print(0)

View File

@@ -0,0 +1,2 @@
for i in range(int(input())):print("god"+"".join(input().split()[1:]))

View File

@@ -0,0 +1,2 @@
from sys import *
for i in range(int(stdin.readline().rstrip())):print(sum(list(map(int,stdin.readline().rstrip().split()))))

View File

@@ -0,0 +1,3 @@
input()
Case = tuple(map(int, input().split()))
print(max(Case)-min(Case))

View File

@@ -0,0 +1,33 @@
inp = input()
l = 0
forforw = None
forw = ''
for i in inp:
if i == '=':
if forw in ('c', 's'):
pass
elif forw == 'z':
if forwforw == 'd':
l -= 1
else:
pass
else:
pass
elif i == '-':
if forw in ('c', 'd'):
pass
elif i == 'j':
if forw == 'n' or forw == 'l':
pass
else:
l += 1
else:
l += 1
forwforw = forw
forw = i
print(l)

View File

@@ -0,0 +1,7 @@
"""
"""
import math
r = int(input())
print("%.6f"%round(r**2*math.pi,6))
print("%.6f"%round(2*r**2,6))

View File

@@ -0,0 +1,15 @@
All = int(input())
case = []
v=0
for i in range(All):
test = list(map(int,input().split()))
case.append(test)
for i in range(All):
test_all = sum(case[i])-case[i][0]
Average = test_all/(len(case[i])-1)
for j in range(len(case[i])-1):
if Average < case[i][j+1]:
v+=1
else : pass
print("%.3f%%"%(round(((100*v)/(len(case[i])-1)),3)))
v=0

View File

@@ -0,0 +1,11 @@
while True:
inp = tuple(map(int, input().split()))
if inp[0] == inp[1] == 0:
break
else:
if inp[0] >= inp[1]:
s = "multiple" if inp[0] % inp[1] == 0 else "neither"
else :
s = "factor" if inp[1] % inp[0] == 0 else "neither"
print(s)

View File

@@ -0,0 +1,25 @@
Glevel = 0
Nlevel = 0
testCase = int(input())
isVPS = True
for i in range(testCase):
inString = input()
if len(inString) % 2:
print("NO")
continue
for i in inString:
if i == "(":
Glevel += 1
elif i == ")":
Glevel -= 1
if Glevel < 0:
isVPS = False
break
if isVPS and Glevel == 0:
print("YES")
else :
print("NO")
isVPS = True
Glevel = 0