You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
from random import *
|
|
with open("1.txt","w") as f:
|
|
n,m = int(1e4),int(1e3)
|
|
f.write("{} {}\n".format(n,m))
|
|
f.write(" ".join(str(randint(1,1e9)) for _ in range(n)) + "\n")
|
|
for _ in range(m):
|
|
i,j = randint(1,n),randint(1,n)
|
|
if i > j:
|
|
i,j = j,i
|
|
f.write("{} {}\n".format(i,j)) |