Skip to content

Instantly share code, notes, and snippets.

@fgnass
Last active April 12, 2019 12:17
Show Gist options
  • Save fgnass/3a40cdb84adff0f207b6087829e27594 to your computer and use it in GitHub Desktop.
Save fgnass/3a40cdb84adff0f207b6087829e27594 to your computer and use it in GitHub Desktop.
r = readline;
[...Array(+r())]
.map(r)
.map(l => /(.+): (.+) /.exec(l))
.map(
([, n, c]) =>
(c.split("-").map(c => 117 - c.charCodeAt(0)) + "").padEnd(20, ",1") + n
)
.sort()
.map(e => writeline(e.slice(20)));
r=readline;[...Array(+r())].map(r).map(l=>/(.+): (.+) /.exec(l)).map(([,n,c])=>(c.split("-").map(c=>117-c.charCodeAt(0))+"").padEnd(20,",1")+n).sort().map(e=>writeline(e.slice(20)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment