Browse Source

Merge branch 'master' of github.com:syzoj/syzoj

pull/6/head
Menci 7 years ago
parent
commit
a56c428bcd
  1. 5
      static/style.css
  2. 10
      utility.js

5
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;

10
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_'));

Loading…
Cancel
Save