Закинул ещё мусора с Интеллекта, наверное это последнее
This commit is contained in:
1 parent
07b1c4e0e1
commit
90f20f9fd0
17 files changed
+732
-33
No files matched your search
@@ -0,0 +1,9 @@
|
||||
n, k, x = list(map(int, input().split()))
|
||||
from itertools import combinations_with_replacement
|
||||
cnt = 0
|
||||
for i in combinations_with_replacement(range(1, n+1), k):
|
||||
if cnt == x:
|
||||
for j in i:
|
||||
print(j, end=' ')
|
||||
break
|
||||
cnt += 1
|
||||
@@ -0,0 +1,9 @@
|
||||
n, k = list(map(int, input().split()))
|
||||
find = tuple(map(int, input().split()))
|
||||
from itertools import combinations_with_replacement
|
||||
cnt = 0
|
||||
for i in combinations_with_replacement(range(1, n+1), k):
|
||||
if i == find:
|
||||
print(cnt)
|
||||
break
|
||||
cnt += 1
|
||||
@@ -0,0 +1,6 @@
|
||||
le, de = list(map(int, input().split()))
|
||||
de = bin(de)[2:]
|
||||
if len(de) < le:
|
||||
de = ('0'*(le - len(de))) + de
|
||||
|
||||
print(de)
|
||||
Reference in new issue
Block a user