100 lines
2.9 KiB
HTML
100 lines
2.9 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Quick Problem Platform</title>
|
|
<link rel="stylesheet" href="/static/style.css">
|
|
<style>
|
|
.leaderboard-table {
|
|
width: auto;
|
|
min-width: 400px;
|
|
max-width: 600px;
|
|
border-collapse: collapse;
|
|
margin: 2em 0;
|
|
background: #fff;
|
|
box-shadow: 0 2px 8px #0001;
|
|
border-radius: 8px;
|
|
overflow: hidden;
|
|
}
|
|
.leaderboard-table th, .leaderboard-table td {
|
|
padding: 0.7em 1em;
|
|
text-align: center;
|
|
}
|
|
.leaderboard-table th {
|
|
background: #f5f5f5;
|
|
font-weight: 600;
|
|
color: #333;
|
|
}
|
|
.leaderboard-table tr:nth-child(even) {
|
|
background: #fafbfc;
|
|
}
|
|
.leaderboard-table tr:nth-child(odd) {
|
|
background: #f0f2f5;
|
|
}
|
|
.leaderboard-table td {
|
|
font-family: 'JetBrains Mono', monospace;
|
|
font-size: 1em;
|
|
}
|
|
.leaderboard-table tr:hover {
|
|
background: #e0e7ff;
|
|
}
|
|
.problems-list {
|
|
max-width: 600px;
|
|
min-width: 400px;
|
|
margin: 0;
|
|
padding: 0;
|
|
}
|
|
.problems-list ul {
|
|
list-style: none;
|
|
padding: 0;
|
|
margin: 0;
|
|
}
|
|
.problems-list li {
|
|
padding: 0.5em 0;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<h1>Quick Problem Platform</h1>
|
|
<!--<a href="/problem/new">Submit New Problem</a>-->
|
|
<section class="problems-list">
|
|
<h2>Problems</h2>
|
|
<ul>
|
|
{% for problem in problems %}
|
|
<li><a href="/problem/{{ problem.id }}">{{ problem.title }}</a></li>
|
|
{% else %}
|
|
<li>No problems yet.</li>
|
|
{% endfor %}
|
|
</ul>
|
|
</section>
|
|
<section>
|
|
<h2>Leaderboard</h2>
|
|
<table class="leaderboard-table">
|
|
<tr>
|
|
<th>Rank</th>
|
|
<th>User</th>
|
|
<th>Problem</th>
|
|
<th>Runtime (s)</th>
|
|
<th>Memory (KB)</th>
|
|
<th>Line Number</th>
|
|
<th>Timestamp</th>
|
|
</tr>
|
|
{% for entry in leaderboard %}
|
|
<tr>
|
|
<td>{{ loop.index }}</td>
|
|
<td>{{ entry[0] }}</td>
|
|
<td>{{ problem_titles.get(entry[1], 'Unknown') }}</td>
|
|
<td>{{ '%.4f'|format(entry[2]) }}</td>
|
|
<td>{{ entry[3] }}</td>
|
|
<td>{{ entry[4] if entry[4] else '-' }}</td>
|
|
<td>{{ entry[5] }}</td>
|
|
</tr>
|
|
{% else %}
|
|
<tr><td colspan="7">No leaderboard entries yet.</td></tr>
|
|
{% endfor %}
|
|
</table>
|
|
</section>
|
|
</body>
|
|
</html>
|