|
|
@ -53,20 +53,24 @@ def get_problem_description(_id: str): |
|
|
|
samples = json.loads(des[-1].replace("\n", "\\n")) |
|
|
|
samples_html = '' |
|
|
|
for s in samples: |
|
|
|
_input = s["input"].strip().replace(" ", " ").replace("\n", "<br/>") |
|
|
|
_output = s["output"].strip().replace(" ", " ").replace("\n", "<br/>") |
|
|
|
str1 = '<div>' |
|
|
|
str2 = '<div style="display:inline-block;width:45%;vertical-align:top;">' |
|
|
|
str3 = '<div><strong style="font-size:20px">Input</strong></div><br/>' |
|
|
|
str4 = '<div>' + _input + '</div>' |
|
|
|
str5 = '</div>' |
|
|
|
str6 = '<div style="display:inline-block;width:45%;vertical-align:top;">' |
|
|
|
str7 = '<div><strong style="font-size:20px">Output</strong></div><br/>' |
|
|
|
str8 = '<div>' + _output + '</div>' |
|
|
|
str9 = '</div>' |
|
|
|
str0 = '</div><br/>' |
|
|
|
samples_html = samples_html + str1 + str2 + str3 + str4 + str5 + str6 + str7 + str8 + str9 + str0 |
|
|
|
return title + description + input_description + output_description + samples_html, 200 |
|
|
|
_input = s["input"].strip().replace(" ", " ").replace("\n", "<br/> ") |
|
|
|
_output = s["output"].strip().replace(" ", " ").replace("\n", "<br/> ") |
|
|
|
# _input = s["input"].strip().replace(" ", " ") |
|
|
|
# _output = s["output"].strip().replace(" ", " ") |
|
|
|
stra = '<div>' |
|
|
|
strb = '<div style="width:100%;">' |
|
|
|
strc = '<div style="display:inline-block;width:45%;vertical-align:top;"><strong style="font-size:20px;color:blue;">Input</strong></div>' |
|
|
|
strd = '<div style="display:inline-block;width:2%;vertical-align:top;"></div>' |
|
|
|
stre = '<div style="display:inline-block;width:45%;vertical-align:top;"><strong style="font-size:20px;color:blue;">Output</strong></div>' |
|
|
|
strf = '</div><br/>' |
|
|
|
strg = '<div style="width:100%;">' |
|
|
|
strh = '<div style="display:inline-block;width:45%;height:100%;vertical-align:top;border:0.5px solid;border-radius:5px;"><br/> ' + _input + '<br/> </div>' |
|
|
|
stri = '<div style="display:inline-block;width:2%;height:100%;vertical-align:top;"></div>' |
|
|
|
strj = '<div style="display:inline-block;width:45%;height:100%;vertical-align:top;border:0.5px solid;border-radius:5px;"><br/> ' + _output + '<br/> </div>' |
|
|
|
strk = '</div>' |
|
|
|
strl = '</div><br/>' |
|
|
|
samples_html = samples_html + stra + strb + strc + strd + stre + strf + strg + strh + stri + strj + strk + strl |
|
|
|
return title + description + input_description + output_description + samples_html, 200 |
|
|
|
|
|
|
|
|
|
|
|
@app.route('/case_test/', methods=['POST']) |
|
|
|