-
Notifications
You must be signed in to change notification settings - Fork 0
/
judge.py
executable file
·37 lines (33 loc) · 1.03 KB
/
judge.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env python3
import sys
import re
args = sys.argv
output = args[1]
output_image = args[2]
answer = args[3]
answer_image = args[4]
output = re.sub('\r', '', output)
answer = re.sub('\r', '', answer)
output_image = output_image[28:]
answer_image = answer_image[28:]
judge = "0"
if (output == answer and output_image == answer_image):
judge = "1"
elif (output == answer and output_image != answer_image):
judge = "2"
elif (output != answer and output_image == answer_image):
judge = "3"
else:
judge = "4"
print(judge)
# f = open('../debug.txt', 'w', encoding='UTF-8')
# f.write('output: '+output.replace("\n","<newline>")+'\n')
# f.write('answer: '+answer.replace("\n","<newline>")+'\n')
# f.write('output_len: '+str(len(output))+'\n')
# f.write('answer_len: '+str(len(answer))+'\n')
# f.write('output_image: '+output_image+'\n')
# f.write('answer_image: '+answer_image+'\n')
# f.write('output_image_len: '+str(len(output_image))+'\n')
# f.write('answer_image_len: '+str(len(answer_image))+'\n')
# f.write('judge: '+judge+'\n')
# f.close()