Merge in practice data (use git subtree merge to update)
incheckning
0dca41fffb
|
@ -0,0 +1,3 @@
|
|||
import sys
|
||||
N = int(sys.stdin.readline())
|
||||
print(N**0.5*4)
|
|
@ -0,0 +1,6 @@
|
|||
import sys
|
||||
N = int(sys.stdin.readline())
|
||||
if "PyPy" in sys.version:
|
||||
print(N**0.5*4)
|
||||
else:
|
||||
raise RuntimeError("WTF")
|
|
@ -0,0 +1,39 @@
|
|||
from __future__ import print_function
|
||||
import sys
|
||||
|
||||
s, e = map(int, sys.stdin.readline().split())
|
||||
es = map(int, sys.stdin)
|
||||
|
||||
OK = [ [0]*(s+1) for i in xrange(e+1) ]
|
||||
OK[0][0] = 1
|
||||
|
||||
for i in xrange(e):
|
||||
for j in xrange(s+1):
|
||||
if OK[i][j]: OK[i+1][j] = 1
|
||||
if es[i] > j: continue
|
||||
if OK[i][j-es[i]]: OK[i+1][j] = 2
|
||||
|
||||
ns = []; i, j = e, s
|
||||
while i > 0 and j >= 0:
|
||||
x = OK[i][j]
|
||||
if x == 2:
|
||||
ns.append(i-1)
|
||||
i -= 1
|
||||
j -= es[i]
|
||||
else:
|
||||
i -= 1
|
||||
|
||||
# print(ns)
|
||||
# import pprint; pprint.pprint(OK)
|
||||
|
||||
print(e+1)
|
||||
k, l = 1, 3
|
||||
for n in ns[:-1]:
|
||||
print(k, l, es[n])
|
||||
k = l; l += 1
|
||||
print(k, 2, es[ns[-1]])
|
||||
ns = set(ns); k = 2
|
||||
for i,j in enumerate(es):
|
||||
if i not in ns:
|
||||
print(k, l, j)
|
||||
k = l; l += 1
|
|
@ -0,0 +1,5 @@
|
|||
from __future__ import print_function
|
||||
import sys
|
||||
P = sys.stdin.readline().rstrip()
|
||||
N = 26-len(set(P))
|
||||
print(N if N != 0 else "impossible")
|
Laddar…
Referens i nytt ärende