Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- import subprocess
- def main():
- if len(sys.argv) != 2:
- print("python3 buzka.py <binary>")
- return
- binary = sys.argv[1]
- n = 500_000
- q = 100_000
- lines = []
- lines.append(f"{n} {q}")
- lines.extend(["0 2"] * n)
- lines.extend([f"0 0 {n}"] * q)
- input_data = "\n".join(lines) + "\n"
- try:
- result = subprocess.run(
- [binary],
- input=input_data.encode(),
- stdout=subprocess.DEVNULL,
- stderr=subprocess.DEVNULL,
- timeout=5
- )
- if result.returncode == 0:
- print(":)")
- else:
- print(":(")
- except subprocess.TimeoutExpired:
- print(":(")
- if __name__ == "__main__":
- main()
Advertisement
Add Comment
Please, Sign In to add comment