restructure, slow security solution
This commit is contained in:
22
make_nonsense.py
Normal file
22
make_nonsense.py
Normal 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')
|
||||
Reference in New Issue
Block a user