[feature] better output format

Signed-off-by: zhangtianli2006 <zhangtianli2006@163.com>
This commit is contained in:
zhangtianli2006 2021-08-25 13:42:49 +08:00
parent e1c7c59345
commit ee500e6510
2 changed files with 12 additions and 6 deletions

View File

@ -69,6 +69,9 @@ folder = vconf.readline().strip()
if (not os.path.exists(folder)): if (not os.path.exists(folder)):
os.makedirs(folder) os.makedirs(folder)
print("Start Checking solution for {}.".format(name))
print()
sub_tasks = int(sub_tasks) sub_tasks = int(sub_tasks)
tot_tasks = 0 tot_tasks = 0
@ -118,7 +121,7 @@ for i in range(1, sub_tasks + 1):
re += 1 re += 1
print( print(
" [{}%] Case #{}.{}: {} ({}ms)".format( " [{:>3}%] Case #{}.{}: {:^14} ({}ms)".format(
round((tot_id / tot_tasks) * 100), round((tot_id / tot_tasks) * 100),
i, i,
j, j,
@ -141,13 +144,13 @@ if wa == 0 and re == 0:
print(" AC", end="") print(" AC", end="")
print() print()
print(" Total time: {}ms".format(round(tot_time * 1000, 2))) print(" Total time: {}ms".format(round(tot_time * 1000, 2)))
print( print(
" Slowest case: #{}.{} ({}ms)".format( " Slowest case: #{}.{} ({}ms)".format(
max_case[0], max_case[1], round(max_time * 1000, 2) max_case[0], max_case[1], round(max_time * 1000, 2)
) )
) )
print("--------------------------------") print("--------------------------------")
print(" AC: {} [{}%]".format(ac, ac * 100 // tot_tasks)) print(" AC: {:>3} [{:>3}%]".format(ac, ac * 100 // tot_tasks))
print(" WA: {} [{}%]".format(wa, wa * 100 // tot_tasks)) print(" WA: {:>3} [{:>3}%]".format(wa, wa * 100 // tot_tasks))
print(" RE: {} [{}%]".format(re, re * 100 // tot_tasks)) print(" RE: {:>3} [{:>3}%]".format(re, re * 100 // tot_tasks))

View File

@ -33,6 +33,9 @@ folder = vconf.readline().strip()
if (not os.path.exists(folder)): if (not os.path.exists(folder)):
os.makedirs(folder) os.makedirs(folder)
print("Start Making data for {}.".format(name))
print()
sub_tasks = int(sub_tasks) sub_tasks = int(sub_tasks)
tot_tasks = 0 tot_tasks = 0
@ -92,7 +95,7 @@ for i in range(1, sub_tasks + 1):
max_case = (i, j) max_case = (i, j)
print( print(
" [{}%] Made case #{}.{}: ({}ms)".format( " [{:>3}%] Made case #{}.{}: ({}ms)".format(
round((tot_id / tot_tasks) * 100), round((tot_id / tot_tasks) * 100),
i, i,
j, j,