restructure, slow security solution

This commit is contained in:
2018-01-30 02:02:02 -05:00
parent c9be15672c
commit c925681921
18 changed files with 284 additions and 57 deletions

22
make_nonsense.py Normal file
View File

@@ -0,0 +1,22 @@
from itertools import islice, permutations
from random import randint, sample
N, L, B = 1000, 5000, 100_000_000
S = D = 0
while S == D:
S, D = randint(1, N), randint(1, N)
pairs = sample(list(permutations(range(N), r=2)), L)
rows = []
for a, b in pairs:
x = randint(1, B)
y = randint(x, B)
rows.append((a, b, x, y))
with open('test/security/nonsense.in', 'w') as f:
f.writelines(' '.join(map(str, tup)) + '\n' for tup in [(N, L, B), (S, D)] + rows)
with open('test/security/nonsense.ans', 'w') as f:
f.write('27\n')