結果

問題 No.5007 Steiner Space Travel
ユーザー yas_yasyuyas_yasyu
提出日時 2023-04-27 01:11:51
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 1,609 bytes
コンパイル時間 564 ms
コンパイル使用メモリ 86,856 KB
実行使用メモリ 82,868 KB
スコア 0
最終ジャッジ日時 2023-04-27 01:12:07
合計ジャッジ時間 13,723 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
import subprocess

args = sys.argv

run_cmd = "n"
file_number = 0
if len(args) > 1:
	if args[1].isdecimal():
		file_number = args[1]
		if len(args) > 2:
			if not args[2].isdecimal():
				run_cmd = args[2]
			else:
				run_cmd = "p"
		else:
			run_cmd = "n"
	else:
		run_cmd = args[1]
		if len(args) > 2:
			if args[2].isdecimal():
				file_number = args[2]
			else:
				run_cmd = "p"


pwd_folder = r"/home/yas_yasyu/work/mnt5/" 
in_folder = pwd_folder + r"input/"
out_folder = pwd_folder + r"output/"
cmd_folder = pwd_folder + r"steiner-space-travel/"

arg_command = "'python3 main.py'"
file = f"{str(file_number).zfill(4)}"
in_file =  f"{in_folder}{file}.txt"
out_file = f"{out_folder}{file}.txt"
img_folder = "img/"
img_file = f"{pwd_folder}{img_folder}{file}.png"

def run(cmd):
	print(cmd)
	subprocess.run(
		cmd,
		shell=True,
		cwd = pwd_folder
	)
def normal():
	cmd = f"{arg_command} < {in_file} > {out_file}"
	run(cmd)
	cmd = f"dotnet {cmd_folder}tester.dll judge -i {in_file} -o {out_file}"
	run(cmd)

def vis():
	cmd = f"{arg_command} < {in_file} > {out_file}"
	run(cmd)
	cmd = f"dotnet {cmd_folder}tester.dll judge -i {in_file} -o {out_file} -v {img_file}"
	run(cmd)

def all():
	parallel = 8
	cmd = f"dotnet {cmd_folder}tester.dll judge-all -i {in_folder} -c {arg_command} -p {parallel}"
	subprocess.run(
		cmd,
		shell=True,
		cwd = pwd_folder
	)


def panic():
	print("python3 tester.py $cmd")
	print('$cmd : v 10')
	print('$cmd : 10')
	print('$cmd : a')

	exit()

if not run_cmd in "nvap":
	panic()

run_act = {
	"n": normal,
	"v": vis,
	"a": all,
	"p": panic
}

run_act[run_cmd]()
0