From f503153a8a553930fdb828da52ad798e92640fe0 Mon Sep 17 00:00:00 2001 From: Pisces000221 <1786762946@qq.com> Date: Thu, 27 Jul 2017 11:01:24 +0800 Subject: [PATCH 1/2] Minor stylesheet tweaks --- static/style.css | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/static/style.css b/static/style.css index 1f65e66..11b51d2 100644 --- a/static/style.css +++ b/static/style.css @@ -322,6 +322,10 @@ margin-top: 0; } +.ui.segment:last-child { + margin-bottom: 3px; +} + .hljs { background: #FFF !important; } @@ -501,6 +505,7 @@ body > .ui.page.dimmer { border-radius: 3px; display: inline-block; font-family: "Monaco","Menlo","Ubuntu Mono","Consolas","source-code-pro",monospace; + font-size: 0.9em; font-weight: bold; padding: 1px 6px; vertical-align: baseline; From d22b67f1eb408f3d5d641624b5c0a5990e55a984 Mon Sep 17 00:00:00 2001 From: Pisces000221 <1786762946@qq.com> Date: Thu, 27 Jul 2017 11:09:18 +0800 Subject: [PATCH 2/2] Improve automatic testcases sorting --- utility.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/utility.js b/utility.js index 2f3384f..d4ce31f 100644 --- a/utility.js +++ b/utility.js @@ -245,14 +245,8 @@ module.exports = { res[0].type = 'sum'; res[0].score = 100; res[0].cases.sort((a, b) => { - function getLastInteger(s) { - let re = /(\d+)\D*$/; - let x = re.exec(s); - if (x) return parseInt(x[1]); - else return -1; - } - - return getLastInteger(a.input) - getLastInteger(b.input); + let extractNumerals = (s) => (s.match(/\d+/g) || []).map((x) => parseInt(x)).concat(s); + return extractNumerals(a.input) < extractNumerals(b.input) ? -1 : +1; }); res.spj = list.some(s => s.startsWith('spj_'));