Submission #762004

# Submission time Handle Problem Language Result Execution time Memory
762004 2023-06-20T14:14:35 Z NK_ Xoractive (IZhO19_xoractive) C++17
Compilation error
0 ms 0 KB
from random import random, randint, shuffle, seed
import time
import itertools

seed(1)

def brute(s):
	with open("in", "w") as f:
		f.write("{}\n".format(s))

	import os
	assert os.system("./A < in > badout") == 0
	assert os.system("./B < in > goodout") == 0
	assert os.system("diff badout goodout") == 0

def run(s):
	with open("in", "w") as f:
		f.write("{}\n".format(s))

	import os
	BEF = time.time()
	assert os.system("./A < in") == 0
	AFT = time.time()
	took = AFT-BEF
	return took

def validate(s):
	with open("in", "w") as f:
		f.write("{}\n".format(s))
	with open("correct", "w") as f:
		f.write("AC\n")

	import os
	assert os.system("./Intended < in > out") == 0
	assert os.system("cat out >> in") == 0
	assert os.system("./Validator < in > out") == 0
	assert os.system("diff correct out") == 0

case = 0;
while True:
	case += 1
	if case % 10 == 0:
		print(case)
	
	N = randint(1, 100)
	A = set()
	while len(A) < N:
		A.add(randint(1, 5e4))

	B = []
	for x in A:
		B.append(str(x))

	shuffle(B)

	s = "{}\n{}".format(N, " ".join(B))
	print(s)
	run(s)
	# break

Compilation message

Xoractive.cpp:59:4: error: invalid preprocessing directive #break
   59 |  # break
      |    ^~~~~
Xoractive.cpp:1:1: error: 'from' does not name a type
    1 | from random import random, randint, shuffle, seed
      | ^~~~
Xoractive.cpp:40:1: error: expected unqualified-id before 'while'
   40 | while True:
      | ^~~~~