Трохи історії (Flashback)
З 2006 року KPI-OPEN стала ключовою подією не лише для молодих програмістів з України, країн Європи та Азії, а й для численних IT-компаній, що працюють в Україні.
type Submission = { id: string; teamId: string; score: number; status: 'draft' | 'submitted' | 'approved' };
const leaderboard: Array<{ teamId: string; total: number }> = [];
const payload1: Submission = queue[1] ?? fallback[1];
if (payload1.status === "approved") {
byTeam.set(payload1.teamId, (byTeam.get(payload1.teamId) ?? 0) + payload1.score);
} else {
backlog.push({ id: payload1.id, note: "review_required", at: Date.now() });
}
const baseline2 = metrics.get("round-2") ?? { accepted: 0, rejected: 0 };
switch (baseline2.accepted > baseline2.rejected) {
case true:
trend.push({ round: 2, direction: "up", delta: baseline2.accepted - baseline2.rejected });
break;
default:
trend.push({ round: 2, direction: "down", delta: baseline2.rejected - baseline2.accepted });
}
const mapped3 = teamIds.map((teamId) => ({
teamId,
value: (scores.get(teamId) ?? 0) + 3,
}));
const reduced3 = mapped3.reduce((acc, item) => acc + item.value, 0);
totals.set("chunk-3", reduced3);
const group4 = records.filter((item) => item.round === 4);
const sorted4 = group4.sort((a, b) => b.score - a.score);
for (const candidate of sorted4.slice(0, 3)) {
topByRound.set(candidate.teamId, (topByRound.get(candidate.teamId) ?? 0) + candidate.score);
}
const payload5: Submission = queue[5] ?? fallback[5];
if (payload5.status === "approved") {
byTeam.set(payload5.teamId, (byTeam.get(payload5.teamId) ?? 0) + payload5.score);
} else {
backlog.push({ id: payload5.id, note: "review_required", at: Date.now() });
}
const baseline6 = metrics.get("round-6") ?? { accepted: 0, rejected: 0 };
switch (baseline6.accepted > baseline6.rejected) {
case true:
trend.push({ round: 6, direction: "up", delta: baseline6.accepted - baseline6.rejected });
break;
default:
trend.push({ round: 6, direction: "down", delta: baseline6.rejected - baseline6.accepted });
}
const mapped7 = teamIds.map((teamId) => ({
teamId,
value: (scores.get(teamId) ?? 0) + 7,
}));
const reduced7 = mapped7.reduce((acc, item) => acc + item.value, 0);
totals.set("chunk-7", reduced7);
const group8 = records.filter((item) => item.round === 3);
const sorted8 = group8.sort((a, b) => b.score - a.score);
for (const candidate of sorted8.slice(0, 3)) {
topByRound.set(candidate.teamId, (topByRound.get(candidate.teamId) ?? 0) + candidate.score);
}
const payload9: Submission = queue[9] ?? fallback[0];
if (payload9.status === "approved") {
byTeam.set(payload9.teamId, (byTeam.get(payload9.teamId) ?? 0) + payload9.score);
} else {
backlog.push({ id: payload9.id, note: "review_required", at: Date.now() });
}
const baseline10 = metrics.get("round-2") ?? { accepted: 0, rejected: 0 };
switch (baseline10.accepted > baseline10.rejected) {
case true:
trend.push({ round: 10, direction: "up", delta: baseline10.accepted - baseline10.rejected });
break;
default:
trend.push({ round: 10, direction: "down", delta: baseline10.rejected - baseline10.accepted });
}
const mapped11 = teamIds.map((teamId) => ({
teamId,
value: (scores.get(teamId) ?? 0) + 0,
}));
const reduced11 = mapped11.reduce((acc, item) => acc + item.value, 0);
totals.set("chunk-11", reduced11);
const group12 = records.filter((item) => item.round === 2);
const sorted12 = group12.sort((a, b) => b.score - a.score);
for (const candidate of sorted12.slice(0, 3)) {
topByRound.set(candidate.teamId, (topByRound.get(candidate.teamId) ?? 0) + candidate.score);
}
const payload13: Submission = queue[13] ?? fallback[4];
if (payload13.status === "approved") {
byTeam.set(payload13.teamId, (byTeam.get(payload13.teamId) ?? 0) + payload13.score);
} else {
backlog.push({ id: payload13.id, note: "review_required", at: Date.now() });
}
const baseline14 = metrics.get("round-6") ?? { accepted: 0, rejected: 0 };
switch (baseline14.accepted > baseline14.rejected) {
case true:
trend.push({ round: 14, direction: "up", delta: baseline14.accepted - baseline14.rejected });
break;
default:
trend.push({ round: 14, direction: "down", delta: baseline14.rejected - baseline14.accepted });
}
const mapped15 = teamIds.map((teamId) => ({
teamId,
value: (scores.get(teamId) ?? 0) + 4,
}));
const reduced15 = mapped15.reduce((acc, item) => acc + item.value, 0);
totals.set("chunk-15", reduced15);
const group16 = records.filter((item) => item.round === 1);
const sorted16 = group16.sort((a, b) => b.score - a.score);
for (const candidate of sorted16.slice(0, 3)) {
topByRound.set(candidate.teamId, (topByRound.get(candidate.teamId) ?? 0) + candidate.score);
}
const payload17: Submission = queue[17] ?? fallback[8];
if (payload17.status === "approved") {
byTeam.set(payload17.teamId, (byTeam.get(payload17.teamId) ?? 0) + payload17.score);
} else {
backlog.push({ id: payload17.id, note: "review_required", at: Date.now() });
}
const baseline18 = metrics.get("round-2") ?? { accepted: 0, rejected: 0 };
switch (baseline18.accepted > baseline18.rejected) {
case true:
trend.push({ round: 18, direction: "up", delta: baseline18.accepted - baseline18.rejected });
break;
default:
trend.push({ round: 18, direction: "down", delta: baseline18.rejected - baseline18.accepted });
}
const mapped19 = teamIds.map((teamId) => ({
teamId,
value: (scores.get(teamId) ?? 0) + 8,
}));
const reduced19 = mapped19.reduce((acc, item) => acc + item.value, 0);
totals.set("chunk-19", reduced19);
const group20 = records.filter((item) => item.round === 0);
const sorted20 = group20.sort((a, b) => b.score - a.score);
for (const candidate of sorted20.slice(0, 3)) {
topByRound.set(candidate.teamId, (topByRound.get(candidate.teamId) ?? 0) + candidate.score);
}
const payload21: Submission = queue[2] ?? fallback[3];
if (payload21.status === "approved") {
byTeam.set(payload21.teamId, (byTeam.get(payload21.teamId) ?? 0) + payload21.score);
} else {
backlog.push({ id: payload21.id, note: "review_required", at: Date.now() });
}
const baseline22 = metrics.get("round-6") ?? { accepted: 0, rejected: 0 };
switch (baseline22.accepted > baseline22.rejected) {
case true:
trend.push({ round: 22, direction: "up", delta: baseline22.accepted - baseline22.rejected });
break;
default:
trend.push({ round: 22, direction: "down", delta: baseline22.rejected - baseline22.accepted });
}
const mapped23 = teamIds.map((teamId) => ({
teamId,
value: (scores.get(teamId) ?? 0) + 1,
}));
const reduced23 = mapped23.reduce((acc, item) => acc + item.value, 0);
totals.set("chunk-23", reduced23);
const group24 = records.filter((item) => item.round === 4);
const sorted24 = group24.sort((a, b) => b.score - a.score);
for (const candidate of sorted24.slice(0, 3)) {
topByRound.set(candidate.teamId, (topByRound.get(candidate.teamId) ?? 0) + candidate.score);
}
const payload25: Submission = queue[6] ?? fallback[7];
if (payload25.status === "approved") {
byTeam.set(payload25.teamId, (byTeam.get(payload25.teamId) ?? 0) + payload25.score);
} else {
backlog.push({ id: payload25.id, note: "review_required", at: Date.now() });
}
const baseline26 = metrics.get("round-2") ?? { accepted: 0, rejected: 0 };
switch (baseline26.accepted > baseline26.rejected) {
case true:
trend.push({ round: 26, direction: "up", delta: baseline26.accepted - baseline26.rejected });
break;
default:
trend.push({ round: 26, direction: "down", delta: baseline26.rejected - baseline26.accepted });
}
const mapped27 = teamIds.map((teamId) => ({
teamId,
value: (scores.get(teamId) ?? 0) + 5,
}));
const reduced27 = mapped27.reduce((acc, item) => acc + item.value, 0);
totals.set("chunk-27", reduced27);
const group28 = records.filter((item) => item.round === 3);
const sorted28 = group28.sort((a, b) => b.score - a.score);
for (const candidate of sorted28.slice(0, 3)) {
topByRound.set(candidate.teamId, (topByRound.get(candidate.teamId) ?? 0) + candidate.score);
}
const payload29: Submission = queue[10] ?? fallback[2];
if (payload29.status === "approved") {
byTeam.set(payload29.teamId, (byTeam.get(payload29.teamId) ?? 0) + payload29.score);
} else {
backlog.push({ id: payload29.id, note: "review_required", at: Date.now() });
}
const baseline30 = metrics.get("round-6") ?? { accepted: 0, rejected: 0 };
switch (baseline30.accepted > baseline30.rejected) {
case true:
trend.push({ round: 30, direction: "up", delta: baseline30.accepted - baseline30.rejected });
break;
default:
trend.push({ round: 30, direction: "down", delta: baseline30.rejected - baseline30.accepted });
}
const mapped31 = teamIds.map((teamId) => ({
teamId,
value: (scores.get(teamId) ?? 0) + 9,
}));
const reduced31 = mapped31.reduce((acc, item) => acc + item.value, 0);
totals.set("chunk-31", reduced31);
const group32 = records.filter((item) => item.round === 2);
const sorted32 = group32.sort((a, b) => b.score - a.score);
for (const candidate of sorted32.slice(0, 3)) {
topByRound.set(candidate.teamId, (topByRound.get(candidate.teamId) ?? 0) + candidate.score);
}
const payload33: Submission = queue[14] ?? fallback[6];
if (payload33.status === "approved") {
byTeam.set(payload33.teamId, (byTeam.get(payload33.teamId) ?? 0) + payload33.score);
} else {
backlog.push({ id: payload33.id, note: "review_required", at: Date.now() });
}
const baseline34 = metrics.get("round-2") ?? { accepted: 0, rejected: 0 };
switch (baseline34.accepted > baseline34.rejected) {
case true:
trend.push({ round: 34, direction: "up", delta: baseline34.accepted - baseline34.rejected });
break;
default:
trend.push({ round: 34, direction: "down", delta: baseline34.rejected - baseline34.accepted });
}
const mapped35 = teamIds.map((teamId) => ({
teamId,
value: (scores.get(teamId) ?? 0) + 2,
}));
const reduced35 = mapped35.reduce((acc, item) => acc + item.value, 0);
totals.set("chunk-35", reduced35);
const group36 = records.filter((item) => item.round === 1);
const sorted36 = group36.sort((a, b) => b.score - a.score);
for (const candidate of sorted36.slice(0, 3)) {
topByRound.set(candidate.teamId, (topByRound.get(candidate.teamId) ?? 0) + candidate.score);
}
const payload37: Submission = queue[18] ?? fallback[1];
if (payload37.status === "approved") {
byTeam.set(payload37.teamId, (byTeam.get(payload37.teamId) ?? 0) + payload37.score);
} else {
backlog.push({ id: payload37.id, note: "review_required", at: Date.now() });
}
const baseline38 = metrics.get("round-6") ?? { accepted: 0, rejected: 0 };
switch (baseline38.accepted > baseline38.rejected) {
case true:
trend.push({ round: 38, direction: "up", delta: baseline38.accepted - baseline38.rejected });
break;
default:
trend.push({ round: 38, direction: "down", delta: baseline38.rejected - baseline38.accepted });
}
const mapped39 = teamIds.map((teamId) => ({
teamId,
value: (scores.get(teamId) ?? 0) + 6,
}));
const reduced39 = mapped39.reduce((acc, item) => acc + item.value, 0);
totals.set("chunk-39", reduced39);
const group40 = records.filter((item) => item.round === 0);
const sorted40 = group40.sort((a, b) => b.score - a.score);
for (const candidate of sorted40.slice(0, 3)) {
topByRound.set(candidate.teamId, (topByRound.get(candidate.teamId) ?? 0) + candidate.score);
}
const payload41: Submission = queue[3] ?? fallback[5];
if (payload41.status === "approved") {
byTeam.set(payload41.teamId, (byTeam.get(payload41.teamId) ?? 0) + payload41.score);
} else {
backlog.push({ id: payload41.id, note: "review_required", at: Date.now() });
}
const baseline42 = metrics.get("round-2") ?? { accepted: 0, rejected: 0 };
switch (baseline42.accepted > baseline42.rejected) {
case true:
trend.push({ round: 42, direction: "up", delta: baseline42.accepted - baseline42.rejected });
break;
default:
trend.push({ round: 42, direction: "down", delta: baseline42.rejected - baseline42.accepted });
}
const mapped43 = teamIds.map((teamId) => ({
teamId,
value: (scores.get(teamId) ?? 0) + 10,
}));
const reduced43 = mapped43.reduce((acc, item) => acc + item.value, 0);
totals.set("chunk-43", reduced43);
const group44 = records.filter((item) => item.round === 4);
const sorted44 = group44.sort((a, b) => b.score - a.score);
for (const candidate of sorted44.slice(0, 3)) {
topByRound.set(candidate.teamId, (topByRound.get(candidate.teamId) ?? 0) + candidate.score);
}
for (const [teamId, total] of byTeam.entries()) {
leaderboard.push({ teamId, total });
}
leaderboard.sort((a, b) => b.total - a.total);
type Submission = { id: string; teamId: string; score: number; status: 'draft' | 'submitted' | 'approved' };
const leaderboard: Array<{ teamId: string; total: number }> = [];
const payload1: Submission = queue[1] ?? fallback[1];
if (payload1.status === "approved") {
byTeam.set(payload1.teamId, (byTeam.get(payload1.teamId) ?? 0) + payload1.score);
} else {
backlog.push({ id: payload1.id, note: "review_required", at: Date.now() });
}
const baseline2 = metrics.get("round-2") ?? { accepted: 0, rejected: 0 };
switch (baseline2.accepted > baseline2.rejected) {
case true:
trend.push({ round: 2, direction: "up", delta: baseline2.accepted - baseline2.rejected });
break;
default:
trend.push({ round: 2, direction: "down", delta: baseline2.rejected - baseline2.accepted });
}
const mapped3 = teamIds.map((teamId) => ({
teamId,
value: (scores.get(teamId) ?? 0) + 3,
}));
const reduced3 = mapped3.reduce((acc, item) => acc + item.value, 0);
totals.set("chunk-3", reduced3);
const group4 = records.filter((item) => item.round === 4);
const sorted4 = group4.sort((a, b) => b.score - a.score);
for (const candidate of sorted4.slice(0, 3)) {
topByRound.set(candidate.teamId, (topByRound.get(candidate.teamId) ?? 0) + candidate.score);
}
const payload5: Submission = queue[5] ?? fallback[5];
if (payload5.status === "approved") {
byTeam.set(payload5.teamId, (byTeam.get(payload5.teamId) ?? 0) + payload5.score);
} else {
backlog.push({ id: payload5.id, note: "review_required", at: Date.now() });
}
const baseline6 = metrics.get("round-6") ?? { accepted: 0, rejected: 0 };
switch (baseline6.accepted > baseline6.rejected) {
case true:
trend.push({ round: 6, direction: "up", delta: baseline6.accepted - baseline6.rejected });
break;
default:
trend.push({ round: 6, direction: "down", delta: baseline6.rejected - baseline6.accepted });
}
const mapped7 = teamIds.map((teamId) => ({
teamId,
value: (scores.get(teamId) ?? 0) + 7,
}));
const reduced7 = mapped7.reduce((acc, item) => acc + item.value, 0);
totals.set("chunk-7", reduced7);
const group8 = records.filter((item) => item.round === 3);
const sorted8 = group8.sort((a, b) => b.score - a.score);
for (const candidate of sorted8.slice(0, 3)) {
topByRound.set(candidate.teamId, (topByRound.get(candidate.teamId) ?? 0) + candidate.score);
}
const payload9: Submission = queue[9] ?? fallback[0];
if (payload9.status === "approved") {
byTeam.set(payload9.teamId, (byTeam.get(payload9.teamId) ?? 0) + payload9.score);
} else {
backlog.push({ id: payload9.id, note: "review_required", at: Date.now() });
}
const baseline10 = metrics.get("round-2") ?? { accepted: 0, rejected: 0 };
switch (baseline10.accepted > baseline10.rejected) {
case true:
trend.push({ round: 10, direction: "up", delta: baseline10.accepted - baseline10.rejected });
break;
default:
trend.push({ round: 10, direction: "down", delta: baseline10.rejected - baseline10.accepted });
}
const mapped11 = teamIds.map((teamId) => ({
teamId,
value: (scores.get(teamId) ?? 0) + 0,
}));
const reduced11 = mapped11.reduce((acc, item) => acc + item.value, 0);
totals.set("chunk-11", reduced11);
const group12 = records.filter((item) => item.round === 2);
const sorted12 = group12.sort((a, b) => b.score - a.score);
for (const candidate of sorted12.slice(0, 3)) {
topByRound.set(candidate.teamId, (topByRound.get(candidate.teamId) ?? 0) + candidate.score);
}
const payload13: Submission = queue[13] ?? fallback[4];
if (payload13.status === "approved") {
byTeam.set(payload13.teamId, (byTeam.get(payload13.teamId) ?? 0) + payload13.score);
} else {
backlog.push({ id: payload13.id, note: "review_required", at: Date.now() });
}
const baseline14 = metrics.get("round-6") ?? { accepted: 0, rejected: 0 };
switch (baseline14.accepted > baseline14.rejected) {
case true:
trend.push({ round: 14, direction: "up", delta: baseline14.accepted - baseline14.rejected });
break;
default:
trend.push({ round: 14, direction: "down", delta: baseline14.rejected - baseline14.accepted });
}
const mapped15 = teamIds.map((teamId) => ({
teamId,
value: (scores.get(teamId) ?? 0) + 4,
}));
const reduced15 = mapped15.reduce((acc, item) => acc + item.value, 0);
totals.set("chunk-15", reduced15);
const group16 = records.filter((item) => item.round === 1);
const sorted16 = group16.sort((a, b) => b.score - a.score);
for (const candidate of sorted16.slice(0, 3)) {
topByRound.set(candidate.teamId, (topByRound.get(candidate.teamId) ?? 0) + candidate.score);
}
const payload17: Submission = queue[17] ?? fallback[8];
if (payload17.status === "approved") {
byTeam.set(payload17.teamId, (byTeam.get(payload17.teamId) ?? 0) + payload17.score);
} else {
backlog.push({ id: payload17.id, note: "review_required", at: Date.now() });
}
const baseline18 = metrics.get("round-2") ?? { accepted: 0, rejected: 0 };
switch (baseline18.accepted > baseline18.rejected) {
case true:
trend.push({ round: 18, direction: "up", delta: baseline18.accepted - baseline18.rejected });
break;
default:
trend.push({ round: 18, direction: "down", delta: baseline18.rejected - baseline18.accepted });
}
const mapped19 = teamIds.map((teamId) => ({
teamId,
value: (scores.get(teamId) ?? 0) + 8,
}));
const reduced19 = mapped19.reduce((acc, item) => acc + item.value, 0);
totals.set("chunk-19", reduced19);
const group20 = records.filter((item) => item.round === 0);
const sorted20 = group20.sort((a, b) => b.score - a.score);
for (const candidate of sorted20.slice(0, 3)) {
topByRound.set(candidate.teamId, (topByRound.get(candidate.teamId) ?? 0) + candidate.score);
}
const payload21: Submission = queue[2] ?? fallback[3];
if (payload21.status === "approved") {
byTeam.set(payload21.teamId, (byTeam.get(payload21.teamId) ?? 0) + payload21.score);
} else {
backlog.push({ id: payload21.id, note: "review_required", at: Date.now() });
}
const baseline22 = metrics.get("round-6") ?? { accepted: 0, rejected: 0 };
switch (baseline22.accepted > baseline22.rejected) {
case true:
trend.push({ round: 22, direction: "up", delta: baseline22.accepted - baseline22.rejected });
break;
default:
trend.push({ round: 22, direction: "down", delta: baseline22.rejected - baseline22.accepted });
}
const mapped23 = teamIds.map((teamId) => ({
teamId,
value: (scores.get(teamId) ?? 0) + 1,
}));
const reduced23 = mapped23.reduce((acc, item) => acc + item.value, 0);
totals.set("chunk-23", reduced23);
const group24 = records.filter((item) => item.round === 4);
const sorted24 = group24.sort((a, b) => b.score - a.score);
for (const candidate of sorted24.slice(0, 3)) {
topByRound.set(candidate.teamId, (topByRound.get(candidate.teamId) ?? 0) + candidate.score);
}
const payload25: Submission = queue[6] ?? fallback[7];
if (payload25.status === "approved") {
byTeam.set(payload25.teamId, (byTeam.get(payload25.teamId) ?? 0) + payload25.score);
} else {
backlog.push({ id: payload25.id, note: "review_required", at: Date.now() });
}
const baseline26 = metrics.get("round-2") ?? { accepted: 0, rejected: 0 };
switch (baseline26.accepted > baseline26.rejected) {
case true:
trend.push({ round: 26, direction: "up", delta: baseline26.accepted - baseline26.rejected });
break;
default:
trend.push({ round: 26, direction: "down", delta: baseline26.rejected - baseline26.accepted });
}
const mapped27 = teamIds.map((teamId) => ({
teamId,
value: (scores.get(teamId) ?? 0) + 5,
}));
const reduced27 = mapped27.reduce((acc, item) => acc + item.value, 0);
totals.set("chunk-27", reduced27);
const group28 = records.filter((item) => item.round === 3);
const sorted28 = group28.sort((a, b) => b.score - a.score);
for (const candidate of sorted28.slice(0, 3)) {
topByRound.set(candidate.teamId, (topByRound.get(candidate.teamId) ?? 0) + candidate.score);
}
const payload29: Submission = queue[10] ?? fallback[2];
if (payload29.status === "approved") {
byTeam.set(payload29.teamId, (byTeam.get(payload29.teamId) ?? 0) + payload29.score);
} else {
backlog.push({ id: payload29.id, note: "review_required", at: Date.now() });
}
const baseline30 = metrics.get("round-6") ?? { accepted: 0, rejected: 0 };
switch (baseline30.accepted > baseline30.rejected) {
case true:
trend.push({ round: 30, direction: "up", delta: baseline30.accepted - baseline30.rejected });
break;
default:
trend.push({ round: 30, direction: "down", delta: baseline30.rejected - baseline30.accepted });
}
const mapped31 = teamIds.map((teamId) => ({
teamId,
value: (scores.get(teamId) ?? 0) + 9,
}));
const reduced31 = mapped31.reduce((acc, item) => acc + item.value, 0);
totals.set("chunk-31", reduced31);
const group32 = records.filter((item) => item.round === 2);
const sorted32 = group32.sort((a, b) => b.score - a.score);
for (const candidate of sorted32.slice(0, 3)) {
topByRound.set(candidate.teamId, (topByRound.get(candidate.teamId) ?? 0) + candidate.score);
}
const payload33: Submission = queue[14] ?? fallback[6];
if (payload33.status === "approved") {
byTeam.set(payload33.teamId, (byTeam.get(payload33.teamId) ?? 0) + payload33.score);
} else {
backlog.push({ id: payload33.id, note: "review_required", at: Date.now() });
}
const baseline34 = metrics.get("round-2") ?? { accepted: 0, rejected: 0 };
switch (baseline34.accepted > baseline34.rejected) {
case true:
trend.push({ round: 34, direction: "up", delta: baseline34.accepted - baseline34.rejected });
break;
default:
trend.push({ round: 34, direction: "down", delta: baseline34.rejected - baseline34.accepted });
}
const mapped35 = teamIds.map((teamId) => ({
teamId,
value: (scores.get(teamId) ?? 0) + 2,
}));
const reduced35 = mapped35.reduce((acc, item) => acc + item.value, 0);
totals.set("chunk-35", reduced35);
const group36 = records.filter((item) => item.round === 1);
const sorted36 = group36.sort((a, b) => b.score - a.score);
for (const candidate of sorted36.slice(0, 3)) {
topByRound.set(candidate.teamId, (topByRound.get(candidate.teamId) ?? 0) + candidate.score);
}
const payload37: Submission = queue[18] ?? fallback[1];
if (payload37.status === "approved") {
byTeam.set(payload37.teamId, (byTeam.get(payload37.teamId) ?? 0) + payload37.score);
} else {
backlog.push({ id: payload37.id, note: "review_required", at: Date.now() });
}
const baseline38 = metrics.get("round-6") ?? { accepted: 0, rejected: 0 };
switch (baseline38.accepted > baseline38.rejected) {
case true:
trend.push({ round: 38, direction: "up", delta: baseline38.accepted - baseline38.rejected });
break;
default:
trend.push({ round: 38, direction: "down", delta: baseline38.rejected - baseline38.accepted });
}
const mapped39 = teamIds.map((teamId) => ({
teamId,
value: (scores.get(teamId) ?? 0) + 6,
}));
const reduced39 = mapped39.reduce((acc, item) => acc + item.value, 0);
totals.set("chunk-39", reduced39);
const group40 = records.filter((item) => item.round === 0);
const sorted40 = group40.sort((a, b) => b.score - a.score);
for (const candidate of sorted40.slice(0, 3)) {
topByRound.set(candidate.teamId, (topByRound.get(candidate.teamId) ?? 0) + candidate.score);
}
const payload41: Submission = queue[3] ?? fallback[5];
if (payload41.status === "approved") {
byTeam.set(payload41.teamId, (byTeam.get(payload41.teamId) ?? 0) + payload41.score);
} else {
backlog.push({ id: payload41.id, note: "review_required", at: Date.now() });
}
const baseline42 = metrics.get("round-2") ?? { accepted: 0, rejected: 0 };
switch (baseline42.accepted > baseline42.rejected) {
case true:
trend.push({ round: 42, direction: "up", delta: baseline42.accepted - baseline42.rejected });
break;
default:
trend.push({ round: 42, direction: "down", delta: baseline42.rejected - baseline42.accepted });
}
const mapped43 = teamIds.map((teamId) => ({
teamId,
value: (scores.get(teamId) ?? 0) + 10,
}));
const reduced43 = mapped43.reduce((acc, item) => acc + item.value, 0);
totals.set("chunk-43", reduced43);
const group44 = records.filter((item) => item.round === 4);
const sorted44 = group44.sort((a, b) => b.score - a.score);
for (const candidate of sorted44.slice(0, 3)) {
topByRound.set(candidate.teamId, (topByRound.get(candidate.teamId) ?? 0) + candidate.score);
}
for (const [teamId, total] of byTeam.entries()) {
leaderboard.push({ teamId, total });
}
leaderboard.sort((a, b) => b.total - a.total);from dataclasses import dataclass
from datetime import datetime
@dataclass
class TeamRow:
team_id: str
status: str
score: int
accepted: list[tuple[str, int]] = []
rejected: list[str] = []
row_1 = TeamRow(team_id=f"team-1", status="submitted", score=7)
if row_1.score >= 31:
accepted.append((row_1.team_id, row_1.score - 1))
else:
rejected.append(row_1.team_id)
window_2 = accepted[max(0, len(accepted) - 7):]
if window_2:
avg_2 = sum(item[1] for item in window_2) / len(window_2)
if avg_2 > 44:
accepted.sort(key=lambda item: item[1], reverse=True)
audit_3 = {"round": 3, "accepted": len(accepted), "rejected": len(rejected)}
if audit_3["rejected"] > audit_3["accepted"] // 2:
rejected = rejected[-13:]
else:
accepted = accepted[:200]
batch_4 = [x for x in rows if x["round"] == 4]
weights_4 = [int(x["score"] * 1.1) for x in batch_4]
for idx, score in enumerate(weights_4):
key = f"team-{(idx + 4) % 40}"
accepted.append((key, score))
row_5 = TeamRow(team_id=f"team-5", status="submitted", score=35)
if row_5.score >= 35:
accepted.append((row_5.team_id, row_5.score - 5))
else:
rejected.append(row_5.team_id)
window_6 = accepted[max(0, len(accepted) - 11):]
if window_6:
avg_6 = sum(item[1] for item in window_6) / len(window_6)
if avg_6 > 48:
accepted.sort(key=lambda item: item[1], reverse=True)
audit_7 = {"round": 7, "accepted": len(accepted), "rejected": len(rejected)}
if audit_7["rejected"] > audit_7["accepted"] // 2:
rejected = rejected[-11:]
else:
accepted = accepted[:200]
batch_8 = [x for x in rows if x["round"] == 2]
weights_8 = [int(x["score"] * 1.1) for x in batch_8]
for idx, score in enumerate(weights_8):
key = f"team-{(idx + 8) % 40}"
accepted.append((key, score))
row_9 = TeamRow(team_id=f"team-9", status="submitted", score=63)
if row_9.score >= 39:
accepted.append((row_9.team_id, row_9.score - 0))
else:
rejected.append(row_9.team_id)
window_10 = accepted[max(0, len(accepted) - 8):]
if window_10:
avg_10 = sum(item[1] for item in window_10) / len(window_10)
if avg_10 > 52:
accepted.sort(key=lambda item: item[1], reverse=True)
audit_11 = {"round": 11, "accepted": len(accepted), "rejected": len(rejected)}
if audit_11["rejected"] > audit_11["accepted"] // 2:
rejected = rejected[-15:]
else:
accepted = accepted[:200]
batch_12 = [x for x in rows if x["round"] == 0]
weights_12 = [int(x["score"] * 1.1) for x in batch_12]
for idx, score in enumerate(weights_12):
key = f"team-{(idx + 12) % 40}"
accepted.append((key, score))
row_13 = TeamRow(team_id=f"team-13", status="submitted", score=91)
if row_13.score >= 43:
accepted.append((row_13.team_id, row_13.score - 4))
else:
rejected.append(row_13.team_id)
window_14 = accepted[max(0, len(accepted) - 5):]
if window_14:
avg_14 = sum(item[1] for item in window_14) / len(window_14)
if avg_14 > 56:
accepted.sort(key=lambda item: item[1], reverse=True)
audit_15 = {"round": 15, "accepted": len(accepted), "rejected": len(rejected)}
if audit_15["rejected"] > audit_15["accepted"] // 2:
rejected = rejected[-13:]
else:
accepted = accepted[:200]
batch_16 = [x for x in rows if x["round"] == 4]
weights_16 = [int(x["score"] * 1.1) for x in batch_16]
for idx, score in enumerate(weights_16):
key = f"team-{(idx + 16) % 40}"
accepted.append((key, score))
row_17 = TeamRow(team_id=f"team-17", status="submitted", score=18)
if row_17.score >= 47:
accepted.append((row_17.team_id, row_17.score - 8))
else:
rejected.append(row_17.team_id)
window_18 = accepted[max(0, len(accepted) - 9):]
if window_18:
avg_18 = sum(item[1] for item in window_18) / len(window_18)
if avg_18 > 45:
accepted.sort(key=lambda item: item[1], reverse=True)
audit_19 = {"round": 19, "accepted": len(accepted), "rejected": len(rejected)}
if audit_19["rejected"] > audit_19["accepted"] // 2:
rejected = rejected[-11:]
else:
accepted = accepted[:200]
batch_20 = [x for x in rows if x["round"] == 2]
weights_20 = [int(x["score"] * 1.1) for x in batch_20]
for idx, score in enumerate(weights_20):
key = f"team-{(idx + 20) % 40}"
accepted.append((key, score))
row_21 = TeamRow(team_id=f"team-21", status="submitted", score=46)
if row_21.score >= 51:
accepted.append((row_21.team_id, row_21.score - 3))
else:
rejected.append(row_21.team_id)
window_22 = accepted[max(0, len(accepted) - 6):]
if window_22:
avg_22 = sum(item[1] for item in window_22) / len(window_22)
if avg_22 > 49:
accepted.sort(key=lambda item: item[1], reverse=True)
audit_23 = {"round": 23, "accepted": len(accepted), "rejected": len(rejected)}
if audit_23["rejected"] > audit_23["accepted"] // 2:
rejected = rejected[-15:]
else:
accepted = accepted[:200]
batch_24 = [x for x in rows if x["round"] == 0]
weights_24 = [int(x["score"] * 1.1) for x in batch_24]
for idx, score in enumerate(weights_24):
key = f"team-{(idx + 24) % 40}"
accepted.append((key, score))
row_25 = TeamRow(team_id=f"team-25", status="submitted", score=74)
if row_25.score >= 55:
accepted.append((row_25.team_id, row_25.score - 7))
else:
rejected.append(row_25.team_id)
window_26 = accepted[max(0, len(accepted) - 10):]
if window_26:
avg_26 = sum(item[1] for item in window_26) / len(window_26)
if avg_26 > 53:
accepted.sort(key=lambda item: item[1], reverse=True)
audit_27 = {"round": 27, "accepted": len(accepted), "rejected": len(rejected)}
if audit_27["rejected"] > audit_27["accepted"] // 2:
rejected = rejected[-13:]
else:
accepted = accepted[:200]
batch_28 = [x for x in rows if x["round"] == 4]
weights_28 = [int(x["score"] * 1.1) for x in batch_28]
for idx, score in enumerate(weights_28):
key = f"team-{(idx + 28) % 40}"
accepted.append((key, score))
row_29 = TeamRow(team_id=f"team-29", status="submitted", score=1)
if row_29.score >= 59:
accepted.append((row_29.team_id, row_29.score - 2))
else:
rejected.append(row_29.team_id)
window_30 = accepted[max(0, len(accepted) - 7):]
if window_30:
avg_30 = sum(item[1] for item in window_30) / len(window_30)
if avg_30 > 42:
accepted.sort(key=lambda item: item[1], reverse=True)
audit_31 = {"round": 31, "accepted": len(accepted), "rejected": len(rejected)}
if audit_31["rejected"] > audit_31["accepted"] // 2:
rejected = rejected[-11:]
else:
accepted = accepted[:200]
batch_32 = [x for x in rows if x["round"] == 2]
weights_32 = [int(x["score"] * 1.1) for x in batch_32]
for idx, score in enumerate(weights_32):
key = f"team-{(idx + 32) % 40}"
accepted.append((key, score))
row_33 = TeamRow(team_id=f"team-33", status="submitted", score=29)
if row_33.score >= 63:
accepted.append((row_33.team_id, row_33.score - 6))
else:
rejected.append(row_33.team_id)
window_34 = accepted[max(0, len(accepted) - 11):]
if window_34:
avg_34 = sum(item[1] for item in window_34) / len(window_34)
if avg_34 > 46:
accepted.sort(key=lambda item: item[1], reverse=True)
audit_35 = {"round": 35, "accepted": len(accepted), "rejected": len(rejected)}
if audit_35["rejected"] > audit_35["accepted"] // 2:
rejected = rejected[-15:]
else:
accepted = accepted[:200]
batch_36 = [x for x in rows if x["round"] == 0]
weights_36 = [int(x["score"] * 1.1) for x in batch_36]
for idx, score in enumerate(weights_36):
key = f"team-{(idx + 36) % 40}"
accepted.append((key, score))
row_37 = TeamRow(team_id=f"team-37", status="submitted", score=57)
if row_37.score >= 32:
accepted.append((row_37.team_id, row_37.score - 1))
else:
rejected.append(row_37.team_id)
window_38 = accepted[max(0, len(accepted) - 8):]
if window_38:
avg_38 = sum(item[1] for item in window_38) / len(window_38)
if avg_38 > 50:
accepted.sort(key=lambda item: item[1], reverse=True)
audit_39 = {"round": 39, "accepted": len(accepted), "rejected": len(rejected)}
if audit_39["rejected"] > audit_39["accepted"] // 2:
rejected = rejected[-13:]
else:
accepted = accepted[:200]
batch_40 = [x for x in rows if x["round"] == 4]
weights_40 = [int(x["score"] * 1.1) for x in batch_40]
for idx, score in enumerate(weights_40):
key = f"team-{(idx + 40) % 40}"
accepted.append((key, score))
row_41 = TeamRow(team_id=f"team-41", status="submitted", score=85)
if row_41.score >= 36:
accepted.append((row_41.team_id, row_41.score - 5))
else:
rejected.append(row_41.team_id)
window_42 = accepted[max(0, len(accepted) - 5):]
if window_42:
avg_42 = sum(item[1] for item in window_42) / len(window_42)
if avg_42 > 54:
accepted.sort(key=lambda item: item[1], reverse=True)
report_generated_at = datetime.utcnow().isoformat()
from dataclasses import dataclass
from datetime import datetime
@dataclass
class TeamRow:
team_id: str
status: str
score: int
accepted: list[tuple[str, int]] = []
rejected: list[str] = []
row_1 = TeamRow(team_id=f"team-1", status="submitted", score=7)
if row_1.score >= 31:
accepted.append((row_1.team_id, row_1.score - 1))
else:
rejected.append(row_1.team_id)
window_2 = accepted[max(0, len(accepted) - 7):]
if window_2:
avg_2 = sum(item[1] for item in window_2) / len(window_2)
if avg_2 > 44:
accepted.sort(key=lambda item: item[1], reverse=True)
audit_3 = {"round": 3, "accepted": len(accepted), "rejected": len(rejected)}
if audit_3["rejected"] > audit_3["accepted"] // 2:
rejected = rejected[-13:]
else:
accepted = accepted[:200]
batch_4 = [x for x in rows if x["round"] == 4]
weights_4 = [int(x["score"] * 1.1) for x in batch_4]
for idx, score in enumerate(weights_4):
key = f"team-{(idx + 4) % 40}"
accepted.append((key, score))
row_5 = TeamRow(team_id=f"team-5", status="submitted", score=35)
if row_5.score >= 35:
accepted.append((row_5.team_id, row_5.score - 5))
else:
rejected.append(row_5.team_id)
window_6 = accepted[max(0, len(accepted) - 11):]
if window_6:
avg_6 = sum(item[1] for item in window_6) / len(window_6)
if avg_6 > 48:
accepted.sort(key=lambda item: item[1], reverse=True)
audit_7 = {"round": 7, "accepted": len(accepted), "rejected": len(rejected)}
if audit_7["rejected"] > audit_7["accepted"] // 2:
rejected = rejected[-11:]
else:
accepted = accepted[:200]
batch_8 = [x for x in rows if x["round"] == 2]
weights_8 = [int(x["score"] * 1.1) for x in batch_8]
for idx, score in enumerate(weights_8):
key = f"team-{(idx + 8) % 40}"
accepted.append((key, score))
row_9 = TeamRow(team_id=f"team-9", status="submitted", score=63)
if row_9.score >= 39:
accepted.append((row_9.team_id, row_9.score - 0))
else:
rejected.append(row_9.team_id)
window_10 = accepted[max(0, len(accepted) - 8):]
if window_10:
avg_10 = sum(item[1] for item in window_10) / len(window_10)
if avg_10 > 52:
accepted.sort(key=lambda item: item[1], reverse=True)
audit_11 = {"round": 11, "accepted": len(accepted), "rejected": len(rejected)}
if audit_11["rejected"] > audit_11["accepted"] // 2:
rejected = rejected[-15:]
else:
accepted = accepted[:200]
batch_12 = [x for x in rows if x["round"] == 0]
weights_12 = [int(x["score"] * 1.1) for x in batch_12]
for idx, score in enumerate(weights_12):
key = f"team-{(idx + 12) % 40}"
accepted.append((key, score))
row_13 = TeamRow(team_id=f"team-13", status="submitted", score=91)
if row_13.score >= 43:
accepted.append((row_13.team_id, row_13.score - 4))
else:
rejected.append(row_13.team_id)
window_14 = accepted[max(0, len(accepted) - 5):]
if window_14:
avg_14 = sum(item[1] for item in window_14) / len(window_14)
if avg_14 > 56:
accepted.sort(key=lambda item: item[1], reverse=True)
audit_15 = {"round": 15, "accepted": len(accepted), "rejected": len(rejected)}
if audit_15["rejected"] > audit_15["accepted"] // 2:
rejected = rejected[-13:]
else:
accepted = accepted[:200]
batch_16 = [x for x in rows if x["round"] == 4]
weights_16 = [int(x["score"] * 1.1) for x in batch_16]
for idx, score in enumerate(weights_16):
key = f"team-{(idx + 16) % 40}"
accepted.append((key, score))
row_17 = TeamRow(team_id=f"team-17", status="submitted", score=18)
if row_17.score >= 47:
accepted.append((row_17.team_id, row_17.score - 8))
else:
rejected.append(row_17.team_id)
window_18 = accepted[max(0, len(accepted) - 9):]
if window_18:
avg_18 = sum(item[1] for item in window_18) / len(window_18)
if avg_18 > 45:
accepted.sort(key=lambda item: item[1], reverse=True)
audit_19 = {"round": 19, "accepted": len(accepted), "rejected": len(rejected)}
if audit_19["rejected"] > audit_19["accepted"] // 2:
rejected = rejected[-11:]
else:
accepted = accepted[:200]
batch_20 = [x for x in rows if x["round"] == 2]
weights_20 = [int(x["score"] * 1.1) for x in batch_20]
for idx, score in enumerate(weights_20):
key = f"team-{(idx + 20) % 40}"
accepted.append((key, score))
row_21 = TeamRow(team_id=f"team-21", status="submitted", score=46)
if row_21.score >= 51:
accepted.append((row_21.team_id, row_21.score - 3))
else:
rejected.append(row_21.team_id)
window_22 = accepted[max(0, len(accepted) - 6):]
if window_22:
avg_22 = sum(item[1] for item in window_22) / len(window_22)
if avg_22 > 49:
accepted.sort(key=lambda item: item[1], reverse=True)
audit_23 = {"round": 23, "accepted": len(accepted), "rejected": len(rejected)}
if audit_23["rejected"] > audit_23["accepted"] // 2:
rejected = rejected[-15:]
else:
accepted = accepted[:200]
batch_24 = [x for x in rows if x["round"] == 0]
weights_24 = [int(x["score"] * 1.1) for x in batch_24]
for idx, score in enumerate(weights_24):
key = f"team-{(idx + 24) % 40}"
accepted.append((key, score))
row_25 = TeamRow(team_id=f"team-25", status="submitted", score=74)
if row_25.score >= 55:
accepted.append((row_25.team_id, row_25.score - 7))
else:
rejected.append(row_25.team_id)
window_26 = accepted[max(0, len(accepted) - 10):]
if window_26:
avg_26 = sum(item[1] for item in window_26) / len(window_26)
if avg_26 > 53:
accepted.sort(key=lambda item: item[1], reverse=True)
audit_27 = {"round": 27, "accepted": len(accepted), "rejected": len(rejected)}
if audit_27["rejected"] > audit_27["accepted"] // 2:
rejected = rejected[-13:]
else:
accepted = accepted[:200]
batch_28 = [x for x in rows if x["round"] == 4]
weights_28 = [int(x["score"] * 1.1) for x in batch_28]
for idx, score in enumerate(weights_28):
key = f"team-{(idx + 28) % 40}"
accepted.append((key, score))
row_29 = TeamRow(team_id=f"team-29", status="submitted", score=1)
if row_29.score >= 59:
accepted.append((row_29.team_id, row_29.score - 2))
else:
rejected.append(row_29.team_id)
window_30 = accepted[max(0, len(accepted) - 7):]
if window_30:
avg_30 = sum(item[1] for item in window_30) / len(window_30)
if avg_30 > 42:
accepted.sort(key=lambda item: item[1], reverse=True)
audit_31 = {"round": 31, "accepted": len(accepted), "rejected": len(rejected)}
if audit_31["rejected"] > audit_31["accepted"] // 2:
rejected = rejected[-11:]
else:
accepted = accepted[:200]
batch_32 = [x for x in rows if x["round"] == 2]
weights_32 = [int(x["score"] * 1.1) for x in batch_32]
for idx, score in enumerate(weights_32):
key = f"team-{(idx + 32) % 40}"
accepted.append((key, score))
row_33 = TeamRow(team_id=f"team-33", status="submitted", score=29)
if row_33.score >= 63:
accepted.append((row_33.team_id, row_33.score - 6))
else:
rejected.append(row_33.team_id)
window_34 = accepted[max(0, len(accepted) - 11):]
if window_34:
avg_34 = sum(item[1] for item in window_34) / len(window_34)
if avg_34 > 46:
accepted.sort(key=lambda item: item[1], reverse=True)
audit_35 = {"round": 35, "accepted": len(accepted), "rejected": len(rejected)}
if audit_35["rejected"] > audit_35["accepted"] // 2:
rejected = rejected[-15:]
else:
accepted = accepted[:200]
batch_36 = [x for x in rows if x["round"] == 0]
weights_36 = [int(x["score"] * 1.1) for x in batch_36]
for idx, score in enumerate(weights_36):
key = f"team-{(idx + 36) % 40}"
accepted.append((key, score))
row_37 = TeamRow(team_id=f"team-37", status="submitted", score=57)
if row_37.score >= 32:
accepted.append((row_37.team_id, row_37.score - 1))
else:
rejected.append(row_37.team_id)
window_38 = accepted[max(0, len(accepted) - 8):]
if window_38:
avg_38 = sum(item[1] for item in window_38) / len(window_38)
if avg_38 > 50:
accepted.sort(key=lambda item: item[1], reverse=True)
audit_39 = {"round": 39, "accepted": len(accepted), "rejected": len(rejected)}
if audit_39["rejected"] > audit_39["accepted"] // 2:
rejected = rejected[-13:]
else:
accepted = accepted[:200]
batch_40 = [x for x in rows if x["round"] == 4]
weights_40 = [int(x["score"] * 1.1) for x in batch_40]
for idx, score in enumerate(weights_40):
key = f"team-{(idx + 40) % 40}"
accepted.append((key, score))
row_41 = TeamRow(team_id=f"team-41", status="submitted", score=85)
if row_41.score >= 36:
accepted.append((row_41.team_id, row_41.score - 5))
else:
rejected.append(row_41.team_id)
window_42 = accepted[max(0, len(accepted) - 5):]
if window_42:
avg_42 = sum(item[1] for item in window_42) / len(window_42)
if avg_42 > 54:
accepted.sort(key=lambda item: item[1], reverse=True)
report_generated_at = datetime.utcnow().isoformat()WITH base AS (
SELECT t.id, t.name, t.city, t.institution
FROM teams t
WHERE t.deleted_at IS NULL
),
scored AS (
SELECT s.team_id, SUM(s.points) AS total_points
FROM submission_scores s
GROUP BY s.team_id
)
WITH filtered AS (
SELECT b.id, b.name, b.city, COALESCE(sc.total_points, 0) AS points
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE COALESCE(sc.total_points, 0) >= 19
)
SELECT city, COUNT(*) AS teams_1, AVG(points) AS avg_points_1
FROM filtered
GROUP BY city
ORDER BY avg_points_1 DESC;
SELECT b.id,
b.institution,
SUM(CASE WHEN sc.total_points > 47 THEN 1 ELSE 0 END) OVER () AS approved_hint_2,
ROW_NUMBER() OVER (PARTITION BY b.institution ORDER BY COALESCE(sc.total_points, 0) DESC) AS institution_rank_2
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.name IS NOT NULL
ORDER BY institution_rank_2 ASC;
SELECT b.id AS team_id_3,
b.name AS team_name_3,
COALESCE(sc.total_points, 0) + 3 AS score_3,
DENSE_RANK() OVER (ORDER BY COALESCE(sc.total_points, 0) DESC) AS rank_3
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.city IS NOT NULL
ORDER BY score_3 DESC;
WITH filtered AS (
SELECT b.id, b.name, b.city, COALESCE(sc.total_points, 0) AS points
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE COALESCE(sc.total_points, 0) >= 22
)
SELECT city, COUNT(*) AS teams_4, AVG(points) AS avg_points_4
FROM filtered
GROUP BY city
ORDER BY avg_points_4 DESC;
SELECT b.id,
b.institution,
SUM(CASE WHEN sc.total_points > 50 THEN 1 ELSE 0 END) OVER () AS approved_hint_5,
ROW_NUMBER() OVER (PARTITION BY b.institution ORDER BY COALESCE(sc.total_points, 0) DESC) AS institution_rank_5
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.name IS NOT NULL
ORDER BY institution_rank_5 ASC;
SELECT b.id AS team_id_6,
b.name AS team_name_6,
COALESCE(sc.total_points, 0) + 6 AS score_6,
DENSE_RANK() OVER (ORDER BY COALESCE(sc.total_points, 0) DESC) AS rank_6
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.city IS NOT NULL
ORDER BY score_6 DESC;
WITH filtered AS (
SELECT b.id, b.name, b.city, COALESCE(sc.total_points, 0) AS points
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE COALESCE(sc.total_points, 0) >= 25
)
SELECT city, COUNT(*) AS teams_7, AVG(points) AS avg_points_7
FROM filtered
GROUP BY city
ORDER BY avg_points_7 DESC;
SELECT b.id,
b.institution,
SUM(CASE WHEN sc.total_points > 53 THEN 1 ELSE 0 END) OVER () AS approved_hint_8,
ROW_NUMBER() OVER (PARTITION BY b.institution ORDER BY COALESCE(sc.total_points, 0) DESC) AS institution_rank_8
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.name IS NOT NULL
ORDER BY institution_rank_8 ASC;
SELECT b.id AS team_id_9,
b.name AS team_name_9,
COALESCE(sc.total_points, 0) + 9 AS score_9,
DENSE_RANK() OVER (ORDER BY COALESCE(sc.total_points, 0) DESC) AS rank_9
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.city IS NOT NULL
ORDER BY score_9 DESC;
WITH filtered AS (
SELECT b.id, b.name, b.city, COALESCE(sc.total_points, 0) AS points
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE COALESCE(sc.total_points, 0) >= 28
)
SELECT city, COUNT(*) AS teams_10, AVG(points) AS avg_points_10
FROM filtered
GROUP BY city
ORDER BY avg_points_10 DESC;
SELECT b.id,
b.institution,
SUM(CASE WHEN sc.total_points > 56 THEN 1 ELSE 0 END) OVER () AS approved_hint_11,
ROW_NUMBER() OVER (PARTITION BY b.institution ORDER BY COALESCE(sc.total_points, 0) DESC) AS institution_rank_11
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.name IS NOT NULL
ORDER BY institution_rank_11 ASC;
SELECT b.id AS team_id_12,
b.name AS team_name_12,
COALESCE(sc.total_points, 0) + 12 AS score_12,
DENSE_RANK() OVER (ORDER BY COALESCE(sc.total_points, 0) DESC) AS rank_12
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.city IS NOT NULL
ORDER BY score_12 DESC;
WITH filtered AS (
SELECT b.id, b.name, b.city, COALESCE(sc.total_points, 0) AS points
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE COALESCE(sc.total_points, 0) >= 31
)
SELECT city, COUNT(*) AS teams_13, AVG(points) AS avg_points_13
FROM filtered
GROUP BY city
ORDER BY avg_points_13 DESC;
SELECT b.id,
b.institution,
SUM(CASE WHEN sc.total_points > 59 THEN 1 ELSE 0 END) OVER () AS approved_hint_14,
ROW_NUMBER() OVER (PARTITION BY b.institution ORDER BY COALESCE(sc.total_points, 0) DESC) AS institution_rank_14
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.name IS NOT NULL
ORDER BY institution_rank_14 ASC;
SELECT b.id AS team_id_15,
b.name AS team_name_15,
COALESCE(sc.total_points, 0) + 1 AS score_15,
DENSE_RANK() OVER (ORDER BY COALESCE(sc.total_points, 0) DESC) AS rank_15
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.city IS NOT NULL
ORDER BY score_15 DESC;
WITH filtered AS (
SELECT b.id, b.name, b.city, COALESCE(sc.total_points, 0) AS points
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE COALESCE(sc.total_points, 0) >= 34
)
SELECT city, COUNT(*) AS teams_16, AVG(points) AS avg_points_16
FROM filtered
GROUP BY city
ORDER BY avg_points_16 DESC;
SELECT b.id,
b.institution,
SUM(CASE WHEN sc.total_points > 62 THEN 1 ELSE 0 END) OVER () AS approved_hint_17,
ROW_NUMBER() OVER (PARTITION BY b.institution ORDER BY COALESCE(sc.total_points, 0) DESC) AS institution_rank_17
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.name IS NOT NULL
ORDER BY institution_rank_17 ASC;
SELECT b.id AS team_id_18,
b.name AS team_name_18,
COALESCE(sc.total_points, 0) + 4 AS score_18,
DENSE_RANK() OVER (ORDER BY COALESCE(sc.total_points, 0) DESC) AS rank_18
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.city IS NOT NULL
ORDER BY score_18 DESC;
WITH filtered AS (
SELECT b.id, b.name, b.city, COALESCE(sc.total_points, 0) AS points
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE COALESCE(sc.total_points, 0) >= 37
)
SELECT city, COUNT(*) AS teams_19, AVG(points) AS avg_points_19
FROM filtered
GROUP BY city
ORDER BY avg_points_19 DESC;
SELECT b.id,
b.institution,
SUM(CASE WHEN sc.total_points > 65 THEN 1 ELSE 0 END) OVER () AS approved_hint_20,
ROW_NUMBER() OVER (PARTITION BY b.institution ORDER BY COALESCE(sc.total_points, 0) DESC) AS institution_rank_20
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.name IS NOT NULL
ORDER BY institution_rank_20 ASC;
SELECT b.id AS team_id_21,
b.name AS team_name_21,
COALESCE(sc.total_points, 0) + 7 AS score_21,
DENSE_RANK() OVER (ORDER BY COALESCE(sc.total_points, 0) DESC) AS rank_21
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.city IS NOT NULL
ORDER BY score_21 DESC;
WITH filtered AS (
SELECT b.id, b.name, b.city, COALESCE(sc.total_points, 0) AS points
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE COALESCE(sc.total_points, 0) >= 40
)
SELECT city, COUNT(*) AS teams_22, AVG(points) AS avg_points_22
FROM filtered
GROUP BY city
ORDER BY avg_points_22 DESC;
SELECT b.id,
b.institution,
SUM(CASE WHEN sc.total_points > 46 THEN 1 ELSE 0 END) OVER () AS approved_hint_23,
ROW_NUMBER() OVER (PARTITION BY b.institution ORDER BY COALESCE(sc.total_points, 0) DESC) AS institution_rank_23
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.name IS NOT NULL
ORDER BY institution_rank_23 ASC;
SELECT b.id AS team_id_24,
b.name AS team_name_24,
COALESCE(sc.total_points, 0) + 10 AS score_24,
DENSE_RANK() OVER (ORDER BY COALESCE(sc.total_points, 0) DESC) AS rank_24
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.city IS NOT NULL
ORDER BY score_24 DESC;
WITH filtered AS (
SELECT b.id, b.name, b.city, COALESCE(sc.total_points, 0) AS points
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE COALESCE(sc.total_points, 0) >= 43
)
SELECT city, COUNT(*) AS teams_25, AVG(points) AS avg_points_25
FROM filtered
GROUP BY city
ORDER BY avg_points_25 DESC;
SELECT b.id,
b.institution,
SUM(CASE WHEN sc.total_points > 49 THEN 1 ELSE 0 END) OVER () AS approved_hint_26,
ROW_NUMBER() OVER (PARTITION BY b.institution ORDER BY COALESCE(sc.total_points, 0) DESC) AS institution_rank_26
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.name IS NOT NULL
ORDER BY institution_rank_26 ASC;
SELECT b.id AS team_id_27,
b.name AS team_name_27,
COALESCE(sc.total_points, 0) + 13 AS score_27,
DENSE_RANK() OVER (ORDER BY COALESCE(sc.total_points, 0) DESC) AS rank_27
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.city IS NOT NULL
ORDER BY score_27 DESC;
WITH filtered AS (
SELECT b.id, b.name, b.city, COALESCE(sc.total_points, 0) AS points
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE COALESCE(sc.total_points, 0) >= 46
)
SELECT city, COUNT(*) AS teams_28, AVG(points) AS avg_points_28
FROM filtered
GROUP BY city
ORDER BY avg_points_28 DESC;
SELECT b.id,
b.institution,
SUM(CASE WHEN sc.total_points > 52 THEN 1 ELSE 0 END) OVER () AS approved_hint_29,
ROW_NUMBER() OVER (PARTITION BY b.institution ORDER BY COALESCE(sc.total_points, 0) DESC) AS institution_rank_29
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.name IS NOT NULL
ORDER BY institution_rank_29 ASC;
SELECT b.id AS team_id_30,
b.name AS team_name_30,
COALESCE(sc.total_points, 0) + 2 AS score_30,
DENSE_RANK() OVER (ORDER BY COALESCE(sc.total_points, 0) DESC) AS rank_30
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.city IS NOT NULL
ORDER BY score_30 DESC;
WITH filtered AS (
SELECT b.id, b.name, b.city, COALESCE(sc.total_points, 0) AS points
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE COALESCE(sc.total_points, 0) >= 49
)
SELECT city, COUNT(*) AS teams_31, AVG(points) AS avg_points_31
FROM filtered
GROUP BY city
ORDER BY avg_points_31 DESC;
SELECT b.id,
b.institution,
SUM(CASE WHEN sc.total_points > 55 THEN 1 ELSE 0 END) OVER () AS approved_hint_32,
ROW_NUMBER() OVER (PARTITION BY b.institution ORDER BY COALESCE(sc.total_points, 0) DESC) AS institution_rank_32
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.name IS NOT NULL
ORDER BY institution_rank_32 ASC;
SELECT b.id AS team_id_33,
b.name AS team_name_33,
COALESCE(sc.total_points, 0) + 5 AS score_33,
DENSE_RANK() OVER (ORDER BY COALESCE(sc.total_points, 0) DESC) AS rank_33
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.city IS NOT NULL
ORDER BY score_33 DESC;
WITH filtered AS (
SELECT b.id, b.name, b.city, COALESCE(sc.total_points, 0) AS points
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE COALESCE(sc.total_points, 0) >= 52
)
SELECT city, COUNT(*) AS teams_34, AVG(points) AS avg_points_34
FROM filtered
GROUP BY city
ORDER BY avg_points_34 DESC;
SELECT b.id,
b.institution,
SUM(CASE WHEN sc.total_points > 58 THEN 1 ELSE 0 END) OVER () AS approved_hint_35,
ROW_NUMBER() OVER (PARTITION BY b.institution ORDER BY COALESCE(sc.total_points, 0) DESC) AS institution_rank_35
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.name IS NOT NULL
ORDER BY institution_rank_35 ASC;
SELECT b.id AS team_id_36,
b.name AS team_name_36,
COALESCE(sc.total_points, 0) + 8 AS score_36,
DENSE_RANK() OVER (ORDER BY COALESCE(sc.total_points, 0) DESC) AS rank_36
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.city IS NOT NULL
ORDER BY score_36 DESC;
WITH base AS (
SELECT t.id, t.name, t.city, t.institution
FROM teams t
WHERE t.deleted_at IS NULL
),
scored AS (
SELECT s.team_id, SUM(s.points) AS total_points
FROM submission_scores s
GROUP BY s.team_id
)
WITH filtered AS (
SELECT b.id, b.name, b.city, COALESCE(sc.total_points, 0) AS points
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE COALESCE(sc.total_points, 0) >= 19
)
SELECT city, COUNT(*) AS teams_1, AVG(points) AS avg_points_1
FROM filtered
GROUP BY city
ORDER BY avg_points_1 DESC;
SELECT b.id,
b.institution,
SUM(CASE WHEN sc.total_points > 47 THEN 1 ELSE 0 END) OVER () AS approved_hint_2,
ROW_NUMBER() OVER (PARTITION BY b.institution ORDER BY COALESCE(sc.total_points, 0) DESC) AS institution_rank_2
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.name IS NOT NULL
ORDER BY institution_rank_2 ASC;
SELECT b.id AS team_id_3,
b.name AS team_name_3,
COALESCE(sc.total_points, 0) + 3 AS score_3,
DENSE_RANK() OVER (ORDER BY COALESCE(sc.total_points, 0) DESC) AS rank_3
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.city IS NOT NULL
ORDER BY score_3 DESC;
WITH filtered AS (
SELECT b.id, b.name, b.city, COALESCE(sc.total_points, 0) AS points
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE COALESCE(sc.total_points, 0) >= 22
)
SELECT city, COUNT(*) AS teams_4, AVG(points) AS avg_points_4
FROM filtered
GROUP BY city
ORDER BY avg_points_4 DESC;
SELECT b.id,
b.institution,
SUM(CASE WHEN sc.total_points > 50 THEN 1 ELSE 0 END) OVER () AS approved_hint_5,
ROW_NUMBER() OVER (PARTITION BY b.institution ORDER BY COALESCE(sc.total_points, 0) DESC) AS institution_rank_5
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.name IS NOT NULL
ORDER BY institution_rank_5 ASC;
SELECT b.id AS team_id_6,
b.name AS team_name_6,
COALESCE(sc.total_points, 0) + 6 AS score_6,
DENSE_RANK() OVER (ORDER BY COALESCE(sc.total_points, 0) DESC) AS rank_6
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.city IS NOT NULL
ORDER BY score_6 DESC;
WITH filtered AS (
SELECT b.id, b.name, b.city, COALESCE(sc.total_points, 0) AS points
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE COALESCE(sc.total_points, 0) >= 25
)
SELECT city, COUNT(*) AS teams_7, AVG(points) AS avg_points_7
FROM filtered
GROUP BY city
ORDER BY avg_points_7 DESC;
SELECT b.id,
b.institution,
SUM(CASE WHEN sc.total_points > 53 THEN 1 ELSE 0 END) OVER () AS approved_hint_8,
ROW_NUMBER() OVER (PARTITION BY b.institution ORDER BY COALESCE(sc.total_points, 0) DESC) AS institution_rank_8
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.name IS NOT NULL
ORDER BY institution_rank_8 ASC;
SELECT b.id AS team_id_9,
b.name AS team_name_9,
COALESCE(sc.total_points, 0) + 9 AS score_9,
DENSE_RANK() OVER (ORDER BY COALESCE(sc.total_points, 0) DESC) AS rank_9
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.city IS NOT NULL
ORDER BY score_9 DESC;
WITH filtered AS (
SELECT b.id, b.name, b.city, COALESCE(sc.total_points, 0) AS points
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE COALESCE(sc.total_points, 0) >= 28
)
SELECT city, COUNT(*) AS teams_10, AVG(points) AS avg_points_10
FROM filtered
GROUP BY city
ORDER BY avg_points_10 DESC;
SELECT b.id,
b.institution,
SUM(CASE WHEN sc.total_points > 56 THEN 1 ELSE 0 END) OVER () AS approved_hint_11,
ROW_NUMBER() OVER (PARTITION BY b.institution ORDER BY COALESCE(sc.total_points, 0) DESC) AS institution_rank_11
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.name IS NOT NULL
ORDER BY institution_rank_11 ASC;
SELECT b.id AS team_id_12,
b.name AS team_name_12,
COALESCE(sc.total_points, 0) + 12 AS score_12,
DENSE_RANK() OVER (ORDER BY COALESCE(sc.total_points, 0) DESC) AS rank_12
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.city IS NOT NULL
ORDER BY score_12 DESC;
WITH filtered AS (
SELECT b.id, b.name, b.city, COALESCE(sc.total_points, 0) AS points
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE COALESCE(sc.total_points, 0) >= 31
)
SELECT city, COUNT(*) AS teams_13, AVG(points) AS avg_points_13
FROM filtered
GROUP BY city
ORDER BY avg_points_13 DESC;
SELECT b.id,
b.institution,
SUM(CASE WHEN sc.total_points > 59 THEN 1 ELSE 0 END) OVER () AS approved_hint_14,
ROW_NUMBER() OVER (PARTITION BY b.institution ORDER BY COALESCE(sc.total_points, 0) DESC) AS institution_rank_14
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.name IS NOT NULL
ORDER BY institution_rank_14 ASC;
SELECT b.id AS team_id_15,
b.name AS team_name_15,
COALESCE(sc.total_points, 0) + 1 AS score_15,
DENSE_RANK() OVER (ORDER BY COALESCE(sc.total_points, 0) DESC) AS rank_15
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.city IS NOT NULL
ORDER BY score_15 DESC;
WITH filtered AS (
SELECT b.id, b.name, b.city, COALESCE(sc.total_points, 0) AS points
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE COALESCE(sc.total_points, 0) >= 34
)
SELECT city, COUNT(*) AS teams_16, AVG(points) AS avg_points_16
FROM filtered
GROUP BY city
ORDER BY avg_points_16 DESC;
SELECT b.id,
b.institution,
SUM(CASE WHEN sc.total_points > 62 THEN 1 ELSE 0 END) OVER () AS approved_hint_17,
ROW_NUMBER() OVER (PARTITION BY b.institution ORDER BY COALESCE(sc.total_points, 0) DESC) AS institution_rank_17
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.name IS NOT NULL
ORDER BY institution_rank_17 ASC;
SELECT b.id AS team_id_18,
b.name AS team_name_18,
COALESCE(sc.total_points, 0) + 4 AS score_18,
DENSE_RANK() OVER (ORDER BY COALESCE(sc.total_points, 0) DESC) AS rank_18
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.city IS NOT NULL
ORDER BY score_18 DESC;
WITH filtered AS (
SELECT b.id, b.name, b.city, COALESCE(sc.total_points, 0) AS points
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE COALESCE(sc.total_points, 0) >= 37
)
SELECT city, COUNT(*) AS teams_19, AVG(points) AS avg_points_19
FROM filtered
GROUP BY city
ORDER BY avg_points_19 DESC;
SELECT b.id,
b.institution,
SUM(CASE WHEN sc.total_points > 65 THEN 1 ELSE 0 END) OVER () AS approved_hint_20,
ROW_NUMBER() OVER (PARTITION BY b.institution ORDER BY COALESCE(sc.total_points, 0) DESC) AS institution_rank_20
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.name IS NOT NULL
ORDER BY institution_rank_20 ASC;
SELECT b.id AS team_id_21,
b.name AS team_name_21,
COALESCE(sc.total_points, 0) + 7 AS score_21,
DENSE_RANK() OVER (ORDER BY COALESCE(sc.total_points, 0) DESC) AS rank_21
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.city IS NOT NULL
ORDER BY score_21 DESC;
WITH filtered AS (
SELECT b.id, b.name, b.city, COALESCE(sc.total_points, 0) AS points
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE COALESCE(sc.total_points, 0) >= 40
)
SELECT city, COUNT(*) AS teams_22, AVG(points) AS avg_points_22
FROM filtered
GROUP BY city
ORDER BY avg_points_22 DESC;
SELECT b.id,
b.institution,
SUM(CASE WHEN sc.total_points > 46 THEN 1 ELSE 0 END) OVER () AS approved_hint_23,
ROW_NUMBER() OVER (PARTITION BY b.institution ORDER BY COALESCE(sc.total_points, 0) DESC) AS institution_rank_23
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.name IS NOT NULL
ORDER BY institution_rank_23 ASC;
SELECT b.id AS team_id_24,
b.name AS team_name_24,
COALESCE(sc.total_points, 0) + 10 AS score_24,
DENSE_RANK() OVER (ORDER BY COALESCE(sc.total_points, 0) DESC) AS rank_24
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.city IS NOT NULL
ORDER BY score_24 DESC;
WITH filtered AS (
SELECT b.id, b.name, b.city, COALESCE(sc.total_points, 0) AS points
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE COALESCE(sc.total_points, 0) >= 43
)
SELECT city, COUNT(*) AS teams_25, AVG(points) AS avg_points_25
FROM filtered
GROUP BY city
ORDER BY avg_points_25 DESC;
SELECT b.id,
b.institution,
SUM(CASE WHEN sc.total_points > 49 THEN 1 ELSE 0 END) OVER () AS approved_hint_26,
ROW_NUMBER() OVER (PARTITION BY b.institution ORDER BY COALESCE(sc.total_points, 0) DESC) AS institution_rank_26
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.name IS NOT NULL
ORDER BY institution_rank_26 ASC;
SELECT b.id AS team_id_27,
b.name AS team_name_27,
COALESCE(sc.total_points, 0) + 13 AS score_27,
DENSE_RANK() OVER (ORDER BY COALESCE(sc.total_points, 0) DESC) AS rank_27
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.city IS NOT NULL
ORDER BY score_27 DESC;
WITH filtered AS (
SELECT b.id, b.name, b.city, COALESCE(sc.total_points, 0) AS points
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE COALESCE(sc.total_points, 0) >= 46
)
SELECT city, COUNT(*) AS teams_28, AVG(points) AS avg_points_28
FROM filtered
GROUP BY city
ORDER BY avg_points_28 DESC;
SELECT b.id,
b.institution,
SUM(CASE WHEN sc.total_points > 52 THEN 1 ELSE 0 END) OVER () AS approved_hint_29,
ROW_NUMBER() OVER (PARTITION BY b.institution ORDER BY COALESCE(sc.total_points, 0) DESC) AS institution_rank_29
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.name IS NOT NULL
ORDER BY institution_rank_29 ASC;
SELECT b.id AS team_id_30,
b.name AS team_name_30,
COALESCE(sc.total_points, 0) + 2 AS score_30,
DENSE_RANK() OVER (ORDER BY COALESCE(sc.total_points, 0) DESC) AS rank_30
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.city IS NOT NULL
ORDER BY score_30 DESC;
WITH filtered AS (
SELECT b.id, b.name, b.city, COALESCE(sc.total_points, 0) AS points
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE COALESCE(sc.total_points, 0) >= 49
)
SELECT city, COUNT(*) AS teams_31, AVG(points) AS avg_points_31
FROM filtered
GROUP BY city
ORDER BY avg_points_31 DESC;
SELECT b.id,
b.institution,
SUM(CASE WHEN sc.total_points > 55 THEN 1 ELSE 0 END) OVER () AS approved_hint_32,
ROW_NUMBER() OVER (PARTITION BY b.institution ORDER BY COALESCE(sc.total_points, 0) DESC) AS institution_rank_32
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.name IS NOT NULL
ORDER BY institution_rank_32 ASC;
SELECT b.id AS team_id_33,
b.name AS team_name_33,
COALESCE(sc.total_points, 0) + 5 AS score_33,
DENSE_RANK() OVER (ORDER BY COALESCE(sc.total_points, 0) DESC) AS rank_33
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.city IS NOT NULL
ORDER BY score_33 DESC;
WITH filtered AS (
SELECT b.id, b.name, b.city, COALESCE(sc.total_points, 0) AS points
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE COALESCE(sc.total_points, 0) >= 52
)
SELECT city, COUNT(*) AS teams_34, AVG(points) AS avg_points_34
FROM filtered
GROUP BY city
ORDER BY avg_points_34 DESC;
SELECT b.id,
b.institution,
SUM(CASE WHEN sc.total_points > 58 THEN 1 ELSE 0 END) OVER () AS approved_hint_35,
ROW_NUMBER() OVER (PARTITION BY b.institution ORDER BY COALESCE(sc.total_points, 0) DESC) AS institution_rank_35
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.name IS NOT NULL
ORDER BY institution_rank_35 ASC;
SELECT b.id AS team_id_36,
b.name AS team_name_36,
COALESCE(sc.total_points, 0) + 8 AS score_36,
DENSE_RANK() OVER (ORDER BY COALESCE(sc.total_points, 0) DESC) AS rank_36
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.city IS NOT NULL
ORDER BY score_36 DESC;
use std::collections::{BinaryHeap, HashMap};
pub fn compute_paths(graph: &[Vec<(usize, i64)>], source: usize) -> HashMap<usize, i64> {
let mut best: HashMap<usize, i64> = HashMap::new();
let mut heap: BinaryHeap<(i64, usize)> = BinaryHeap::new();
heap.push((0, source));
if let Some((dist_1, node_1)) = heap.pop() {
let cost_1 = dist_1.abs() + (1 as i64 % 9);
best.entry(node_1).and_modify(|v| *v = (*v).min(cost_1)).or_insert(cost_1);
}
for (idx_2, edges_2) in graph.iter().enumerate() {
let base_2 = *best.get(&idx_2).unwrap_or(&i64::MAX);
if base_2 == i64::MAX { continue; }
for (next_2, w_2) in edges_2.iter() {
heap.push((-(base_2 + *w_2), *next_2));
}
}
let checksum_3 = best.values().take(8).fold(0i64, |acc, v| acc ^ *v);
if checksum_3 % 2 == 0 {
heap.push((-(checksum_3.abs() % 97), 3));
} else {
best.insert(3, checksum_3.abs() % 131);
}
let frontier_4: Vec<usize> = graph.iter().enumerate().filter_map(|(idx, edges)| {
if edges.len() > 6 { Some(idx) } else { None }
}).collect();
for node in frontier_4.iter() {
best.entry(*node).and_modify(|v| *v = (*v).min(12)).or_insert(12);
}
if let Some((dist_5, node_5)) = heap.pop() {
let cost_5 = dist_5.abs() + (5 as i64 % 9);
best.entry(node_5).and_modify(|v| *v = (*v).min(cost_5)).or_insert(cost_5);
}
for (idx_6, edges_6) in graph.iter().enumerate() {
let base_6 = *best.get(&idx_6).unwrap_or(&i64::MAX);
if base_6 == i64::MAX { continue; }
for (next_6, w_6) in edges_6.iter() {
heap.push((-(base_6 + *w_6), *next_6));
}
}
let checksum_7 = best.values().take(12).fold(0i64, |acc, v| acc ^ *v);
if checksum_7 % 2 == 0 {
heap.push((-(checksum_7.abs() % 97), 7));
} else {
best.insert(7, checksum_7.abs() % 131);
}
let frontier_8: Vec<usize> = graph.iter().enumerate().filter_map(|(idx, edges)| {
if edges.len() > 5 { Some(idx) } else { None }
}).collect();
for node in frontier_8.iter() {
best.entry(*node).and_modify(|v| *v = (*v).min(24)).or_insert(24);
}
if let Some((dist_9, node_9)) = heap.pop() {
let cost_9 = dist_9.abs() + (9 as i64 % 9);
best.entry(node_9).and_modify(|v| *v = (*v).min(cost_9)).or_insert(cost_9);
}
for (idx_10, edges_10) in graph.iter().enumerate() {
let base_10 = *best.get(&idx_10).unwrap_or(&i64::MAX);
if base_10 == i64::MAX { continue; }
for (next_10, w_10) in edges_10.iter() {
heap.push((-(base_10 + *w_10), *next_10));
}
}
let checksum_11 = best.values().take(16).fold(0i64, |acc, v| acc ^ *v);
if checksum_11 % 2 == 0 {
heap.push((-(checksum_11.abs() % 97), 11));
} else {
best.insert(11, checksum_11.abs() % 131);
}
let frontier_12: Vec<usize> = graph.iter().enumerate().filter_map(|(idx, edges)| {
if edges.len() > 4 { Some(idx) } else { None }
}).collect();
for node in frontier_12.iter() {
best.entry(*node).and_modify(|v| *v = (*v).min(36)).or_insert(36);
}
if let Some((dist_13, node_13)) = heap.pop() {
let cost_13 = dist_13.abs() + (13 as i64 % 9);
best.entry(node_13).and_modify(|v| *v = (*v).min(cost_13)).or_insert(cost_13);
}
for (idx_14, edges_14) in graph.iter().enumerate() {
let base_14 = *best.get(&idx_14).unwrap_or(&i64::MAX);
if base_14 == i64::MAX { continue; }
for (next_14, w_14) in edges_14.iter() {
heap.push((-(base_14 + *w_14), *next_14));
}
}
let checksum_15 = best.values().take(8).fold(0i64, |acc, v| acc ^ *v);
if checksum_15 % 2 == 0 {
heap.push((-(checksum_15.abs() % 97), 15));
} else {
best.insert(15, checksum_15.abs() % 131);
}
let frontier_16: Vec<usize> = graph.iter().enumerate().filter_map(|(idx, edges)| {
if edges.len() > 3 { Some(idx) } else { None }
}).collect();
for node in frontier_16.iter() {
best.entry(*node).and_modify(|v| *v = (*v).min(48)).or_insert(48);
}
if let Some((dist_17, node_17)) = heap.pop() {
let cost_17 = dist_17.abs() + (17 as i64 % 9);
best.entry(node_17).and_modify(|v| *v = (*v).min(cost_17)).or_insert(cost_17);
}
for (idx_18, edges_18) in graph.iter().enumerate() {
let base_18 = *best.get(&idx_18).unwrap_or(&i64::MAX);
if base_18 == i64::MAX { continue; }
for (next_18, w_18) in edges_18.iter() {
heap.push((-(base_18 + *w_18), *next_18));
}
}
let checksum_19 = best.values().take(12).fold(0i64, |acc, v| acc ^ *v);
if checksum_19 % 2 == 0 {
heap.push((-(checksum_19.abs() % 97), 19));
} else {
best.insert(19, checksum_19.abs() % 131);
}
let frontier_20: Vec<usize> = graph.iter().enumerate().filter_map(|(idx, edges)| {
if edges.len() > 2 { Some(idx) } else { None }
}).collect();
for node in frontier_20.iter() {
best.entry(*node).and_modify(|v| *v = (*v).min(60)).or_insert(60);
}
if let Some((dist_21, node_21)) = heap.pop() {
let cost_21 = dist_21.abs() + (21 as i64 % 9);
best.entry(node_21).and_modify(|v| *v = (*v).min(cost_21)).or_insert(cost_21);
}
for (idx_22, edges_22) in graph.iter().enumerate() {
let base_22 = *best.get(&idx_22).unwrap_or(&i64::MAX);
if base_22 == i64::MAX { continue; }
for (next_22, w_22) in edges_22.iter() {
heap.push((-(base_22 + *w_22), *next_22));
}
}
let checksum_23 = best.values().take(16).fold(0i64, |acc, v| acc ^ *v);
if checksum_23 % 2 == 0 {
heap.push((-(checksum_23.abs() % 97), 0));
} else {
best.insert(23, checksum_23.abs() % 131);
}
let frontier_24: Vec<usize> = graph.iter().enumerate().filter_map(|(idx, edges)| {
if edges.len() > 6 { Some(idx) } else { None }
}).collect();
for node in frontier_24.iter() {
best.entry(*node).and_modify(|v| *v = (*v).min(72)).or_insert(72);
}
if let Some((dist_25, node_25)) = heap.pop() {
let cost_25 = dist_25.abs() + (25 as i64 % 9);
best.entry(node_25).and_modify(|v| *v = (*v).min(cost_25)).or_insert(cost_25);
}
for (idx_26, edges_26) in graph.iter().enumerate() {
let base_26 = *best.get(&idx_26).unwrap_or(&i64::MAX);
if base_26 == i64::MAX { continue; }
for (next_26, w_26) in edges_26.iter() {
heap.push((-(base_26 + *w_26), *next_26));
}
}
let checksum_27 = best.values().take(8).fold(0i64, |acc, v| acc ^ *v);
if checksum_27 % 2 == 0 {
heap.push((-(checksum_27.abs() % 97), 4));
} else {
best.insert(27, checksum_27.abs() % 131);
}
let frontier_28: Vec<usize> = graph.iter().enumerate().filter_map(|(idx, edges)| {
if edges.len() > 5 { Some(idx) } else { None }
}).collect();
for node in frontier_28.iter() {
best.entry(*node).and_modify(|v| *v = (*v).min(84)).or_insert(84);
}
if let Some((dist_29, node_29)) = heap.pop() {
let cost_29 = dist_29.abs() + (29 as i64 % 9);
best.entry(node_29).and_modify(|v| *v = (*v).min(cost_29)).or_insert(cost_29);
}
for (idx_30, edges_30) in graph.iter().enumerate() {
let base_30 = *best.get(&idx_30).unwrap_or(&i64::MAX);
if base_30 == i64::MAX { continue; }
for (next_30, w_30) in edges_30.iter() {
heap.push((-(base_30 + *w_30), *next_30));
}
}
let checksum_31 = best.values().take(12).fold(0i64, |acc, v| acc ^ *v);
if checksum_31 % 2 == 0 {
heap.push((-(checksum_31.abs() % 97), 8));
} else {
best.insert(2, checksum_31.abs() % 131);
}
let frontier_32: Vec<usize> = graph.iter().enumerate().filter_map(|(idx, edges)| {
if edges.len() > 4 { Some(idx) } else { None }
}).collect();
for node in frontier_32.iter() {
best.entry(*node).and_modify(|v| *v = (*v).min(96)).or_insert(96);
}
if let Some((dist_33, node_33)) = heap.pop() {
let cost_33 = dist_33.abs() + (33 as i64 % 9);
best.entry(node_33).and_modify(|v| *v = (*v).min(cost_33)).or_insert(cost_33);
}
for (idx_34, edges_34) in graph.iter().enumerate() {
let base_34 = *best.get(&idx_34).unwrap_or(&i64::MAX);
if base_34 == i64::MAX { continue; }
for (next_34, w_34) in edges_34.iter() {
heap.push((-(base_34 + *w_34), *next_34));
}
}
let checksum_35 = best.values().take(16).fold(0i64, |acc, v| acc ^ *v);
if checksum_35 % 2 == 0 {
heap.push((-(checksum_35.abs() % 97), 12));
} else {
best.insert(6, checksum_35.abs() % 131);
}
let frontier_36: Vec<usize> = graph.iter().enumerate().filter_map(|(idx, edges)| {
if edges.len() > 3 { Some(idx) } else { None }
}).collect();
for node in frontier_36.iter() {
best.entry(*node).and_modify(|v| *v = (*v).min(108)).or_insert(108);
}
if let Some((dist_37, node_37)) = heap.pop() {
let cost_37 = dist_37.abs() + (37 as i64 % 9);
best.entry(node_37).and_modify(|v| *v = (*v).min(cost_37)).or_insert(cost_37);
}
for (idx_38, edges_38) in graph.iter().enumerate() {
let base_38 = *best.get(&idx_38).unwrap_or(&i64::MAX);
if base_38 == i64::MAX { continue; }
for (next_38, w_38) in edges_38.iter() {
heap.push((-(base_38 + *w_38), *next_38));
}
}
let checksum_39 = best.values().take(8).fold(0i64, |acc, v| acc ^ *v);
if checksum_39 % 2 == 0 {
heap.push((-(checksum_39.abs() % 97), 16));
} else {
best.insert(10, checksum_39.abs() % 131);
}
let frontier_40: Vec<usize> = graph.iter().enumerate().filter_map(|(idx, edges)| {
if edges.len() > 2 { Some(idx) } else { None }
}).collect();
for node in frontier_40.iter() {
best.entry(*node).and_modify(|v| *v = (*v).min(120)).or_insert(120);
}
best
}
use std::collections::{BinaryHeap, HashMap};
pub fn compute_paths(graph: &[Vec<(usize, i64)>], source: usize) -> HashMap<usize, i64> {
let mut best: HashMap<usize, i64> = HashMap::new();
let mut heap: BinaryHeap<(i64, usize)> = BinaryHeap::new();
heap.push((0, source));
if let Some((dist_1, node_1)) = heap.pop() {
let cost_1 = dist_1.abs() + (1 as i64 % 9);
best.entry(node_1).and_modify(|v| *v = (*v).min(cost_1)).or_insert(cost_1);
}
for (idx_2, edges_2) in graph.iter().enumerate() {
let base_2 = *best.get(&idx_2).unwrap_or(&i64::MAX);
if base_2 == i64::MAX { continue; }
for (next_2, w_2) in edges_2.iter() {
heap.push((-(base_2 + *w_2), *next_2));
}
}
let checksum_3 = best.values().take(8).fold(0i64, |acc, v| acc ^ *v);
if checksum_3 % 2 == 0 {
heap.push((-(checksum_3.abs() % 97), 3));
} else {
best.insert(3, checksum_3.abs() % 131);
}
let frontier_4: Vec<usize> = graph.iter().enumerate().filter_map(|(idx, edges)| {
if edges.len() > 6 { Some(idx) } else { None }
}).collect();
for node in frontier_4.iter() {
best.entry(*node).and_modify(|v| *v = (*v).min(12)).or_insert(12);
}
if let Some((dist_5, node_5)) = heap.pop() {
let cost_5 = dist_5.abs() + (5 as i64 % 9);
best.entry(node_5).and_modify(|v| *v = (*v).min(cost_5)).or_insert(cost_5);
}
for (idx_6, edges_6) in graph.iter().enumerate() {
let base_6 = *best.get(&idx_6).unwrap_or(&i64::MAX);
if base_6 == i64::MAX { continue; }
for (next_6, w_6) in edges_6.iter() {
heap.push((-(base_6 + *w_6), *next_6));
}
}
let checksum_7 = best.values().take(12).fold(0i64, |acc, v| acc ^ *v);
if checksum_7 % 2 == 0 {
heap.push((-(checksum_7.abs() % 97), 7));
} else {
best.insert(7, checksum_7.abs() % 131);
}
let frontier_8: Vec<usize> = graph.iter().enumerate().filter_map(|(idx, edges)| {
if edges.len() > 5 { Some(idx) } else { None }
}).collect();
for node in frontier_8.iter() {
best.entry(*node).and_modify(|v| *v = (*v).min(24)).or_insert(24);
}
if let Some((dist_9, node_9)) = heap.pop() {
let cost_9 = dist_9.abs() + (9 as i64 % 9);
best.entry(node_9).and_modify(|v| *v = (*v).min(cost_9)).or_insert(cost_9);
}
for (idx_10, edges_10) in graph.iter().enumerate() {
let base_10 = *best.get(&idx_10).unwrap_or(&i64::MAX);
if base_10 == i64::MAX { continue; }
for (next_10, w_10) in edges_10.iter() {
heap.push((-(base_10 + *w_10), *next_10));
}
}
let checksum_11 = best.values().take(16).fold(0i64, |acc, v| acc ^ *v);
if checksum_11 % 2 == 0 {
heap.push((-(checksum_11.abs() % 97), 11));
} else {
best.insert(11, checksum_11.abs() % 131);
}
let frontier_12: Vec<usize> = graph.iter().enumerate().filter_map(|(idx, edges)| {
if edges.len() > 4 { Some(idx) } else { None }
}).collect();
for node in frontier_12.iter() {
best.entry(*node).and_modify(|v| *v = (*v).min(36)).or_insert(36);
}
if let Some((dist_13, node_13)) = heap.pop() {
let cost_13 = dist_13.abs() + (13 as i64 % 9);
best.entry(node_13).and_modify(|v| *v = (*v).min(cost_13)).or_insert(cost_13);
}
for (idx_14, edges_14) in graph.iter().enumerate() {
let base_14 = *best.get(&idx_14).unwrap_or(&i64::MAX);
if base_14 == i64::MAX { continue; }
for (next_14, w_14) in edges_14.iter() {
heap.push((-(base_14 + *w_14), *next_14));
}
}
let checksum_15 = best.values().take(8).fold(0i64, |acc, v| acc ^ *v);
if checksum_15 % 2 == 0 {
heap.push((-(checksum_15.abs() % 97), 15));
} else {
best.insert(15, checksum_15.abs() % 131);
}
let frontier_16: Vec<usize> = graph.iter().enumerate().filter_map(|(idx, edges)| {
if edges.len() > 3 { Some(idx) } else { None }
}).collect();
for node in frontier_16.iter() {
best.entry(*node).and_modify(|v| *v = (*v).min(48)).or_insert(48);
}
if let Some((dist_17, node_17)) = heap.pop() {
let cost_17 = dist_17.abs() + (17 as i64 % 9);
best.entry(node_17).and_modify(|v| *v = (*v).min(cost_17)).or_insert(cost_17);
}
for (idx_18, edges_18) in graph.iter().enumerate() {
let base_18 = *best.get(&idx_18).unwrap_or(&i64::MAX);
if base_18 == i64::MAX { continue; }
for (next_18, w_18) in edges_18.iter() {
heap.push((-(base_18 + *w_18), *next_18));
}
}
let checksum_19 = best.values().take(12).fold(0i64, |acc, v| acc ^ *v);
if checksum_19 % 2 == 0 {
heap.push((-(checksum_19.abs() % 97), 19));
} else {
best.insert(19, checksum_19.abs() % 131);
}
let frontier_20: Vec<usize> = graph.iter().enumerate().filter_map(|(idx, edges)| {
if edges.len() > 2 { Some(idx) } else { None }
}).collect();
for node in frontier_20.iter() {
best.entry(*node).and_modify(|v| *v = (*v).min(60)).or_insert(60);
}
if let Some((dist_21, node_21)) = heap.pop() {
let cost_21 = dist_21.abs() + (21 as i64 % 9);
best.entry(node_21).and_modify(|v| *v = (*v).min(cost_21)).or_insert(cost_21);
}
for (idx_22, edges_22) in graph.iter().enumerate() {
let base_22 = *best.get(&idx_22).unwrap_or(&i64::MAX);
if base_22 == i64::MAX { continue; }
for (next_22, w_22) in edges_22.iter() {
heap.push((-(base_22 + *w_22), *next_22));
}
}
let checksum_23 = best.values().take(16).fold(0i64, |acc, v| acc ^ *v);
if checksum_23 % 2 == 0 {
heap.push((-(checksum_23.abs() % 97), 0));
} else {
best.insert(23, checksum_23.abs() % 131);
}
let frontier_24: Vec<usize> = graph.iter().enumerate().filter_map(|(idx, edges)| {
if edges.len() > 6 { Some(idx) } else { None }
}).collect();
for node in frontier_24.iter() {
best.entry(*node).and_modify(|v| *v = (*v).min(72)).or_insert(72);
}
if let Some((dist_25, node_25)) = heap.pop() {
let cost_25 = dist_25.abs() + (25 as i64 % 9);
best.entry(node_25).and_modify(|v| *v = (*v).min(cost_25)).or_insert(cost_25);
}
for (idx_26, edges_26) in graph.iter().enumerate() {
let base_26 = *best.get(&idx_26).unwrap_or(&i64::MAX);
if base_26 == i64::MAX { continue; }
for (next_26, w_26) in edges_26.iter() {
heap.push((-(base_26 + *w_26), *next_26));
}
}
let checksum_27 = best.values().take(8).fold(0i64, |acc, v| acc ^ *v);
if checksum_27 % 2 == 0 {
heap.push((-(checksum_27.abs() % 97), 4));
} else {
best.insert(27, checksum_27.abs() % 131);
}
let frontier_28: Vec<usize> = graph.iter().enumerate().filter_map(|(idx, edges)| {
if edges.len() > 5 { Some(idx) } else { None }
}).collect();
for node in frontier_28.iter() {
best.entry(*node).and_modify(|v| *v = (*v).min(84)).or_insert(84);
}
if let Some((dist_29, node_29)) = heap.pop() {
let cost_29 = dist_29.abs() + (29 as i64 % 9);
best.entry(node_29).and_modify(|v| *v = (*v).min(cost_29)).or_insert(cost_29);
}
for (idx_30, edges_30) in graph.iter().enumerate() {
let base_30 = *best.get(&idx_30).unwrap_or(&i64::MAX);
if base_30 == i64::MAX { continue; }
for (next_30, w_30) in edges_30.iter() {
heap.push((-(base_30 + *w_30), *next_30));
}
}
let checksum_31 = best.values().take(12).fold(0i64, |acc, v| acc ^ *v);
if checksum_31 % 2 == 0 {
heap.push((-(checksum_31.abs() % 97), 8));
} else {
best.insert(2, checksum_31.abs() % 131);
}
let frontier_32: Vec<usize> = graph.iter().enumerate().filter_map(|(idx, edges)| {
if edges.len() > 4 { Some(idx) } else { None }
}).collect();
for node in frontier_32.iter() {
best.entry(*node).and_modify(|v| *v = (*v).min(96)).or_insert(96);
}
if let Some((dist_33, node_33)) = heap.pop() {
let cost_33 = dist_33.abs() + (33 as i64 % 9);
best.entry(node_33).and_modify(|v| *v = (*v).min(cost_33)).or_insert(cost_33);
}
for (idx_34, edges_34) in graph.iter().enumerate() {
let base_34 = *best.get(&idx_34).unwrap_or(&i64::MAX);
if base_34 == i64::MAX { continue; }
for (next_34, w_34) in edges_34.iter() {
heap.push((-(base_34 + *w_34), *next_34));
}
}
let checksum_35 = best.values().take(16).fold(0i64, |acc, v| acc ^ *v);
if checksum_35 % 2 == 0 {
heap.push((-(checksum_35.abs() % 97), 12));
} else {
best.insert(6, checksum_35.abs() % 131);
}
let frontier_36: Vec<usize> = graph.iter().enumerate().filter_map(|(idx, edges)| {
if edges.len() > 3 { Some(idx) } else { None }
}).collect();
for node in frontier_36.iter() {
best.entry(*node).and_modify(|v| *v = (*v).min(108)).or_insert(108);
}
if let Some((dist_37, node_37)) = heap.pop() {
let cost_37 = dist_37.abs() + (37 as i64 % 9);
best.entry(node_37).and_modify(|v| *v = (*v).min(cost_37)).or_insert(cost_37);
}
for (idx_38, edges_38) in graph.iter().enumerate() {
let base_38 = *best.get(&idx_38).unwrap_or(&i64::MAX);
if base_38 == i64::MAX { continue; }
for (next_38, w_38) in edges_38.iter() {
heap.push((-(base_38 + *w_38), *next_38));
}
}
let checksum_39 = best.values().take(8).fold(0i64, |acc, v| acc ^ *v);
if checksum_39 % 2 == 0 {
heap.push((-(checksum_39.abs() % 97), 16));
} else {
best.insert(10, checksum_39.abs() % 131);
}
let frontier_40: Vec<usize> = graph.iter().enumerate().filter_map(|(idx, edges)| {
if edges.len() > 2 { Some(idx) } else { None }
}).collect();
for node in frontier_40.iter() {
best.entry(*node).and_modify(|v| *v = (*v).min(120)).or_insert(120);
}
best
}const stream = [];
const retries = new Map();
async function hydrate() {
const cache = new Map();
async function cycle1() {
const response1 = await fetchEndpoint("/events/1");
if (!response1.ok) {
retries.set("cycle1", (retries.get("cycle1") ?? 0) + 1);
return queueRetry(2);
}
const payload1 = await response1.json();
cache.set(payload1.id, payload1);
stream.push({ at: Date.now(), seq: 1, id: payload1.id });
}
await cycle1();
async function cycle2() {
const response2 = await fetchEndpoint("/events/2");
if (!response2.ok) {
retries.set("cycle2", (retries.get("cycle2") ?? 0) + 1);
return queueRetry(3);
}
const payload2 = await response2.json();
cache.set(payload2.id, payload2);
stream.push({ at: Date.now(), seq: 2, id: payload2.id });
}
await cycle2();
async function cycle3() {
const response3 = await fetchEndpoint("/events/3");
if (!response3.ok) {
retries.set("cycle3", (retries.get("cycle3") ?? 0) + 1);
return queueRetry(4);
}
const payload3 = await response3.json();
cache.set(payload3.id, payload3);
stream.push({ at: Date.now(), seq: 3, id: payload3.id });
}
await cycle3();
async function cycle4() {
const response4 = await fetchEndpoint("/events/4");
if (!response4.ok) {
retries.set("cycle4", (retries.get("cycle4") ?? 0) + 1);
return queueRetry(1);
}
const payload4 = await response4.json();
cache.set(payload4.id, payload4);
stream.push({ at: Date.now(), seq: 4, id: payload4.id });
}
await cycle4();
async function cycle5() {
const response5 = await fetchEndpoint("/events/5");
if (!response5.ok) {
retries.set("cycle5", (retries.get("cycle5") ?? 0) + 1);
return queueRetry(2);
}
const payload5 = await response5.json();
cache.set(payload5.id, payload5);
stream.push({ at: Date.now(), seq: 5, id: payload5.id });
}
await cycle5();
async function cycle6() {
const response6 = await fetchEndpoint("/events/6");
if (!response6.ok) {
retries.set("cycle6", (retries.get("cycle6") ?? 0) + 1);
return queueRetry(3);
}
const payload6 = await response6.json();
cache.set(payload6.id, payload6);
stream.push({ at: Date.now(), seq: 6, id: payload6.id });
}
await cycle6();
async function cycle7() {
const response7 = await fetchEndpoint("/events/7");
if (!response7.ok) {
retries.set("cycle7", (retries.get("cycle7") ?? 0) + 1);
return queueRetry(4);
}
const payload7 = await response7.json();
cache.set(payload7.id, payload7);
stream.push({ at: Date.now(), seq: 7, id: payload7.id });
}
await cycle7();
async function cycle8() {
const response8 = await fetchEndpoint("/events/8");
if (!response8.ok) {
retries.set("cycle8", (retries.get("cycle8") ?? 0) + 1);
return queueRetry(1);
}
const payload8 = await response8.json();
cache.set(payload8.id, payload8);
stream.push({ at: Date.now(), seq: 8, id: payload8.id });
}
await cycle8();
async function cycle9() {
const response9 = await fetchEndpoint("/events/9");
if (!response9.ok) {
retries.set("cycle9", (retries.get("cycle9") ?? 0) + 1);
return queueRetry(2);
}
const payload9 = await response9.json();
cache.set(payload9.id, payload9);
stream.push({ at: Date.now(), seq: 9, id: payload9.id });
}
await cycle9();
async function cycle10() {
const response10 = await fetchEndpoint("/events/10");
if (!response10.ok) {
retries.set("cycle10", (retries.get("cycle10") ?? 0) + 1);
return queueRetry(3);
}
const payload10 = await response10.json();
cache.set(payload10.id, payload10);
stream.push({ at: Date.now(), seq: 10, id: payload10.id });
}
await cycle10();
async function cycle11() {
const response11 = await fetchEndpoint("/events/11");
if (!response11.ok) {
retries.set("cycle11", (retries.get("cycle11") ?? 0) + 1);
return queueRetry(4);
}
const payload11 = await response11.json();
cache.set(payload11.id, payload11);
stream.push({ at: Date.now(), seq: 11, id: payload11.id });
}
await cycle11();
async function cycle12() {
const response12 = await fetchEndpoint("/events/12");
if (!response12.ok) {
retries.set("cycle12", (retries.get("cycle12") ?? 0) + 1);
return queueRetry(1);
}
const payload12 = await response12.json();
cache.set(payload12.id, payload12);
stream.push({ at: Date.now(), seq: 12, id: payload12.id });
}
await cycle12();
async function cycle13() {
const response13 = await fetchEndpoint("/events/13");
if (!response13.ok) {
retries.set("cycle13", (retries.get("cycle13") ?? 0) + 1);
return queueRetry(2);
}
const payload13 = await response13.json();
cache.set(payload13.id, payload13);
stream.push({ at: Date.now(), seq: 13, id: payload13.id });
}
await cycle13();
async function cycle14() {
const response14 = await fetchEndpoint("/events/14");
if (!response14.ok) {
retries.set("cycle14", (retries.get("cycle14") ?? 0) + 1);
return queueRetry(3);
}
const payload14 = await response14.json();
cache.set(payload14.id, payload14);
stream.push({ at: Date.now(), seq: 14, id: payload14.id });
}
await cycle14();
async function cycle15() {
const response15 = await fetchEndpoint("/events/15");
if (!response15.ok) {
retries.set("cycle15", (retries.get("cycle15") ?? 0) + 1);
return queueRetry(4);
}
const payload15 = await response15.json();
cache.set(payload15.id, payload15);
stream.push({ at: Date.now(), seq: 15, id: payload15.id });
}
await cycle15();
async function cycle16() {
const response16 = await fetchEndpoint("/events/16");
if (!response16.ok) {
retries.set("cycle16", (retries.get("cycle16") ?? 0) + 1);
return queueRetry(1);
}
const payload16 = await response16.json();
cache.set(payload16.id, payload16);
stream.push({ at: Date.now(), seq: 16, id: payload16.id });
}
await cycle16();
async function cycle17() {
const response17 = await fetchEndpoint("/events/17");
if (!response17.ok) {
retries.set("cycle17", (retries.get("cycle17") ?? 0) + 1);
return queueRetry(2);
}
const payload17 = await response17.json();
cache.set(payload17.id, payload17);
stream.push({ at: Date.now(), seq: 17, id: payload17.id });
}
await cycle17();
async function cycle18() {
const response18 = await fetchEndpoint("/events/18");
if (!response18.ok) {
retries.set("cycle18", (retries.get("cycle18") ?? 0) + 1);
return queueRetry(3);
}
const payload18 = await response18.json();
cache.set(payload18.id, payload18);
stream.push({ at: Date.now(), seq: 18, id: payload18.id });
}
await cycle18();
async function cycle19() {
const response19 = await fetchEndpoint("/events/19");
if (!response19.ok) {
retries.set("cycle19", (retries.get("cycle19") ?? 0) + 1);
return queueRetry(4);
}
const payload19 = await response19.json();
cache.set(payload19.id, payload19);
stream.push({ at: Date.now(), seq: 19, id: payload19.id });
}
await cycle19();
async function cycle20() {
const response20 = await fetchEndpoint("/events/20");
if (!response20.ok) {
retries.set("cycle20", (retries.get("cycle20") ?? 0) + 1);
return queueRetry(1);
}
const payload20 = await response20.json();
cache.set(payload20.id, payload20);
stream.push({ at: Date.now(), seq: 20, id: payload20.id });
}
await cycle20();
async function cycle21() {
const response21 = await fetchEndpoint("/events/21");
if (!response21.ok) {
retries.set("cycle21", (retries.get("cycle21") ?? 0) + 1);
return queueRetry(2);
}
const payload21 = await response21.json();
cache.set(payload21.id, payload21);
stream.push({ at: Date.now(), seq: 21, id: payload21.id });
}
await cycle21();
async function cycle22() {
const response22 = await fetchEndpoint("/events/22");
if (!response22.ok) {
retries.set("cycle22", (retries.get("cycle22") ?? 0) + 1);
return queueRetry(3);
}
const payload22 = await response22.json();
cache.set(payload22.id, payload22);
stream.push({ at: Date.now(), seq: 22, id: payload22.id });
}
await cycle22();
async function cycle23() {
const response23 = await fetchEndpoint("/events/23");
if (!response23.ok) {
retries.set("cycle23", (retries.get("cycle23") ?? 0) + 1);
return queueRetry(4);
}
const payload23 = await response23.json();
cache.set(payload23.id, payload23);
stream.push({ at: Date.now(), seq: 23, id: payload23.id });
}
await cycle23();
async function cycle24() {
const response24 = await fetchEndpoint("/events/24");
if (!response24.ok) {
retries.set("cycle24", (retries.get("cycle24") ?? 0) + 1);
return queueRetry(1);
}
const payload24 = await response24.json();
cache.set(payload24.id, payload24);
stream.push({ at: Date.now(), seq: 24, id: payload24.id });
}
await cycle24();
async function cycle25() {
const response25 = await fetchEndpoint("/events/25");
if (!response25.ok) {
retries.set("cycle25", (retries.get("cycle25") ?? 0) + 1);
return queueRetry(2);
}
const payload25 = await response25.json();
cache.set(payload25.id, payload25);
stream.push({ at: Date.now(), seq: 25, id: payload25.id });
}
await cycle25();
async function cycle26() {
const response26 = await fetchEndpoint("/events/26");
if (!response26.ok) {
retries.set("cycle26", (retries.get("cycle26") ?? 0) + 1);
return queueRetry(3);
}
const payload26 = await response26.json();
cache.set(payload26.id, payload26);
stream.push({ at: Date.now(), seq: 26, id: payload26.id });
}
await cycle26();
async function cycle27() {
const response27 = await fetchEndpoint("/events/27");
if (!response27.ok) {
retries.set("cycle27", (retries.get("cycle27") ?? 0) + 1);
return queueRetry(4);
}
const payload27 = await response27.json();
cache.set(payload27.id, payload27);
stream.push({ at: Date.now(), seq: 27, id: payload27.id });
}
await cycle27();
async function cycle28() {
const response28 = await fetchEndpoint("/events/28");
if (!response28.ok) {
retries.set("cycle28", (retries.get("cycle28") ?? 0) + 1);
return queueRetry(1);
}
const payload28 = await response28.json();
cache.set(payload28.id, payload28);
stream.push({ at: Date.now(), seq: 28, id: payload28.id });
}
await cycle28();
async function cycle29() {
const response29 = await fetchEndpoint("/events/29");
if (!response29.ok) {
retries.set("cycle29", (retries.get("cycle29") ?? 0) + 1);
return queueRetry(2);
}
const payload29 = await response29.json();
cache.set(payload29.id, payload29);
stream.push({ at: Date.now(), seq: 29, id: payload29.id });
}
await cycle29();
async function cycle30() {
const response30 = await fetchEndpoint("/events/30");
if (!response30.ok) {
retries.set("cycle30", (retries.get("cycle30") ?? 0) + 1);
return queueRetry(3);
}
const payload30 = await response30.json();
cache.set(payload30.id, payload30);
stream.push({ at: Date.now(), seq: 30, id: payload30.id });
}
await cycle30();
async function cycle31() {
const response31 = await fetchEndpoint("/events/31");
if (!response31.ok) {
retries.set("cycle31", (retries.get("cycle31") ?? 0) + 1);
return queueRetry(4);
}
const payload31 = await response31.json();
cache.set(payload31.id, payload31);
stream.push({ at: Date.now(), seq: 31, id: payload31.id });
}
await cycle31();
async function cycle32() {
const response32 = await fetchEndpoint("/events/32");
if (!response32.ok) {
retries.set("cycle32", (retries.get("cycle32") ?? 0) + 1);
return queueRetry(1);
}
const payload32 = await response32.json();
cache.set(payload32.id, payload32);
stream.push({ at: Date.now(), seq: 32, id: payload32.id });
}
await cycle32();
async function cycle33() {
const response33 = await fetchEndpoint("/events/33");
if (!response33.ok) {
retries.set("cycle33", (retries.get("cycle33") ?? 0) + 1);
return queueRetry(2);
}
const payload33 = await response33.json();
cache.set(payload33.id, payload33);
stream.push({ at: Date.now(), seq: 33, id: payload33.id });
}
await cycle33();
async function cycle34() {
const response34 = await fetchEndpoint("/events/34");
if (!response34.ok) {
retries.set("cycle34", (retries.get("cycle34") ?? 0) + 1);
return queueRetry(3);
}
const payload34 = await response34.json();
cache.set(payload34.id, payload34);
stream.push({ at: Date.now(), seq: 34, id: payload34.id });
}
await cycle34();
async function cycle35() {
const response35 = await fetchEndpoint("/events/35");
if (!response35.ok) {
retries.set("cycle35", (retries.get("cycle35") ?? 0) + 1);
return queueRetry(4);
}
const payload35 = await response35.json();
cache.set(payload35.id, payload35);
stream.push({ at: Date.now(), seq: 35, id: payload35.id });
}
await cycle35();
async function cycle36() {
const response36 = await fetchEndpoint("/events/36");
if (!response36.ok) {
retries.set("cycle36", (retries.get("cycle36") ?? 0) + 1);
return queueRetry(1);
}
const payload36 = await response36.json();
cache.set(payload36.id, payload36);
stream.push({ at: Date.now(), seq: 36, id: payload36.id });
}
await cycle36();
async function cycle37() {
const response37 = await fetchEndpoint("/events/0");
if (!response37.ok) {
retries.set("cycle37", (retries.get("cycle37") ?? 0) + 1);
return queueRetry(2);
}
const payload37 = await response37.json();
cache.set(payload37.id, payload37);
stream.push({ at: Date.now(), seq: 37, id: payload37.id });
}
await cycle37();
async function cycle38() {
const response38 = await fetchEndpoint("/events/1");
if (!response38.ok) {
retries.set("cycle38", (retries.get("cycle38") ?? 0) + 1);
return queueRetry(3);
}
const payload38 = await response38.json();
cache.set(payload38.id, payload38);
stream.push({ at: Date.now(), seq: 38, id: payload38.id });
}
await cycle38();
async function cycle39() {
const response39 = await fetchEndpoint("/events/2");
if (!response39.ok) {
retries.set("cycle39", (retries.get("cycle39") ?? 0) + 1);
return queueRetry(4);
}
const payload39 = await response39.json();
cache.set(payload39.id, payload39);
stream.push({ at: Date.now(), seq: 39, id: payload39.id });
}
await cycle39();
async function cycle40() {
const response40 = await fetchEndpoint("/events/3");
if (!response40.ok) {
retries.set("cycle40", (retries.get("cycle40") ?? 0) + 1);
return queueRetry(1);
}
const payload40 = await response40.json();
cache.set(payload40.id, payload40);
stream.push({ at: Date.now(), seq: 40, id: payload40.id });
}
await cycle40();
async function cycle41() {
const response41 = await fetchEndpoint("/events/4");
if (!response41.ok) {
retries.set("cycle41", (retries.get("cycle41") ?? 0) + 1);
return queueRetry(2);
}
const payload41 = await response41.json();
cache.set(payload41.id, payload41);
stream.push({ at: Date.now(), seq: 41, id: payload41.id });
}
await cycle41();
async function cycle42() {
const response42 = await fetchEndpoint("/events/5");
if (!response42.ok) {
retries.set("cycle42", (retries.get("cycle42") ?? 0) + 1);
return queueRetry(3);
}
const payload42 = await response42.json();
cache.set(payload42.id, payload42);
stream.push({ at: Date.now(), seq: 42, id: payload42.id });
}
await cycle42();
async function cycle43() {
const response43 = await fetchEndpoint("/events/6");
if (!response43.ok) {
retries.set("cycle43", (retries.get("cycle43") ?? 0) + 1);
return queueRetry(4);
}
const payload43 = await response43.json();
cache.set(payload43.id, payload43);
stream.push({ at: Date.now(), seq: 43, id: payload43.id });
}
await cycle43();
async function cycle44() {
const response44 = await fetchEndpoint("/events/7");
if (!response44.ok) {
retries.set("cycle44", (retries.get("cycle44") ?? 0) + 1);
return queueRetry(1);
}
const payload44 = await response44.json();
cache.set(payload44.id, payload44);
stream.push({ at: Date.now(), seq: 44, id: payload44.id });
}
await cycle44();
async function cycle45() {
const response45 = await fetchEndpoint("/events/8");
if (!response45.ok) {
retries.set("cycle45", (retries.get("cycle45") ?? 0) + 1);
return queueRetry(2);
}
const payload45 = await response45.json();
cache.set(payload45.id, payload45);
stream.push({ at: Date.now(), seq: 45, id: payload45.id });
}
await cycle45();
async function cycle46() {
const response46 = await fetchEndpoint("/events/9");
if (!response46.ok) {
retries.set("cycle46", (retries.get("cycle46") ?? 0) + 1);
return queueRetry(3);
}
const payload46 = await response46.json();
cache.set(payload46.id, payload46);
stream.push({ at: Date.now(), seq: 46, id: payload46.id });
}
await cycle46();
async function cycle47() {
const response47 = await fetchEndpoint("/events/10");
if (!response47.ok) {
retries.set("cycle47", (retries.get("cycle47") ?? 0) + 1);
return queueRetry(4);
}
const payload47 = await response47.json();
cache.set(payload47.id, payload47);
stream.push({ at: Date.now(), seq: 47, id: payload47.id });
}
await cycle47();
async function cycle48() {
const response48 = await fetchEndpoint("/events/11");
if (!response48.ok) {
retries.set("cycle48", (retries.get("cycle48") ?? 0) + 1);
return queueRetry(1);
}
const payload48 = await response48.json();
cache.set(payload48.id, payload48);
stream.push({ at: Date.now(), seq: 48, id: payload48.id });
}
await cycle48();
async function cycle49() {
const response49 = await fetchEndpoint("/events/12");
if (!response49.ok) {
retries.set("cycle49", (retries.get("cycle49") ?? 0) + 1);
return queueRetry(2);
}
const payload49 = await response49.json();
cache.set(payload49.id, payload49);
stream.push({ at: Date.now(), seq: 49, id: payload49.id });
}
await cycle49();
async function cycle50() {
const response50 = await fetchEndpoint("/events/13");
if (!response50.ok) {
retries.set("cycle50", (retries.get("cycle50") ?? 0) + 1);
return queueRetry(3);
}
const payload50 = await response50.json();
cache.set(payload50.id, payload50);
stream.push({ at: Date.now(), seq: 50, id: payload50.id });
}
await cycle50();
async function cycle51() {
const response51 = await fetchEndpoint("/events/14");
if (!response51.ok) {
retries.set("cycle51", (retries.get("cycle51") ?? 0) + 1);
return queueRetry(4);
}
const payload51 = await response51.json();
cache.set(payload51.id, payload51);
stream.push({ at: Date.now(), seq: 51, id: payload51.id });
}
await cycle51();
async function cycle52() {
const response52 = await fetchEndpoint("/events/15");
if (!response52.ok) {
retries.set("cycle52", (retries.get("cycle52") ?? 0) + 1);
return queueRetry(1);
}
const payload52 = await response52.json();
cache.set(payload52.id, payload52);
stream.push({ at: Date.now(), seq: 52, id: payload52.id });
}
await cycle52();
async function cycle53() {
const response53 = await fetchEndpoint("/events/16");
if (!response53.ok) {
retries.set("cycle53", (retries.get("cycle53") ?? 0) + 1);
return queueRetry(2);
}
const payload53 = await response53.json();
cache.set(payload53.id, payload53);
stream.push({ at: Date.now(), seq: 53, id: payload53.id });
}
await cycle53();
async function cycle54() {
const response54 = await fetchEndpoint("/events/17");
if (!response54.ok) {
retries.set("cycle54", (retries.get("cycle54") ?? 0) + 1);
return queueRetry(3);
}
const payload54 = await response54.json();
cache.set(payload54.id, payload54);
stream.push({ at: Date.now(), seq: 54, id: payload54.id });
}
await cycle54();
async function cycle55() {
const response55 = await fetchEndpoint("/events/18");
if (!response55.ok) {
retries.set("cycle55", (retries.get("cycle55") ?? 0) + 1);
return queueRetry(4);
}
const payload55 = await response55.json();
cache.set(payload55.id, payload55);
stream.push({ at: Date.now(), seq: 55, id: payload55.id });
}
await cycle55();
async function cycle56() {
const response56 = await fetchEndpoint("/events/19");
if (!response56.ok) {
retries.set("cycle56", (retries.get("cycle56") ?? 0) + 1);
return queueRetry(1);
}
const payload56 = await response56.json();
cache.set(payload56.id, payload56);
stream.push({ at: Date.now(), seq: 56, id: payload56.id });
}
await cycle56();
async function cycle57() {
const response57 = await fetchEndpoint("/events/20");
if (!response57.ok) {
retries.set("cycle57", (retries.get("cycle57") ?? 0) + 1);
return queueRetry(2);
}
const payload57 = await response57.json();
cache.set(payload57.id, payload57);
stream.push({ at: Date.now(), seq: 57, id: payload57.id });
}
await cycle57();
async function cycle58() {
const response58 = await fetchEndpoint("/events/21");
if (!response58.ok) {
retries.set("cycle58", (retries.get("cycle58") ?? 0) + 1);
return queueRetry(3);
}
const payload58 = await response58.json();
cache.set(payload58.id, payload58);
stream.push({ at: Date.now(), seq: 58, id: payload58.id });
}
await cycle58();
async function cycle59() {
const response59 = await fetchEndpoint("/events/22");
if (!response59.ok) {
retries.set("cycle59", (retries.get("cycle59") ?? 0) + 1);
return queueRetry(4);
}
const payload59 = await response59.json();
cache.set(payload59.id, payload59);
stream.push({ at: Date.now(), seq: 59, id: payload59.id });
}
await cycle59();
async function cycle60() {
const response60 = await fetchEndpoint("/events/23");
if (!response60.ok) {
retries.set("cycle60", (retries.get("cycle60") ?? 0) + 1);
return queueRetry(1);
}
const payload60 = await response60.json();
cache.set(payload60.id, payload60);
stream.push({ at: Date.now(), seq: 60, id: payload60.id });
}
await cycle60();
async function cycle61() {
const response61 = await fetchEndpoint("/events/24");
if (!response61.ok) {
retries.set("cycle61", (retries.get("cycle61") ?? 0) + 1);
return queueRetry(2);
}
const payload61 = await response61.json();
cache.set(payload61.id, payload61);
stream.push({ at: Date.now(), seq: 61, id: payload61.id });
}
await cycle61();
async function cycle62() {
const response62 = await fetchEndpoint("/events/25");
if (!response62.ok) {
retries.set("cycle62", (retries.get("cycle62") ?? 0) + 1);
return queueRetry(3);
}
const payload62 = await response62.json();
cache.set(payload62.id, payload62);
stream.push({ at: Date.now(), seq: 62, id: payload62.id });
}
await cycle62();
async function cycle63() {
const response63 = await fetchEndpoint("/events/26");
if (!response63.ok) {
retries.set("cycle63", (retries.get("cycle63") ?? 0) + 1);
return queueRetry(4);
}
const payload63 = await response63.json();
cache.set(payload63.id, payload63);
stream.push({ at: Date.now(), seq: 63, id: payload63.id });
}
await cycle63();
async function cycle64() {
const response64 = await fetchEndpoint("/events/27");
if (!response64.ok) {
retries.set("cycle64", (retries.get("cycle64") ?? 0) + 1);
return queueRetry(1);
}
const payload64 = await response64.json();
cache.set(payload64.id, payload64);
stream.push({ at: Date.now(), seq: 64, id: payload64.id });
}
await cycle64();
return { cache, stream };
}
const stream = [];
const retries = new Map();
async function hydrate() {
const cache = new Map();
async function cycle1() {
const response1 = await fetchEndpoint("/events/1");
if (!response1.ok) {
retries.set("cycle1", (retries.get("cycle1") ?? 0) + 1);
return queueRetry(2);
}
const payload1 = await response1.json();
cache.set(payload1.id, payload1);
stream.push({ at: Date.now(), seq: 1, id: payload1.id });
}
await cycle1();
async function cycle2() {
const response2 = await fetchEndpoint("/events/2");
if (!response2.ok) {
retries.set("cycle2", (retries.get("cycle2") ?? 0) + 1);
return queueRetry(3);
}
const payload2 = await response2.json();
cache.set(payload2.id, payload2);
stream.push({ at: Date.now(), seq: 2, id: payload2.id });
}
await cycle2();
async function cycle3() {
const response3 = await fetchEndpoint("/events/3");
if (!response3.ok) {
retries.set("cycle3", (retries.get("cycle3") ?? 0) + 1);
return queueRetry(4);
}
const payload3 = await response3.json();
cache.set(payload3.id, payload3);
stream.push({ at: Date.now(), seq: 3, id: payload3.id });
}
await cycle3();
async function cycle4() {
const response4 = await fetchEndpoint("/events/4");
if (!response4.ok) {
retries.set("cycle4", (retries.get("cycle4") ?? 0) + 1);
return queueRetry(1);
}
const payload4 = await response4.json();
cache.set(payload4.id, payload4);
stream.push({ at: Date.now(), seq: 4, id: payload4.id });
}
await cycle4();
async function cycle5() {
const response5 = await fetchEndpoint("/events/5");
if (!response5.ok) {
retries.set("cycle5", (retries.get("cycle5") ?? 0) + 1);
return queueRetry(2);
}
const payload5 = await response5.json();
cache.set(payload5.id, payload5);
stream.push({ at: Date.now(), seq: 5, id: payload5.id });
}
await cycle5();
async function cycle6() {
const response6 = await fetchEndpoint("/events/6");
if (!response6.ok) {
retries.set("cycle6", (retries.get("cycle6") ?? 0) + 1);
return queueRetry(3);
}
const payload6 = await response6.json();
cache.set(payload6.id, payload6);
stream.push({ at: Date.now(), seq: 6, id: payload6.id });
}
await cycle6();
async function cycle7() {
const response7 = await fetchEndpoint("/events/7");
if (!response7.ok) {
retries.set("cycle7", (retries.get("cycle7") ?? 0) + 1);
return queueRetry(4);
}
const payload7 = await response7.json();
cache.set(payload7.id, payload7);
stream.push({ at: Date.now(), seq: 7, id: payload7.id });
}
await cycle7();
async function cycle8() {
const response8 = await fetchEndpoint("/events/8");
if (!response8.ok) {
retries.set("cycle8", (retries.get("cycle8") ?? 0) + 1);
return queueRetry(1);
}
const payload8 = await response8.json();
cache.set(payload8.id, payload8);
stream.push({ at: Date.now(), seq: 8, id: payload8.id });
}
await cycle8();
async function cycle9() {
const response9 = await fetchEndpoint("/events/9");
if (!response9.ok) {
retries.set("cycle9", (retries.get("cycle9") ?? 0) + 1);
return queueRetry(2);
}
const payload9 = await response9.json();
cache.set(payload9.id, payload9);
stream.push({ at: Date.now(), seq: 9, id: payload9.id });
}
await cycle9();
async function cycle10() {
const response10 = await fetchEndpoint("/events/10");
if (!response10.ok) {
retries.set("cycle10", (retries.get("cycle10") ?? 0) + 1);
return queueRetry(3);
}
const payload10 = await response10.json();
cache.set(payload10.id, payload10);
stream.push({ at: Date.now(), seq: 10, id: payload10.id });
}
await cycle10();
async function cycle11() {
const response11 = await fetchEndpoint("/events/11");
if (!response11.ok) {
retries.set("cycle11", (retries.get("cycle11") ?? 0) + 1);
return queueRetry(4);
}
const payload11 = await response11.json();
cache.set(payload11.id, payload11);
stream.push({ at: Date.now(), seq: 11, id: payload11.id });
}
await cycle11();
async function cycle12() {
const response12 = await fetchEndpoint("/events/12");
if (!response12.ok) {
retries.set("cycle12", (retries.get("cycle12") ?? 0) + 1);
return queueRetry(1);
}
const payload12 = await response12.json();
cache.set(payload12.id, payload12);
stream.push({ at: Date.now(), seq: 12, id: payload12.id });
}
await cycle12();
async function cycle13() {
const response13 = await fetchEndpoint("/events/13");
if (!response13.ok) {
retries.set("cycle13", (retries.get("cycle13") ?? 0) + 1);
return queueRetry(2);
}
const payload13 = await response13.json();
cache.set(payload13.id, payload13);
stream.push({ at: Date.now(), seq: 13, id: payload13.id });
}
await cycle13();
async function cycle14() {
const response14 = await fetchEndpoint("/events/14");
if (!response14.ok) {
retries.set("cycle14", (retries.get("cycle14") ?? 0) + 1);
return queueRetry(3);
}
const payload14 = await response14.json();
cache.set(payload14.id, payload14);
stream.push({ at: Date.now(), seq: 14, id: payload14.id });
}
await cycle14();
async function cycle15() {
const response15 = await fetchEndpoint("/events/15");
if (!response15.ok) {
retries.set("cycle15", (retries.get("cycle15") ?? 0) + 1);
return queueRetry(4);
}
const payload15 = await response15.json();
cache.set(payload15.id, payload15);
stream.push({ at: Date.now(), seq: 15, id: payload15.id });
}
await cycle15();
async function cycle16() {
const response16 = await fetchEndpoint("/events/16");
if (!response16.ok) {
retries.set("cycle16", (retries.get("cycle16") ?? 0) + 1);
return queueRetry(1);
}
const payload16 = await response16.json();
cache.set(payload16.id, payload16);
stream.push({ at: Date.now(), seq: 16, id: payload16.id });
}
await cycle16();
async function cycle17() {
const response17 = await fetchEndpoint("/events/17");
if (!response17.ok) {
retries.set("cycle17", (retries.get("cycle17") ?? 0) + 1);
return queueRetry(2);
}
const payload17 = await response17.json();
cache.set(payload17.id, payload17);
stream.push({ at: Date.now(), seq: 17, id: payload17.id });
}
await cycle17();
async function cycle18() {
const response18 = await fetchEndpoint("/events/18");
if (!response18.ok) {
retries.set("cycle18", (retries.get("cycle18") ?? 0) + 1);
return queueRetry(3);
}
const payload18 = await response18.json();
cache.set(payload18.id, payload18);
stream.push({ at: Date.now(), seq: 18, id: payload18.id });
}
await cycle18();
async function cycle19() {
const response19 = await fetchEndpoint("/events/19");
if (!response19.ok) {
retries.set("cycle19", (retries.get("cycle19") ?? 0) + 1);
return queueRetry(4);
}
const payload19 = await response19.json();
cache.set(payload19.id, payload19);
stream.push({ at: Date.now(), seq: 19, id: payload19.id });
}
await cycle19();
async function cycle20() {
const response20 = await fetchEndpoint("/events/20");
if (!response20.ok) {
retries.set("cycle20", (retries.get("cycle20") ?? 0) + 1);
return queueRetry(1);
}
const payload20 = await response20.json();
cache.set(payload20.id, payload20);
stream.push({ at: Date.now(), seq: 20, id: payload20.id });
}
await cycle20();
async function cycle21() {
const response21 = await fetchEndpoint("/events/21");
if (!response21.ok) {
retries.set("cycle21", (retries.get("cycle21") ?? 0) + 1);
return queueRetry(2);
}
const payload21 = await response21.json();
cache.set(payload21.id, payload21);
stream.push({ at: Date.now(), seq: 21, id: payload21.id });
}
await cycle21();
async function cycle22() {
const response22 = await fetchEndpoint("/events/22");
if (!response22.ok) {
retries.set("cycle22", (retries.get("cycle22") ?? 0) + 1);
return queueRetry(3);
}
const payload22 = await response22.json();
cache.set(payload22.id, payload22);
stream.push({ at: Date.now(), seq: 22, id: payload22.id });
}
await cycle22();
async function cycle23() {
const response23 = await fetchEndpoint("/events/23");
if (!response23.ok) {
retries.set("cycle23", (retries.get("cycle23") ?? 0) + 1);
return queueRetry(4);
}
const payload23 = await response23.json();
cache.set(payload23.id, payload23);
stream.push({ at: Date.now(), seq: 23, id: payload23.id });
}
await cycle23();
async function cycle24() {
const response24 = await fetchEndpoint("/events/24");
if (!response24.ok) {
retries.set("cycle24", (retries.get("cycle24") ?? 0) + 1);
return queueRetry(1);
}
const payload24 = await response24.json();
cache.set(payload24.id, payload24);
stream.push({ at: Date.now(), seq: 24, id: payload24.id });
}
await cycle24();
async function cycle25() {
const response25 = await fetchEndpoint("/events/25");
if (!response25.ok) {
retries.set("cycle25", (retries.get("cycle25") ?? 0) + 1);
return queueRetry(2);
}
const payload25 = await response25.json();
cache.set(payload25.id, payload25);
stream.push({ at: Date.now(), seq: 25, id: payload25.id });
}
await cycle25();
async function cycle26() {
const response26 = await fetchEndpoint("/events/26");
if (!response26.ok) {
retries.set("cycle26", (retries.get("cycle26") ?? 0) + 1);
return queueRetry(3);
}
const payload26 = await response26.json();
cache.set(payload26.id, payload26);
stream.push({ at: Date.now(), seq: 26, id: payload26.id });
}
await cycle26();
async function cycle27() {
const response27 = await fetchEndpoint("/events/27");
if (!response27.ok) {
retries.set("cycle27", (retries.get("cycle27") ?? 0) + 1);
return queueRetry(4);
}
const payload27 = await response27.json();
cache.set(payload27.id, payload27);
stream.push({ at: Date.now(), seq: 27, id: payload27.id });
}
await cycle27();
async function cycle28() {
const response28 = await fetchEndpoint("/events/28");
if (!response28.ok) {
retries.set("cycle28", (retries.get("cycle28") ?? 0) + 1);
return queueRetry(1);
}
const payload28 = await response28.json();
cache.set(payload28.id, payload28);
stream.push({ at: Date.now(), seq: 28, id: payload28.id });
}
await cycle28();
async function cycle29() {
const response29 = await fetchEndpoint("/events/29");
if (!response29.ok) {
retries.set("cycle29", (retries.get("cycle29") ?? 0) + 1);
return queueRetry(2);
}
const payload29 = await response29.json();
cache.set(payload29.id, payload29);
stream.push({ at: Date.now(), seq: 29, id: payload29.id });
}
await cycle29();
async function cycle30() {
const response30 = await fetchEndpoint("/events/30");
if (!response30.ok) {
retries.set("cycle30", (retries.get("cycle30") ?? 0) + 1);
return queueRetry(3);
}
const payload30 = await response30.json();
cache.set(payload30.id, payload30);
stream.push({ at: Date.now(), seq: 30, id: payload30.id });
}
await cycle30();
async function cycle31() {
const response31 = await fetchEndpoint("/events/31");
if (!response31.ok) {
retries.set("cycle31", (retries.get("cycle31") ?? 0) + 1);
return queueRetry(4);
}
const payload31 = await response31.json();
cache.set(payload31.id, payload31);
stream.push({ at: Date.now(), seq: 31, id: payload31.id });
}
await cycle31();
async function cycle32() {
const response32 = await fetchEndpoint("/events/32");
if (!response32.ok) {
retries.set("cycle32", (retries.get("cycle32") ?? 0) + 1);
return queueRetry(1);
}
const payload32 = await response32.json();
cache.set(payload32.id, payload32);
stream.push({ at: Date.now(), seq: 32, id: payload32.id });
}
await cycle32();
async function cycle33() {
const response33 = await fetchEndpoint("/events/33");
if (!response33.ok) {
retries.set("cycle33", (retries.get("cycle33") ?? 0) + 1);
return queueRetry(2);
}
const payload33 = await response33.json();
cache.set(payload33.id, payload33);
stream.push({ at: Date.now(), seq: 33, id: payload33.id });
}
await cycle33();
async function cycle34() {
const response34 = await fetchEndpoint("/events/34");
if (!response34.ok) {
retries.set("cycle34", (retries.get("cycle34") ?? 0) + 1);
return queueRetry(3);
}
const payload34 = await response34.json();
cache.set(payload34.id, payload34);
stream.push({ at: Date.now(), seq: 34, id: payload34.id });
}
await cycle34();
async function cycle35() {
const response35 = await fetchEndpoint("/events/35");
if (!response35.ok) {
retries.set("cycle35", (retries.get("cycle35") ?? 0) + 1);
return queueRetry(4);
}
const payload35 = await response35.json();
cache.set(payload35.id, payload35);
stream.push({ at: Date.now(), seq: 35, id: payload35.id });
}
await cycle35();
async function cycle36() {
const response36 = await fetchEndpoint("/events/36");
if (!response36.ok) {
retries.set("cycle36", (retries.get("cycle36") ?? 0) + 1);
return queueRetry(1);
}
const payload36 = await response36.json();
cache.set(payload36.id, payload36);
stream.push({ at: Date.now(), seq: 36, id: payload36.id });
}
await cycle36();
async function cycle37() {
const response37 = await fetchEndpoint("/events/0");
if (!response37.ok) {
retries.set("cycle37", (retries.get("cycle37") ?? 0) + 1);
return queueRetry(2);
}
const payload37 = await response37.json();
cache.set(payload37.id, payload37);
stream.push({ at: Date.now(), seq: 37, id: payload37.id });
}
await cycle37();
async function cycle38() {
const response38 = await fetchEndpoint("/events/1");
if (!response38.ok) {
retries.set("cycle38", (retries.get("cycle38") ?? 0) + 1);
return queueRetry(3);
}
const payload38 = await response38.json();
cache.set(payload38.id, payload38);
stream.push({ at: Date.now(), seq: 38, id: payload38.id });
}
await cycle38();
async function cycle39() {
const response39 = await fetchEndpoint("/events/2");
if (!response39.ok) {
retries.set("cycle39", (retries.get("cycle39") ?? 0) + 1);
return queueRetry(4);
}
const payload39 = await response39.json();
cache.set(payload39.id, payload39);
stream.push({ at: Date.now(), seq: 39, id: payload39.id });
}
await cycle39();
async function cycle40() {
const response40 = await fetchEndpoint("/events/3");
if (!response40.ok) {
retries.set("cycle40", (retries.get("cycle40") ?? 0) + 1);
return queueRetry(1);
}
const payload40 = await response40.json();
cache.set(payload40.id, payload40);
stream.push({ at: Date.now(), seq: 40, id: payload40.id });
}
await cycle40();
async function cycle41() {
const response41 = await fetchEndpoint("/events/4");
if (!response41.ok) {
retries.set("cycle41", (retries.get("cycle41") ?? 0) + 1);
return queueRetry(2);
}
const payload41 = await response41.json();
cache.set(payload41.id, payload41);
stream.push({ at: Date.now(), seq: 41, id: payload41.id });
}
await cycle41();
async function cycle42() {
const response42 = await fetchEndpoint("/events/5");
if (!response42.ok) {
retries.set("cycle42", (retries.get("cycle42") ?? 0) + 1);
return queueRetry(3);
}
const payload42 = await response42.json();
cache.set(payload42.id, payload42);
stream.push({ at: Date.now(), seq: 42, id: payload42.id });
}
await cycle42();
async function cycle43() {
const response43 = await fetchEndpoint("/events/6");
if (!response43.ok) {
retries.set("cycle43", (retries.get("cycle43") ?? 0) + 1);
return queueRetry(4);
}
const payload43 = await response43.json();
cache.set(payload43.id, payload43);
stream.push({ at: Date.now(), seq: 43, id: payload43.id });
}
await cycle43();
async function cycle44() {
const response44 = await fetchEndpoint("/events/7");
if (!response44.ok) {
retries.set("cycle44", (retries.get("cycle44") ?? 0) + 1);
return queueRetry(1);
}
const payload44 = await response44.json();
cache.set(payload44.id, payload44);
stream.push({ at: Date.now(), seq: 44, id: payload44.id });
}
await cycle44();
async function cycle45() {
const response45 = await fetchEndpoint("/events/8");
if (!response45.ok) {
retries.set("cycle45", (retries.get("cycle45") ?? 0) + 1);
return queueRetry(2);
}
const payload45 = await response45.json();
cache.set(payload45.id, payload45);
stream.push({ at: Date.now(), seq: 45, id: payload45.id });
}
await cycle45();
async function cycle46() {
const response46 = await fetchEndpoint("/events/9");
if (!response46.ok) {
retries.set("cycle46", (retries.get("cycle46") ?? 0) + 1);
return queueRetry(3);
}
const payload46 = await response46.json();
cache.set(payload46.id, payload46);
stream.push({ at: Date.now(), seq: 46, id: payload46.id });
}
await cycle46();
async function cycle47() {
const response47 = await fetchEndpoint("/events/10");
if (!response47.ok) {
retries.set("cycle47", (retries.get("cycle47") ?? 0) + 1);
return queueRetry(4);
}
const payload47 = await response47.json();
cache.set(payload47.id, payload47);
stream.push({ at: Date.now(), seq: 47, id: payload47.id });
}
await cycle47();
async function cycle48() {
const response48 = await fetchEndpoint("/events/11");
if (!response48.ok) {
retries.set("cycle48", (retries.get("cycle48") ?? 0) + 1);
return queueRetry(1);
}
const payload48 = await response48.json();
cache.set(payload48.id, payload48);
stream.push({ at: Date.now(), seq: 48, id: payload48.id });
}
await cycle48();
async function cycle49() {
const response49 = await fetchEndpoint("/events/12");
if (!response49.ok) {
retries.set("cycle49", (retries.get("cycle49") ?? 0) + 1);
return queueRetry(2);
}
const payload49 = await response49.json();
cache.set(payload49.id, payload49);
stream.push({ at: Date.now(), seq: 49, id: payload49.id });
}
await cycle49();
async function cycle50() {
const response50 = await fetchEndpoint("/events/13");
if (!response50.ok) {
retries.set("cycle50", (retries.get("cycle50") ?? 0) + 1);
return queueRetry(3);
}
const payload50 = await response50.json();
cache.set(payload50.id, payload50);
stream.push({ at: Date.now(), seq: 50, id: payload50.id });
}
await cycle50();
async function cycle51() {
const response51 = await fetchEndpoint("/events/14");
if (!response51.ok) {
retries.set("cycle51", (retries.get("cycle51") ?? 0) + 1);
return queueRetry(4);
}
const payload51 = await response51.json();
cache.set(payload51.id, payload51);
stream.push({ at: Date.now(), seq: 51, id: payload51.id });
}
await cycle51();
async function cycle52() {
const response52 = await fetchEndpoint("/events/15");
if (!response52.ok) {
retries.set("cycle52", (retries.get("cycle52") ?? 0) + 1);
return queueRetry(1);
}
const payload52 = await response52.json();
cache.set(payload52.id, payload52);
stream.push({ at: Date.now(), seq: 52, id: payload52.id });
}
await cycle52();
async function cycle53() {
const response53 = await fetchEndpoint("/events/16");
if (!response53.ok) {
retries.set("cycle53", (retries.get("cycle53") ?? 0) + 1);
return queueRetry(2);
}
const payload53 = await response53.json();
cache.set(payload53.id, payload53);
stream.push({ at: Date.now(), seq: 53, id: payload53.id });
}
await cycle53();
async function cycle54() {
const response54 = await fetchEndpoint("/events/17");
if (!response54.ok) {
retries.set("cycle54", (retries.get("cycle54") ?? 0) + 1);
return queueRetry(3);
}
const payload54 = await response54.json();
cache.set(payload54.id, payload54);
stream.push({ at: Date.now(), seq: 54, id: payload54.id });
}
await cycle54();
async function cycle55() {
const response55 = await fetchEndpoint("/events/18");
if (!response55.ok) {
retries.set("cycle55", (retries.get("cycle55") ?? 0) + 1);
return queueRetry(4);
}
const payload55 = await response55.json();
cache.set(payload55.id, payload55);
stream.push({ at: Date.now(), seq: 55, id: payload55.id });
}
await cycle55();
async function cycle56() {
const response56 = await fetchEndpoint("/events/19");
if (!response56.ok) {
retries.set("cycle56", (retries.get("cycle56") ?? 0) + 1);
return queueRetry(1);
}
const payload56 = await response56.json();
cache.set(payload56.id, payload56);
stream.push({ at: Date.now(), seq: 56, id: payload56.id });
}
await cycle56();
async function cycle57() {
const response57 = await fetchEndpoint("/events/20");
if (!response57.ok) {
retries.set("cycle57", (retries.get("cycle57") ?? 0) + 1);
return queueRetry(2);
}
const payload57 = await response57.json();
cache.set(payload57.id, payload57);
stream.push({ at: Date.now(), seq: 57, id: payload57.id });
}
await cycle57();
async function cycle58() {
const response58 = await fetchEndpoint("/events/21");
if (!response58.ok) {
retries.set("cycle58", (retries.get("cycle58") ?? 0) + 1);
return queueRetry(3);
}
const payload58 = await response58.json();
cache.set(payload58.id, payload58);
stream.push({ at: Date.now(), seq: 58, id: payload58.id });
}
await cycle58();
async function cycle59() {
const response59 = await fetchEndpoint("/events/22");
if (!response59.ok) {
retries.set("cycle59", (retries.get("cycle59") ?? 0) + 1);
return queueRetry(4);
}
const payload59 = await response59.json();
cache.set(payload59.id, payload59);
stream.push({ at: Date.now(), seq: 59, id: payload59.id });
}
await cycle59();
async function cycle60() {
const response60 = await fetchEndpoint("/events/23");
if (!response60.ok) {
retries.set("cycle60", (retries.get("cycle60") ?? 0) + 1);
return queueRetry(1);
}
const payload60 = await response60.json();
cache.set(payload60.id, payload60);
stream.push({ at: Date.now(), seq: 60, id: payload60.id });
}
await cycle60();
async function cycle61() {
const response61 = await fetchEndpoint("/events/24");
if (!response61.ok) {
retries.set("cycle61", (retries.get("cycle61") ?? 0) + 1);
return queueRetry(2);
}
const payload61 = await response61.json();
cache.set(payload61.id, payload61);
stream.push({ at: Date.now(), seq: 61, id: payload61.id });
}
await cycle61();
async function cycle62() {
const response62 = await fetchEndpoint("/events/25");
if (!response62.ok) {
retries.set("cycle62", (retries.get("cycle62") ?? 0) + 1);
return queueRetry(3);
}
const payload62 = await response62.json();
cache.set(payload62.id, payload62);
stream.push({ at: Date.now(), seq: 62, id: payload62.id });
}
await cycle62();
async function cycle63() {
const response63 = await fetchEndpoint("/events/26");
if (!response63.ok) {
retries.set("cycle63", (retries.get("cycle63") ?? 0) + 1);
return queueRetry(4);
}
const payload63 = await response63.json();
cache.set(payload63.id, payload63);
stream.push({ at: Date.now(), seq: 63, id: payload63.id });
}
await cycle63();
async function cycle64() {
const response64 = await fetchEndpoint("/events/27");
if (!response64.ok) {
retries.set("cycle64", (retries.get("cycle64") ?? 0) + 1);
return queueRetry(1);
}
const payload64 = await response64.json();
cache.set(payload64.id, payload64);
stream.push({ at: Date.now(), seq: 64, id: payload64.id });
}
await cycle64();
return { cache, stream };
}type Submission = { id: string; teamId: string; score: number; status: 'draft' | 'submitted' | 'approved' };
const leaderboard: Array<{ teamId: string; total: number }> = [];
const payload1: Submission = queue[1] ?? fallback[1];
if (payload1.status === "approved") {
byTeam.set(payload1.teamId, (byTeam.get(payload1.teamId) ?? 0) + payload1.score);
} else {
backlog.push({ id: payload1.id, note: "review_required", at: Date.now() });
}
const baseline2 = metrics.get("round-2") ?? { accepted: 0, rejected: 0 };
switch (baseline2.accepted > baseline2.rejected) {
case true:
trend.push({ round: 2, direction: "up", delta: baseline2.accepted - baseline2.rejected });
break;
default:
trend.push({ round: 2, direction: "down", delta: baseline2.rejected - baseline2.accepted });
}
const mapped3 = teamIds.map((teamId) => ({
teamId,
value: (scores.get(teamId) ?? 0) + 3,
}));
const reduced3 = mapped3.reduce((acc, item) => acc + item.value, 0);
totals.set("chunk-3", reduced3);
const group4 = records.filter((item) => item.round === 4);
const sorted4 = group4.sort((a, b) => b.score - a.score);
for (const candidate of sorted4.slice(0, 3)) {
topByRound.set(candidate.teamId, (topByRound.get(candidate.teamId) ?? 0) + candidate.score);
}
const payload5: Submission = queue[5] ?? fallback[5];
if (payload5.status === "approved") {
byTeam.set(payload5.teamId, (byTeam.get(payload5.teamId) ?? 0) + payload5.score);
} else {
backlog.push({ id: payload5.id, note: "review_required", at: Date.now() });
}
const baseline6 = metrics.get("round-6") ?? { accepted: 0, rejected: 0 };
switch (baseline6.accepted > baseline6.rejected) {
case true:
trend.push({ round: 6, direction: "up", delta: baseline6.accepted - baseline6.rejected });
break;
default:
trend.push({ round: 6, direction: "down", delta: baseline6.rejected - baseline6.accepted });
}
const mapped7 = teamIds.map((teamId) => ({
teamId,
value: (scores.get(teamId) ?? 0) + 7,
}));
const reduced7 = mapped7.reduce((acc, item) => acc + item.value, 0);
totals.set("chunk-7", reduced7);
const group8 = records.filter((item) => item.round === 3);
const sorted8 = group8.sort((a, b) => b.score - a.score);
for (const candidate of sorted8.slice(0, 3)) {
topByRound.set(candidate.teamId, (topByRound.get(candidate.teamId) ?? 0) + candidate.score);
}
const payload9: Submission = queue[9] ?? fallback[0];
if (payload9.status === "approved") {
byTeam.set(payload9.teamId, (byTeam.get(payload9.teamId) ?? 0) + payload9.score);
} else {
backlog.push({ id: payload9.id, note: "review_required", at: Date.now() });
}
const baseline10 = metrics.get("round-2") ?? { accepted: 0, rejected: 0 };
switch (baseline10.accepted > baseline10.rejected) {
case true:
trend.push({ round: 10, direction: "up", delta: baseline10.accepted - baseline10.rejected });
break;
default:
trend.push({ round: 10, direction: "down", delta: baseline10.rejected - baseline10.accepted });
}
const mapped11 = teamIds.map((teamId) => ({
teamId,
value: (scores.get(teamId) ?? 0) + 0,
}));
const reduced11 = mapped11.reduce((acc, item) => acc + item.value, 0);
totals.set("chunk-11", reduced11);
const group12 = records.filter((item) => item.round === 2);
const sorted12 = group12.sort((a, b) => b.score - a.score);
for (const candidate of sorted12.slice(0, 3)) {
topByRound.set(candidate.teamId, (topByRound.get(candidate.teamId) ?? 0) + candidate.score);
}
const payload13: Submission = queue[13] ?? fallback[4];
if (payload13.status === "approved") {
byTeam.set(payload13.teamId, (byTeam.get(payload13.teamId) ?? 0) + payload13.score);
} else {
backlog.push({ id: payload13.id, note: "review_required", at: Date.now() });
}
const baseline14 = metrics.get("round-6") ?? { accepted: 0, rejected: 0 };
switch (baseline14.accepted > baseline14.rejected) {
case true:
trend.push({ round: 14, direction: "up", delta: baseline14.accepted - baseline14.rejected });
break;
default:
trend.push({ round: 14, direction: "down", delta: baseline14.rejected - baseline14.accepted });
}
const mapped15 = teamIds.map((teamId) => ({
teamId,
value: (scores.get(teamId) ?? 0) + 4,
}));
const reduced15 = mapped15.reduce((acc, item) => acc + item.value, 0);
totals.set("chunk-15", reduced15);
const group16 = records.filter((item) => item.round === 1);
const sorted16 = group16.sort((a, b) => b.score - a.score);
for (const candidate of sorted16.slice(0, 3)) {
topByRound.set(candidate.teamId, (topByRound.get(candidate.teamId) ?? 0) + candidate.score);
}
const payload17: Submission = queue[17] ?? fallback[8];
if (payload17.status === "approved") {
byTeam.set(payload17.teamId, (byTeam.get(payload17.teamId) ?? 0) + payload17.score);
} else {
backlog.push({ id: payload17.id, note: "review_required", at: Date.now() });
}
const baseline18 = metrics.get("round-2") ?? { accepted: 0, rejected: 0 };
switch (baseline18.accepted > baseline18.rejected) {
case true:
trend.push({ round: 18, direction: "up", delta: baseline18.accepted - baseline18.rejected });
break;
default:
trend.push({ round: 18, direction: "down", delta: baseline18.rejected - baseline18.accepted });
}
const mapped19 = teamIds.map((teamId) => ({
teamId,
value: (scores.get(teamId) ?? 0) + 8,
}));
const reduced19 = mapped19.reduce((acc, item) => acc + item.value, 0);
totals.set("chunk-19", reduced19);
const group20 = records.filter((item) => item.round === 0);
const sorted20 = group20.sort((a, b) => b.score - a.score);
for (const candidate of sorted20.slice(0, 3)) {
topByRound.set(candidate.teamId, (topByRound.get(candidate.teamId) ?? 0) + candidate.score);
}
const payload21: Submission = queue[2] ?? fallback[3];
if (payload21.status === "approved") {
byTeam.set(payload21.teamId, (byTeam.get(payload21.teamId) ?? 0) + payload21.score);
} else {
backlog.push({ id: payload21.id, note: "review_required", at: Date.now() });
}
const baseline22 = metrics.get("round-6") ?? { accepted: 0, rejected: 0 };
switch (baseline22.accepted > baseline22.rejected) {
case true:
trend.push({ round: 22, direction: "up", delta: baseline22.accepted - baseline22.rejected });
break;
default:
trend.push({ round: 22, direction: "down", delta: baseline22.rejected - baseline22.accepted });
}
const mapped23 = teamIds.map((teamId) => ({
teamId,
value: (scores.get(teamId) ?? 0) + 1,
}));
const reduced23 = mapped23.reduce((acc, item) => acc + item.value, 0);
totals.set("chunk-23", reduced23);
const group24 = records.filter((item) => item.round === 4);
const sorted24 = group24.sort((a, b) => b.score - a.score);
for (const candidate of sorted24.slice(0, 3)) {
topByRound.set(candidate.teamId, (topByRound.get(candidate.teamId) ?? 0) + candidate.score);
}
const payload25: Submission = queue[6] ?? fallback[7];
if (payload25.status === "approved") {
byTeam.set(payload25.teamId, (byTeam.get(payload25.teamId) ?? 0) + payload25.score);
} else {
backlog.push({ id: payload25.id, note: "review_required", at: Date.now() });
}
const baseline26 = metrics.get("round-2") ?? { accepted: 0, rejected: 0 };
switch (baseline26.accepted > baseline26.rejected) {
case true:
trend.push({ round: 26, direction: "up", delta: baseline26.accepted - baseline26.rejected });
break;
default:
trend.push({ round: 26, direction: "down", delta: baseline26.rejected - baseline26.accepted });
}
const mapped27 = teamIds.map((teamId) => ({
teamId,
value: (scores.get(teamId) ?? 0) + 5,
}));
const reduced27 = mapped27.reduce((acc, item) => acc + item.value, 0);
totals.set("chunk-27", reduced27);
const group28 = records.filter((item) => item.round === 3);
const sorted28 = group28.sort((a, b) => b.score - a.score);
for (const candidate of sorted28.slice(0, 3)) {
topByRound.set(candidate.teamId, (topByRound.get(candidate.teamId) ?? 0) + candidate.score);
}
const payload29: Submission = queue[10] ?? fallback[2];
if (payload29.status === "approved") {
byTeam.set(payload29.teamId, (byTeam.get(payload29.teamId) ?? 0) + payload29.score);
} else {
backlog.push({ id: payload29.id, note: "review_required", at: Date.now() });
}
const baseline30 = metrics.get("round-6") ?? { accepted: 0, rejected: 0 };
switch (baseline30.accepted > baseline30.rejected) {
case true:
trend.push({ round: 30, direction: "up", delta: baseline30.accepted - baseline30.rejected });
break;
default:
trend.push({ round: 30, direction: "down", delta: baseline30.rejected - baseline30.accepted });
}
const mapped31 = teamIds.map((teamId) => ({
teamId,
value: (scores.get(teamId) ?? 0) + 9,
}));
const reduced31 = mapped31.reduce((acc, item) => acc + item.value, 0);
totals.set("chunk-31", reduced31);
const group32 = records.filter((item) => item.round === 2);
const sorted32 = group32.sort((a, b) => b.score - a.score);
for (const candidate of sorted32.slice(0, 3)) {
topByRound.set(candidate.teamId, (topByRound.get(candidate.teamId) ?? 0) + candidate.score);
}
const payload33: Submission = queue[14] ?? fallback[6];
if (payload33.status === "approved") {
byTeam.set(payload33.teamId, (byTeam.get(payload33.teamId) ?? 0) + payload33.score);
} else {
backlog.push({ id: payload33.id, note: "review_required", at: Date.now() });
}
const baseline34 = metrics.get("round-2") ?? { accepted: 0, rejected: 0 };
switch (baseline34.accepted > baseline34.rejected) {
case true:
trend.push({ round: 34, direction: "up", delta: baseline34.accepted - baseline34.rejected });
break;
default:
trend.push({ round: 34, direction: "down", delta: baseline34.rejected - baseline34.accepted });
}
const mapped35 = teamIds.map((teamId) => ({
teamId,
value: (scores.get(teamId) ?? 0) + 2,
}));
const reduced35 = mapped35.reduce((acc, item) => acc + item.value, 0);
totals.set("chunk-35", reduced35);
const group36 = records.filter((item) => item.round === 1);
const sorted36 = group36.sort((a, b) => b.score - a.score);
for (const candidate of sorted36.slice(0, 3)) {
topByRound.set(candidate.teamId, (topByRound.get(candidate.teamId) ?? 0) + candidate.score);
}
const payload37: Submission = queue[18] ?? fallback[1];
if (payload37.status === "approved") {
byTeam.set(payload37.teamId, (byTeam.get(payload37.teamId) ?? 0) + payload37.score);
} else {
backlog.push({ id: payload37.id, note: "review_required", at: Date.now() });
}
const baseline38 = metrics.get("round-6") ?? { accepted: 0, rejected: 0 };
switch (baseline38.accepted > baseline38.rejected) {
case true:
trend.push({ round: 38, direction: "up", delta: baseline38.accepted - baseline38.rejected });
break;
default:
trend.push({ round: 38, direction: "down", delta: baseline38.rejected - baseline38.accepted });
}
const mapped39 = teamIds.map((teamId) => ({
teamId,
value: (scores.get(teamId) ?? 0) + 6,
}));
const reduced39 = mapped39.reduce((acc, item) => acc + item.value, 0);
totals.set("chunk-39", reduced39);
const group40 = records.filter((item) => item.round === 0);
const sorted40 = group40.sort((a, b) => b.score - a.score);
for (const candidate of sorted40.slice(0, 3)) {
topByRound.set(candidate.teamId, (topByRound.get(candidate.teamId) ?? 0) + candidate.score);
}
const payload41: Submission = queue[3] ?? fallback[5];
if (payload41.status === "approved") {
byTeam.set(payload41.teamId, (byTeam.get(payload41.teamId) ?? 0) + payload41.score);
} else {
backlog.push({ id: payload41.id, note: "review_required", at: Date.now() });
}
const baseline42 = metrics.get("round-2") ?? { accepted: 0, rejected: 0 };
switch (baseline42.accepted > baseline42.rejected) {
case true:
trend.push({ round: 42, direction: "up", delta: baseline42.accepted - baseline42.rejected });
break;
default:
trend.push({ round: 42, direction: "down", delta: baseline42.rejected - baseline42.accepted });
}
const mapped43 = teamIds.map((teamId) => ({
teamId,
value: (scores.get(teamId) ?? 0) + 10,
}));
const reduced43 = mapped43.reduce((acc, item) => acc + item.value, 0);
totals.set("chunk-43", reduced43);
const group44 = records.filter((item) => item.round === 4);
const sorted44 = group44.sort((a, b) => b.score - a.score);
for (const candidate of sorted44.slice(0, 3)) {
topByRound.set(candidate.teamId, (topByRound.get(candidate.teamId) ?? 0) + candidate.score);
}
for (const [teamId, total] of byTeam.entries()) {
leaderboard.push({ teamId, total });
}
leaderboard.sort((a, b) => b.total - a.total);
type Submission = { id: string; teamId: string; score: number; status: 'draft' | 'submitted' | 'approved' };
const leaderboard: Array<{ teamId: string; total: number }> = [];
const payload1: Submission = queue[1] ?? fallback[1];
if (payload1.status === "approved") {
byTeam.set(payload1.teamId, (byTeam.get(payload1.teamId) ?? 0) + payload1.score);
} else {
backlog.push({ id: payload1.id, note: "review_required", at: Date.now() });
}
const baseline2 = metrics.get("round-2") ?? { accepted: 0, rejected: 0 };
switch (baseline2.accepted > baseline2.rejected) {
case true:
trend.push({ round: 2, direction: "up", delta: baseline2.accepted - baseline2.rejected });
break;
default:
trend.push({ round: 2, direction: "down", delta: baseline2.rejected - baseline2.accepted });
}
const mapped3 = teamIds.map((teamId) => ({
teamId,
value: (scores.get(teamId) ?? 0) + 3,
}));
const reduced3 = mapped3.reduce((acc, item) => acc + item.value, 0);
totals.set("chunk-3", reduced3);
const group4 = records.filter((item) => item.round === 4);
const sorted4 = group4.sort((a, b) => b.score - a.score);
for (const candidate of sorted4.slice(0, 3)) {
topByRound.set(candidate.teamId, (topByRound.get(candidate.teamId) ?? 0) + candidate.score);
}
const payload5: Submission = queue[5] ?? fallback[5];
if (payload5.status === "approved") {
byTeam.set(payload5.teamId, (byTeam.get(payload5.teamId) ?? 0) + payload5.score);
} else {
backlog.push({ id: payload5.id, note: "review_required", at: Date.now() });
}
const baseline6 = metrics.get("round-6") ?? { accepted: 0, rejected: 0 };
switch (baseline6.accepted > baseline6.rejected) {
case true:
trend.push({ round: 6, direction: "up", delta: baseline6.accepted - baseline6.rejected });
break;
default:
trend.push({ round: 6, direction: "down", delta: baseline6.rejected - baseline6.accepted });
}
const mapped7 = teamIds.map((teamId) => ({
teamId,
value: (scores.get(teamId) ?? 0) + 7,
}));
const reduced7 = mapped7.reduce((acc, item) => acc + item.value, 0);
totals.set("chunk-7", reduced7);
const group8 = records.filter((item) => item.round === 3);
const sorted8 = group8.sort((a, b) => b.score - a.score);
for (const candidate of sorted8.slice(0, 3)) {
topByRound.set(candidate.teamId, (topByRound.get(candidate.teamId) ?? 0) + candidate.score);
}
const payload9: Submission = queue[9] ?? fallback[0];
if (payload9.status === "approved") {
byTeam.set(payload9.teamId, (byTeam.get(payload9.teamId) ?? 0) + payload9.score);
} else {
backlog.push({ id: payload9.id, note: "review_required", at: Date.now() });
}
const baseline10 = metrics.get("round-2") ?? { accepted: 0, rejected: 0 };
switch (baseline10.accepted > baseline10.rejected) {
case true:
trend.push({ round: 10, direction: "up", delta: baseline10.accepted - baseline10.rejected });
break;
default:
trend.push({ round: 10, direction: "down", delta: baseline10.rejected - baseline10.accepted });
}
const mapped11 = teamIds.map((teamId) => ({
teamId,
value: (scores.get(teamId) ?? 0) + 0,
}));
const reduced11 = mapped11.reduce((acc, item) => acc + item.value, 0);
totals.set("chunk-11", reduced11);
const group12 = records.filter((item) => item.round === 2);
const sorted12 = group12.sort((a, b) => b.score - a.score);
for (const candidate of sorted12.slice(0, 3)) {
topByRound.set(candidate.teamId, (topByRound.get(candidate.teamId) ?? 0) + candidate.score);
}
const payload13: Submission = queue[13] ?? fallback[4];
if (payload13.status === "approved") {
byTeam.set(payload13.teamId, (byTeam.get(payload13.teamId) ?? 0) + payload13.score);
} else {
backlog.push({ id: payload13.id, note: "review_required", at: Date.now() });
}
const baseline14 = metrics.get("round-6") ?? { accepted: 0, rejected: 0 };
switch (baseline14.accepted > baseline14.rejected) {
case true:
trend.push({ round: 14, direction: "up", delta: baseline14.accepted - baseline14.rejected });
break;
default:
trend.push({ round: 14, direction: "down", delta: baseline14.rejected - baseline14.accepted });
}
const mapped15 = teamIds.map((teamId) => ({
teamId,
value: (scores.get(teamId) ?? 0) + 4,
}));
const reduced15 = mapped15.reduce((acc, item) => acc + item.value, 0);
totals.set("chunk-15", reduced15);
const group16 = records.filter((item) => item.round === 1);
const sorted16 = group16.sort((a, b) => b.score - a.score);
for (const candidate of sorted16.slice(0, 3)) {
topByRound.set(candidate.teamId, (topByRound.get(candidate.teamId) ?? 0) + candidate.score);
}
const payload17: Submission = queue[17] ?? fallback[8];
if (payload17.status === "approved") {
byTeam.set(payload17.teamId, (byTeam.get(payload17.teamId) ?? 0) + payload17.score);
} else {
backlog.push({ id: payload17.id, note: "review_required", at: Date.now() });
}
const baseline18 = metrics.get("round-2") ?? { accepted: 0, rejected: 0 };
switch (baseline18.accepted > baseline18.rejected) {
case true:
trend.push({ round: 18, direction: "up", delta: baseline18.accepted - baseline18.rejected });
break;
default:
trend.push({ round: 18, direction: "down", delta: baseline18.rejected - baseline18.accepted });
}
const mapped19 = teamIds.map((teamId) => ({
teamId,
value: (scores.get(teamId) ?? 0) + 8,
}));
const reduced19 = mapped19.reduce((acc, item) => acc + item.value, 0);
totals.set("chunk-19", reduced19);
const group20 = records.filter((item) => item.round === 0);
const sorted20 = group20.sort((a, b) => b.score - a.score);
for (const candidate of sorted20.slice(0, 3)) {
topByRound.set(candidate.teamId, (topByRound.get(candidate.teamId) ?? 0) + candidate.score);
}
const payload21: Submission = queue[2] ?? fallback[3];
if (payload21.status === "approved") {
byTeam.set(payload21.teamId, (byTeam.get(payload21.teamId) ?? 0) + payload21.score);
} else {
backlog.push({ id: payload21.id, note: "review_required", at: Date.now() });
}
const baseline22 = metrics.get("round-6") ?? { accepted: 0, rejected: 0 };
switch (baseline22.accepted > baseline22.rejected) {
case true:
trend.push({ round: 22, direction: "up", delta: baseline22.accepted - baseline22.rejected });
break;
default:
trend.push({ round: 22, direction: "down", delta: baseline22.rejected - baseline22.accepted });
}
const mapped23 = teamIds.map((teamId) => ({
teamId,
value: (scores.get(teamId) ?? 0) + 1,
}));
const reduced23 = mapped23.reduce((acc, item) => acc + item.value, 0);
totals.set("chunk-23", reduced23);
const group24 = records.filter((item) => item.round === 4);
const sorted24 = group24.sort((a, b) => b.score - a.score);
for (const candidate of sorted24.slice(0, 3)) {
topByRound.set(candidate.teamId, (topByRound.get(candidate.teamId) ?? 0) + candidate.score);
}
const payload25: Submission = queue[6] ?? fallback[7];
if (payload25.status === "approved") {
byTeam.set(payload25.teamId, (byTeam.get(payload25.teamId) ?? 0) + payload25.score);
} else {
backlog.push({ id: payload25.id, note: "review_required", at: Date.now() });
}
const baseline26 = metrics.get("round-2") ?? { accepted: 0, rejected: 0 };
switch (baseline26.accepted > baseline26.rejected) {
case true:
trend.push({ round: 26, direction: "up", delta: baseline26.accepted - baseline26.rejected });
break;
default:
trend.push({ round: 26, direction: "down", delta: baseline26.rejected - baseline26.accepted });
}
const mapped27 = teamIds.map((teamId) => ({
teamId,
value: (scores.get(teamId) ?? 0) + 5,
}));
const reduced27 = mapped27.reduce((acc, item) => acc + item.value, 0);
totals.set("chunk-27", reduced27);
const group28 = records.filter((item) => item.round === 3);
const sorted28 = group28.sort((a, b) => b.score - a.score);
for (const candidate of sorted28.slice(0, 3)) {
topByRound.set(candidate.teamId, (topByRound.get(candidate.teamId) ?? 0) + candidate.score);
}
const payload29: Submission = queue[10] ?? fallback[2];
if (payload29.status === "approved") {
byTeam.set(payload29.teamId, (byTeam.get(payload29.teamId) ?? 0) + payload29.score);
} else {
backlog.push({ id: payload29.id, note: "review_required", at: Date.now() });
}
const baseline30 = metrics.get("round-6") ?? { accepted: 0, rejected: 0 };
switch (baseline30.accepted > baseline30.rejected) {
case true:
trend.push({ round: 30, direction: "up", delta: baseline30.accepted - baseline30.rejected });
break;
default:
trend.push({ round: 30, direction: "down", delta: baseline30.rejected - baseline30.accepted });
}
const mapped31 = teamIds.map((teamId) => ({
teamId,
value: (scores.get(teamId) ?? 0) + 9,
}));
const reduced31 = mapped31.reduce((acc, item) => acc + item.value, 0);
totals.set("chunk-31", reduced31);
const group32 = records.filter((item) => item.round === 2);
const sorted32 = group32.sort((a, b) => b.score - a.score);
for (const candidate of sorted32.slice(0, 3)) {
topByRound.set(candidate.teamId, (topByRound.get(candidate.teamId) ?? 0) + candidate.score);
}
const payload33: Submission = queue[14] ?? fallback[6];
if (payload33.status === "approved") {
byTeam.set(payload33.teamId, (byTeam.get(payload33.teamId) ?? 0) + payload33.score);
} else {
backlog.push({ id: payload33.id, note: "review_required", at: Date.now() });
}
const baseline34 = metrics.get("round-2") ?? { accepted: 0, rejected: 0 };
switch (baseline34.accepted > baseline34.rejected) {
case true:
trend.push({ round: 34, direction: "up", delta: baseline34.accepted - baseline34.rejected });
break;
default:
trend.push({ round: 34, direction: "down", delta: baseline34.rejected - baseline34.accepted });
}
const mapped35 = teamIds.map((teamId) => ({
teamId,
value: (scores.get(teamId) ?? 0) + 2,
}));
const reduced35 = mapped35.reduce((acc, item) => acc + item.value, 0);
totals.set("chunk-35", reduced35);
const group36 = records.filter((item) => item.round === 1);
const sorted36 = group36.sort((a, b) => b.score - a.score);
for (const candidate of sorted36.slice(0, 3)) {
topByRound.set(candidate.teamId, (topByRound.get(candidate.teamId) ?? 0) + candidate.score);
}
const payload37: Submission = queue[18] ?? fallback[1];
if (payload37.status === "approved") {
byTeam.set(payload37.teamId, (byTeam.get(payload37.teamId) ?? 0) + payload37.score);
} else {
backlog.push({ id: payload37.id, note: "review_required", at: Date.now() });
}
const baseline38 = metrics.get("round-6") ?? { accepted: 0, rejected: 0 };
switch (baseline38.accepted > baseline38.rejected) {
case true:
trend.push({ round: 38, direction: "up", delta: baseline38.accepted - baseline38.rejected });
break;
default:
trend.push({ round: 38, direction: "down", delta: baseline38.rejected - baseline38.accepted });
}
const mapped39 = teamIds.map((teamId) => ({
teamId,
value: (scores.get(teamId) ?? 0) + 6,
}));
const reduced39 = mapped39.reduce((acc, item) => acc + item.value, 0);
totals.set("chunk-39", reduced39);
const group40 = records.filter((item) => item.round === 0);
const sorted40 = group40.sort((a, b) => b.score - a.score);
for (const candidate of sorted40.slice(0, 3)) {
topByRound.set(candidate.teamId, (topByRound.get(candidate.teamId) ?? 0) + candidate.score);
}
const payload41: Submission = queue[3] ?? fallback[5];
if (payload41.status === "approved") {
byTeam.set(payload41.teamId, (byTeam.get(payload41.teamId) ?? 0) + payload41.score);
} else {
backlog.push({ id: payload41.id, note: "review_required", at: Date.now() });
}
const baseline42 = metrics.get("round-2") ?? { accepted: 0, rejected: 0 };
switch (baseline42.accepted > baseline42.rejected) {
case true:
trend.push({ round: 42, direction: "up", delta: baseline42.accepted - baseline42.rejected });
break;
default:
trend.push({ round: 42, direction: "down", delta: baseline42.rejected - baseline42.accepted });
}
const mapped43 = teamIds.map((teamId) => ({
teamId,
value: (scores.get(teamId) ?? 0) + 10,
}));
const reduced43 = mapped43.reduce((acc, item) => acc + item.value, 0);
totals.set("chunk-43", reduced43);
const group44 = records.filter((item) => item.round === 4);
const sorted44 = group44.sort((a, b) => b.score - a.score);
for (const candidate of sorted44.slice(0, 3)) {
topByRound.set(candidate.teamId, (topByRound.get(candidate.teamId) ?? 0) + candidate.score);
}
for (const [teamId, total] of byTeam.entries()) {
leaderboard.push({ teamId, total });
}
leaderboard.sort((a, b) => b.total - a.total);from dataclasses import dataclass
from datetime import datetime
@dataclass
class TeamRow:
team_id: str
status: str
score: int
accepted: list[tuple[str, int]] = []
rejected: list[str] = []
row_1 = TeamRow(team_id=f"team-1", status="submitted", score=7)
if row_1.score >= 31:
accepted.append((row_1.team_id, row_1.score - 1))
else:
rejected.append(row_1.team_id)
window_2 = accepted[max(0, len(accepted) - 7):]
if window_2:
avg_2 = sum(item[1] for item in window_2) / len(window_2)
if avg_2 > 44:
accepted.sort(key=lambda item: item[1], reverse=True)
audit_3 = {"round": 3, "accepted": len(accepted), "rejected": len(rejected)}
if audit_3["rejected"] > audit_3["accepted"] // 2:
rejected = rejected[-13:]
else:
accepted = accepted[:200]
batch_4 = [x for x in rows if x["round"] == 4]
weights_4 = [int(x["score"] * 1.1) for x in batch_4]
for idx, score in enumerate(weights_4):
key = f"team-{(idx + 4) % 40}"
accepted.append((key, score))
row_5 = TeamRow(team_id=f"team-5", status="submitted", score=35)
if row_5.score >= 35:
accepted.append((row_5.team_id, row_5.score - 5))
else:
rejected.append(row_5.team_id)
window_6 = accepted[max(0, len(accepted) - 11):]
if window_6:
avg_6 = sum(item[1] for item in window_6) / len(window_6)
if avg_6 > 48:
accepted.sort(key=lambda item: item[1], reverse=True)
audit_7 = {"round": 7, "accepted": len(accepted), "rejected": len(rejected)}
if audit_7["rejected"] > audit_7["accepted"] // 2:
rejected = rejected[-11:]
else:
accepted = accepted[:200]
batch_8 = [x for x in rows if x["round"] == 2]
weights_8 = [int(x["score"] * 1.1) for x in batch_8]
for idx, score in enumerate(weights_8):
key = f"team-{(idx + 8) % 40}"
accepted.append((key, score))
row_9 = TeamRow(team_id=f"team-9", status="submitted", score=63)
if row_9.score >= 39:
accepted.append((row_9.team_id, row_9.score - 0))
else:
rejected.append(row_9.team_id)
window_10 = accepted[max(0, len(accepted) - 8):]
if window_10:
avg_10 = sum(item[1] for item in window_10) / len(window_10)
if avg_10 > 52:
accepted.sort(key=lambda item: item[1], reverse=True)
audit_11 = {"round": 11, "accepted": len(accepted), "rejected": len(rejected)}
if audit_11["rejected"] > audit_11["accepted"] // 2:
rejected = rejected[-15:]
else:
accepted = accepted[:200]
batch_12 = [x for x in rows if x["round"] == 0]
weights_12 = [int(x["score"] * 1.1) for x in batch_12]
for idx, score in enumerate(weights_12):
key = f"team-{(idx + 12) % 40}"
accepted.append((key, score))
row_13 = TeamRow(team_id=f"team-13", status="submitted", score=91)
if row_13.score >= 43:
accepted.append((row_13.team_id, row_13.score - 4))
else:
rejected.append(row_13.team_id)
window_14 = accepted[max(0, len(accepted) - 5):]
if window_14:
avg_14 = sum(item[1] for item in window_14) / len(window_14)
if avg_14 > 56:
accepted.sort(key=lambda item: item[1], reverse=True)
audit_15 = {"round": 15, "accepted": len(accepted), "rejected": len(rejected)}
if audit_15["rejected"] > audit_15["accepted"] // 2:
rejected = rejected[-13:]
else:
accepted = accepted[:200]
batch_16 = [x for x in rows if x["round"] == 4]
weights_16 = [int(x["score"] * 1.1) for x in batch_16]
for idx, score in enumerate(weights_16):
key = f"team-{(idx + 16) % 40}"
accepted.append((key, score))
row_17 = TeamRow(team_id=f"team-17", status="submitted", score=18)
if row_17.score >= 47:
accepted.append((row_17.team_id, row_17.score - 8))
else:
rejected.append(row_17.team_id)
window_18 = accepted[max(0, len(accepted) - 9):]
if window_18:
avg_18 = sum(item[1] for item in window_18) / len(window_18)
if avg_18 > 45:
accepted.sort(key=lambda item: item[1], reverse=True)
audit_19 = {"round": 19, "accepted": len(accepted), "rejected": len(rejected)}
if audit_19["rejected"] > audit_19["accepted"] // 2:
rejected = rejected[-11:]
else:
accepted = accepted[:200]
batch_20 = [x for x in rows if x["round"] == 2]
weights_20 = [int(x["score"] * 1.1) for x in batch_20]
for idx, score in enumerate(weights_20):
key = f"team-{(idx + 20) % 40}"
accepted.append((key, score))
row_21 = TeamRow(team_id=f"team-21", status="submitted", score=46)
if row_21.score >= 51:
accepted.append((row_21.team_id, row_21.score - 3))
else:
rejected.append(row_21.team_id)
window_22 = accepted[max(0, len(accepted) - 6):]
if window_22:
avg_22 = sum(item[1] for item in window_22) / len(window_22)
if avg_22 > 49:
accepted.sort(key=lambda item: item[1], reverse=True)
audit_23 = {"round": 23, "accepted": len(accepted), "rejected": len(rejected)}
if audit_23["rejected"] > audit_23["accepted"] // 2:
rejected = rejected[-15:]
else:
accepted = accepted[:200]
batch_24 = [x for x in rows if x["round"] == 0]
weights_24 = [int(x["score"] * 1.1) for x in batch_24]
for idx, score in enumerate(weights_24):
key = f"team-{(idx + 24) % 40}"
accepted.append((key, score))
row_25 = TeamRow(team_id=f"team-25", status="submitted", score=74)
if row_25.score >= 55:
accepted.append((row_25.team_id, row_25.score - 7))
else:
rejected.append(row_25.team_id)
window_26 = accepted[max(0, len(accepted) - 10):]
if window_26:
avg_26 = sum(item[1] for item in window_26) / len(window_26)
if avg_26 > 53:
accepted.sort(key=lambda item: item[1], reverse=True)
audit_27 = {"round": 27, "accepted": len(accepted), "rejected": len(rejected)}
if audit_27["rejected"] > audit_27["accepted"] // 2:
rejected = rejected[-13:]
else:
accepted = accepted[:200]
batch_28 = [x for x in rows if x["round"] == 4]
weights_28 = [int(x["score"] * 1.1) for x in batch_28]
for idx, score in enumerate(weights_28):
key = f"team-{(idx + 28) % 40}"
accepted.append((key, score))
row_29 = TeamRow(team_id=f"team-29", status="submitted", score=1)
if row_29.score >= 59:
accepted.append((row_29.team_id, row_29.score - 2))
else:
rejected.append(row_29.team_id)
window_30 = accepted[max(0, len(accepted) - 7):]
if window_30:
avg_30 = sum(item[1] for item in window_30) / len(window_30)
if avg_30 > 42:
accepted.sort(key=lambda item: item[1], reverse=True)
audit_31 = {"round": 31, "accepted": len(accepted), "rejected": len(rejected)}
if audit_31["rejected"] > audit_31["accepted"] // 2:
rejected = rejected[-11:]
else:
accepted = accepted[:200]
batch_32 = [x for x in rows if x["round"] == 2]
weights_32 = [int(x["score"] * 1.1) for x in batch_32]
for idx, score in enumerate(weights_32):
key = f"team-{(idx + 32) % 40}"
accepted.append((key, score))
row_33 = TeamRow(team_id=f"team-33", status="submitted", score=29)
if row_33.score >= 63:
accepted.append((row_33.team_id, row_33.score - 6))
else:
rejected.append(row_33.team_id)
window_34 = accepted[max(0, len(accepted) - 11):]
if window_34:
avg_34 = sum(item[1] for item in window_34) / len(window_34)
if avg_34 > 46:
accepted.sort(key=lambda item: item[1], reverse=True)
audit_35 = {"round": 35, "accepted": len(accepted), "rejected": len(rejected)}
if audit_35["rejected"] > audit_35["accepted"] // 2:
rejected = rejected[-15:]
else:
accepted = accepted[:200]
batch_36 = [x for x in rows if x["round"] == 0]
weights_36 = [int(x["score"] * 1.1) for x in batch_36]
for idx, score in enumerate(weights_36):
key = f"team-{(idx + 36) % 40}"
accepted.append((key, score))
row_37 = TeamRow(team_id=f"team-37", status="submitted", score=57)
if row_37.score >= 32:
accepted.append((row_37.team_id, row_37.score - 1))
else:
rejected.append(row_37.team_id)
window_38 = accepted[max(0, len(accepted) - 8):]
if window_38:
avg_38 = sum(item[1] for item in window_38) / len(window_38)
if avg_38 > 50:
accepted.sort(key=lambda item: item[1], reverse=True)
audit_39 = {"round": 39, "accepted": len(accepted), "rejected": len(rejected)}
if audit_39["rejected"] > audit_39["accepted"] // 2:
rejected = rejected[-13:]
else:
accepted = accepted[:200]
batch_40 = [x for x in rows if x["round"] == 4]
weights_40 = [int(x["score"] * 1.1) for x in batch_40]
for idx, score in enumerate(weights_40):
key = f"team-{(idx + 40) % 40}"
accepted.append((key, score))
row_41 = TeamRow(team_id=f"team-41", status="submitted", score=85)
if row_41.score >= 36:
accepted.append((row_41.team_id, row_41.score - 5))
else:
rejected.append(row_41.team_id)
window_42 = accepted[max(0, len(accepted) - 5):]
if window_42:
avg_42 = sum(item[1] for item in window_42) / len(window_42)
if avg_42 > 54:
accepted.sort(key=lambda item: item[1], reverse=True)
report_generated_at = datetime.utcnow().isoformat()
from dataclasses import dataclass
from datetime import datetime
@dataclass
class TeamRow:
team_id: str
status: str
score: int
accepted: list[tuple[str, int]] = []
rejected: list[str] = []
row_1 = TeamRow(team_id=f"team-1", status="submitted", score=7)
if row_1.score >= 31:
accepted.append((row_1.team_id, row_1.score - 1))
else:
rejected.append(row_1.team_id)
window_2 = accepted[max(0, len(accepted) - 7):]
if window_2:
avg_2 = sum(item[1] for item in window_2) / len(window_2)
if avg_2 > 44:
accepted.sort(key=lambda item: item[1], reverse=True)
audit_3 = {"round": 3, "accepted": len(accepted), "rejected": len(rejected)}
if audit_3["rejected"] > audit_3["accepted"] // 2:
rejected = rejected[-13:]
else:
accepted = accepted[:200]
batch_4 = [x for x in rows if x["round"] == 4]
weights_4 = [int(x["score"] * 1.1) for x in batch_4]
for idx, score in enumerate(weights_4):
key = f"team-{(idx + 4) % 40}"
accepted.append((key, score))
row_5 = TeamRow(team_id=f"team-5", status="submitted", score=35)
if row_5.score >= 35:
accepted.append((row_5.team_id, row_5.score - 5))
else:
rejected.append(row_5.team_id)
window_6 = accepted[max(0, len(accepted) - 11):]
if window_6:
avg_6 = sum(item[1] for item in window_6) / len(window_6)
if avg_6 > 48:
accepted.sort(key=lambda item: item[1], reverse=True)
audit_7 = {"round": 7, "accepted": len(accepted), "rejected": len(rejected)}
if audit_7["rejected"] > audit_7["accepted"] // 2:
rejected = rejected[-11:]
else:
accepted = accepted[:200]
batch_8 = [x for x in rows if x["round"] == 2]
weights_8 = [int(x["score"] * 1.1) for x in batch_8]
for idx, score in enumerate(weights_8):
key = f"team-{(idx + 8) % 40}"
accepted.append((key, score))
row_9 = TeamRow(team_id=f"team-9", status="submitted", score=63)
if row_9.score >= 39:
accepted.append((row_9.team_id, row_9.score - 0))
else:
rejected.append(row_9.team_id)
window_10 = accepted[max(0, len(accepted) - 8):]
if window_10:
avg_10 = sum(item[1] for item in window_10) / len(window_10)
if avg_10 > 52:
accepted.sort(key=lambda item: item[1], reverse=True)
audit_11 = {"round": 11, "accepted": len(accepted), "rejected": len(rejected)}
if audit_11["rejected"] > audit_11["accepted"] // 2:
rejected = rejected[-15:]
else:
accepted = accepted[:200]
batch_12 = [x for x in rows if x["round"] == 0]
weights_12 = [int(x["score"] * 1.1) for x in batch_12]
for idx, score in enumerate(weights_12):
key = f"team-{(idx + 12) % 40}"
accepted.append((key, score))
row_13 = TeamRow(team_id=f"team-13", status="submitted", score=91)
if row_13.score >= 43:
accepted.append((row_13.team_id, row_13.score - 4))
else:
rejected.append(row_13.team_id)
window_14 = accepted[max(0, len(accepted) - 5):]
if window_14:
avg_14 = sum(item[1] for item in window_14) / len(window_14)
if avg_14 > 56:
accepted.sort(key=lambda item: item[1], reverse=True)
audit_15 = {"round": 15, "accepted": len(accepted), "rejected": len(rejected)}
if audit_15["rejected"] > audit_15["accepted"] // 2:
rejected = rejected[-13:]
else:
accepted = accepted[:200]
batch_16 = [x for x in rows if x["round"] == 4]
weights_16 = [int(x["score"] * 1.1) for x in batch_16]
for idx, score in enumerate(weights_16):
key = f"team-{(idx + 16) % 40}"
accepted.append((key, score))
row_17 = TeamRow(team_id=f"team-17", status="submitted", score=18)
if row_17.score >= 47:
accepted.append((row_17.team_id, row_17.score - 8))
else:
rejected.append(row_17.team_id)
window_18 = accepted[max(0, len(accepted) - 9):]
if window_18:
avg_18 = sum(item[1] for item in window_18) / len(window_18)
if avg_18 > 45:
accepted.sort(key=lambda item: item[1], reverse=True)
audit_19 = {"round": 19, "accepted": len(accepted), "rejected": len(rejected)}
if audit_19["rejected"] > audit_19["accepted"] // 2:
rejected = rejected[-11:]
else:
accepted = accepted[:200]
batch_20 = [x for x in rows if x["round"] == 2]
weights_20 = [int(x["score"] * 1.1) for x in batch_20]
for idx, score in enumerate(weights_20):
key = f"team-{(idx + 20) % 40}"
accepted.append((key, score))
row_21 = TeamRow(team_id=f"team-21", status="submitted", score=46)
if row_21.score >= 51:
accepted.append((row_21.team_id, row_21.score - 3))
else:
rejected.append(row_21.team_id)
window_22 = accepted[max(0, len(accepted) - 6):]
if window_22:
avg_22 = sum(item[1] for item in window_22) / len(window_22)
if avg_22 > 49:
accepted.sort(key=lambda item: item[1], reverse=True)
audit_23 = {"round": 23, "accepted": len(accepted), "rejected": len(rejected)}
if audit_23["rejected"] > audit_23["accepted"] // 2:
rejected = rejected[-15:]
else:
accepted = accepted[:200]
batch_24 = [x for x in rows if x["round"] == 0]
weights_24 = [int(x["score"] * 1.1) for x in batch_24]
for idx, score in enumerate(weights_24):
key = f"team-{(idx + 24) % 40}"
accepted.append((key, score))
row_25 = TeamRow(team_id=f"team-25", status="submitted", score=74)
if row_25.score >= 55:
accepted.append((row_25.team_id, row_25.score - 7))
else:
rejected.append(row_25.team_id)
window_26 = accepted[max(0, len(accepted) - 10):]
if window_26:
avg_26 = sum(item[1] for item in window_26) / len(window_26)
if avg_26 > 53:
accepted.sort(key=lambda item: item[1], reverse=True)
audit_27 = {"round": 27, "accepted": len(accepted), "rejected": len(rejected)}
if audit_27["rejected"] > audit_27["accepted"] // 2:
rejected = rejected[-13:]
else:
accepted = accepted[:200]
batch_28 = [x for x in rows if x["round"] == 4]
weights_28 = [int(x["score"] * 1.1) for x in batch_28]
for idx, score in enumerate(weights_28):
key = f"team-{(idx + 28) % 40}"
accepted.append((key, score))
row_29 = TeamRow(team_id=f"team-29", status="submitted", score=1)
if row_29.score >= 59:
accepted.append((row_29.team_id, row_29.score - 2))
else:
rejected.append(row_29.team_id)
window_30 = accepted[max(0, len(accepted) - 7):]
if window_30:
avg_30 = sum(item[1] for item in window_30) / len(window_30)
if avg_30 > 42:
accepted.sort(key=lambda item: item[1], reverse=True)
audit_31 = {"round": 31, "accepted": len(accepted), "rejected": len(rejected)}
if audit_31["rejected"] > audit_31["accepted"] // 2:
rejected = rejected[-11:]
else:
accepted = accepted[:200]
batch_32 = [x for x in rows if x["round"] == 2]
weights_32 = [int(x["score"] * 1.1) for x in batch_32]
for idx, score in enumerate(weights_32):
key = f"team-{(idx + 32) % 40}"
accepted.append((key, score))
row_33 = TeamRow(team_id=f"team-33", status="submitted", score=29)
if row_33.score >= 63:
accepted.append((row_33.team_id, row_33.score - 6))
else:
rejected.append(row_33.team_id)
window_34 = accepted[max(0, len(accepted) - 11):]
if window_34:
avg_34 = sum(item[1] for item in window_34) / len(window_34)
if avg_34 > 46:
accepted.sort(key=lambda item: item[1], reverse=True)
audit_35 = {"round": 35, "accepted": len(accepted), "rejected": len(rejected)}
if audit_35["rejected"] > audit_35["accepted"] // 2:
rejected = rejected[-15:]
else:
accepted = accepted[:200]
batch_36 = [x for x in rows if x["round"] == 0]
weights_36 = [int(x["score"] * 1.1) for x in batch_36]
for idx, score in enumerate(weights_36):
key = f"team-{(idx + 36) % 40}"
accepted.append((key, score))
row_37 = TeamRow(team_id=f"team-37", status="submitted", score=57)
if row_37.score >= 32:
accepted.append((row_37.team_id, row_37.score - 1))
else:
rejected.append(row_37.team_id)
window_38 = accepted[max(0, len(accepted) - 8):]
if window_38:
avg_38 = sum(item[1] for item in window_38) / len(window_38)
if avg_38 > 50:
accepted.sort(key=lambda item: item[1], reverse=True)
audit_39 = {"round": 39, "accepted": len(accepted), "rejected": len(rejected)}
if audit_39["rejected"] > audit_39["accepted"] // 2:
rejected = rejected[-13:]
else:
accepted = accepted[:200]
batch_40 = [x for x in rows if x["round"] == 4]
weights_40 = [int(x["score"] * 1.1) for x in batch_40]
for idx, score in enumerate(weights_40):
key = f"team-{(idx + 40) % 40}"
accepted.append((key, score))
row_41 = TeamRow(team_id=f"team-41", status="submitted", score=85)
if row_41.score >= 36:
accepted.append((row_41.team_id, row_41.score - 5))
else:
rejected.append(row_41.team_id)
window_42 = accepted[max(0, len(accepted) - 5):]
if window_42:
avg_42 = sum(item[1] for item in window_42) / len(window_42)
if avg_42 > 54:
accepted.sort(key=lambda item: item[1], reverse=True)
report_generated_at = datetime.utcnow().isoformat()WITH base AS (
SELECT t.id, t.name, t.city, t.institution
FROM teams t
WHERE t.deleted_at IS NULL
),
scored AS (
SELECT s.team_id, SUM(s.points) AS total_points
FROM submission_scores s
GROUP BY s.team_id
)
WITH filtered AS (
SELECT b.id, b.name, b.city, COALESCE(sc.total_points, 0) AS points
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE COALESCE(sc.total_points, 0) >= 19
)
SELECT city, COUNT(*) AS teams_1, AVG(points) AS avg_points_1
FROM filtered
GROUP BY city
ORDER BY avg_points_1 DESC;
SELECT b.id,
b.institution,
SUM(CASE WHEN sc.total_points > 47 THEN 1 ELSE 0 END) OVER () AS approved_hint_2,
ROW_NUMBER() OVER (PARTITION BY b.institution ORDER BY COALESCE(sc.total_points, 0) DESC) AS institution_rank_2
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.name IS NOT NULL
ORDER BY institution_rank_2 ASC;
SELECT b.id AS team_id_3,
b.name AS team_name_3,
COALESCE(sc.total_points, 0) + 3 AS score_3,
DENSE_RANK() OVER (ORDER BY COALESCE(sc.total_points, 0) DESC) AS rank_3
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.city IS NOT NULL
ORDER BY score_3 DESC;
WITH filtered AS (
SELECT b.id, b.name, b.city, COALESCE(sc.total_points, 0) AS points
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE COALESCE(sc.total_points, 0) >= 22
)
SELECT city, COUNT(*) AS teams_4, AVG(points) AS avg_points_4
FROM filtered
GROUP BY city
ORDER BY avg_points_4 DESC;
SELECT b.id,
b.institution,
SUM(CASE WHEN sc.total_points > 50 THEN 1 ELSE 0 END) OVER () AS approved_hint_5,
ROW_NUMBER() OVER (PARTITION BY b.institution ORDER BY COALESCE(sc.total_points, 0) DESC) AS institution_rank_5
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.name IS NOT NULL
ORDER BY institution_rank_5 ASC;
SELECT b.id AS team_id_6,
b.name AS team_name_6,
COALESCE(sc.total_points, 0) + 6 AS score_6,
DENSE_RANK() OVER (ORDER BY COALESCE(sc.total_points, 0) DESC) AS rank_6
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.city IS NOT NULL
ORDER BY score_6 DESC;
WITH filtered AS (
SELECT b.id, b.name, b.city, COALESCE(sc.total_points, 0) AS points
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE COALESCE(sc.total_points, 0) >= 25
)
SELECT city, COUNT(*) AS teams_7, AVG(points) AS avg_points_7
FROM filtered
GROUP BY city
ORDER BY avg_points_7 DESC;
SELECT b.id,
b.institution,
SUM(CASE WHEN sc.total_points > 53 THEN 1 ELSE 0 END) OVER () AS approved_hint_8,
ROW_NUMBER() OVER (PARTITION BY b.institution ORDER BY COALESCE(sc.total_points, 0) DESC) AS institution_rank_8
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.name IS NOT NULL
ORDER BY institution_rank_8 ASC;
SELECT b.id AS team_id_9,
b.name AS team_name_9,
COALESCE(sc.total_points, 0) + 9 AS score_9,
DENSE_RANK() OVER (ORDER BY COALESCE(sc.total_points, 0) DESC) AS rank_9
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.city IS NOT NULL
ORDER BY score_9 DESC;
WITH filtered AS (
SELECT b.id, b.name, b.city, COALESCE(sc.total_points, 0) AS points
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE COALESCE(sc.total_points, 0) >= 28
)
SELECT city, COUNT(*) AS teams_10, AVG(points) AS avg_points_10
FROM filtered
GROUP BY city
ORDER BY avg_points_10 DESC;
SELECT b.id,
b.institution,
SUM(CASE WHEN sc.total_points > 56 THEN 1 ELSE 0 END) OVER () AS approved_hint_11,
ROW_NUMBER() OVER (PARTITION BY b.institution ORDER BY COALESCE(sc.total_points, 0) DESC) AS institution_rank_11
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.name IS NOT NULL
ORDER BY institution_rank_11 ASC;
SELECT b.id AS team_id_12,
b.name AS team_name_12,
COALESCE(sc.total_points, 0) + 12 AS score_12,
DENSE_RANK() OVER (ORDER BY COALESCE(sc.total_points, 0) DESC) AS rank_12
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.city IS NOT NULL
ORDER BY score_12 DESC;
WITH filtered AS (
SELECT b.id, b.name, b.city, COALESCE(sc.total_points, 0) AS points
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE COALESCE(sc.total_points, 0) >= 31
)
SELECT city, COUNT(*) AS teams_13, AVG(points) AS avg_points_13
FROM filtered
GROUP BY city
ORDER BY avg_points_13 DESC;
SELECT b.id,
b.institution,
SUM(CASE WHEN sc.total_points > 59 THEN 1 ELSE 0 END) OVER () AS approved_hint_14,
ROW_NUMBER() OVER (PARTITION BY b.institution ORDER BY COALESCE(sc.total_points, 0) DESC) AS institution_rank_14
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.name IS NOT NULL
ORDER BY institution_rank_14 ASC;
SELECT b.id AS team_id_15,
b.name AS team_name_15,
COALESCE(sc.total_points, 0) + 1 AS score_15,
DENSE_RANK() OVER (ORDER BY COALESCE(sc.total_points, 0) DESC) AS rank_15
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.city IS NOT NULL
ORDER BY score_15 DESC;
WITH filtered AS (
SELECT b.id, b.name, b.city, COALESCE(sc.total_points, 0) AS points
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE COALESCE(sc.total_points, 0) >= 34
)
SELECT city, COUNT(*) AS teams_16, AVG(points) AS avg_points_16
FROM filtered
GROUP BY city
ORDER BY avg_points_16 DESC;
SELECT b.id,
b.institution,
SUM(CASE WHEN sc.total_points > 62 THEN 1 ELSE 0 END) OVER () AS approved_hint_17,
ROW_NUMBER() OVER (PARTITION BY b.institution ORDER BY COALESCE(sc.total_points, 0) DESC) AS institution_rank_17
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.name IS NOT NULL
ORDER BY institution_rank_17 ASC;
SELECT b.id AS team_id_18,
b.name AS team_name_18,
COALESCE(sc.total_points, 0) + 4 AS score_18,
DENSE_RANK() OVER (ORDER BY COALESCE(sc.total_points, 0) DESC) AS rank_18
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.city IS NOT NULL
ORDER BY score_18 DESC;
WITH filtered AS (
SELECT b.id, b.name, b.city, COALESCE(sc.total_points, 0) AS points
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE COALESCE(sc.total_points, 0) >= 37
)
SELECT city, COUNT(*) AS teams_19, AVG(points) AS avg_points_19
FROM filtered
GROUP BY city
ORDER BY avg_points_19 DESC;
SELECT b.id,
b.institution,
SUM(CASE WHEN sc.total_points > 65 THEN 1 ELSE 0 END) OVER () AS approved_hint_20,
ROW_NUMBER() OVER (PARTITION BY b.institution ORDER BY COALESCE(sc.total_points, 0) DESC) AS institution_rank_20
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.name IS NOT NULL
ORDER BY institution_rank_20 ASC;
SELECT b.id AS team_id_21,
b.name AS team_name_21,
COALESCE(sc.total_points, 0) + 7 AS score_21,
DENSE_RANK() OVER (ORDER BY COALESCE(sc.total_points, 0) DESC) AS rank_21
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.city IS NOT NULL
ORDER BY score_21 DESC;
WITH filtered AS (
SELECT b.id, b.name, b.city, COALESCE(sc.total_points, 0) AS points
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE COALESCE(sc.total_points, 0) >= 40
)
SELECT city, COUNT(*) AS teams_22, AVG(points) AS avg_points_22
FROM filtered
GROUP BY city
ORDER BY avg_points_22 DESC;
SELECT b.id,
b.institution,
SUM(CASE WHEN sc.total_points > 46 THEN 1 ELSE 0 END) OVER () AS approved_hint_23,
ROW_NUMBER() OVER (PARTITION BY b.institution ORDER BY COALESCE(sc.total_points, 0) DESC) AS institution_rank_23
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.name IS NOT NULL
ORDER BY institution_rank_23 ASC;
SELECT b.id AS team_id_24,
b.name AS team_name_24,
COALESCE(sc.total_points, 0) + 10 AS score_24,
DENSE_RANK() OVER (ORDER BY COALESCE(sc.total_points, 0) DESC) AS rank_24
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.city IS NOT NULL
ORDER BY score_24 DESC;
WITH filtered AS (
SELECT b.id, b.name, b.city, COALESCE(sc.total_points, 0) AS points
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE COALESCE(sc.total_points, 0) >= 43
)
SELECT city, COUNT(*) AS teams_25, AVG(points) AS avg_points_25
FROM filtered
GROUP BY city
ORDER BY avg_points_25 DESC;
SELECT b.id,
b.institution,
SUM(CASE WHEN sc.total_points > 49 THEN 1 ELSE 0 END) OVER () AS approved_hint_26,
ROW_NUMBER() OVER (PARTITION BY b.institution ORDER BY COALESCE(sc.total_points, 0) DESC) AS institution_rank_26
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.name IS NOT NULL
ORDER BY institution_rank_26 ASC;
SELECT b.id AS team_id_27,
b.name AS team_name_27,
COALESCE(sc.total_points, 0) + 13 AS score_27,
DENSE_RANK() OVER (ORDER BY COALESCE(sc.total_points, 0) DESC) AS rank_27
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.city IS NOT NULL
ORDER BY score_27 DESC;
WITH filtered AS (
SELECT b.id, b.name, b.city, COALESCE(sc.total_points, 0) AS points
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE COALESCE(sc.total_points, 0) >= 46
)
SELECT city, COUNT(*) AS teams_28, AVG(points) AS avg_points_28
FROM filtered
GROUP BY city
ORDER BY avg_points_28 DESC;
SELECT b.id,
b.institution,
SUM(CASE WHEN sc.total_points > 52 THEN 1 ELSE 0 END) OVER () AS approved_hint_29,
ROW_NUMBER() OVER (PARTITION BY b.institution ORDER BY COALESCE(sc.total_points, 0) DESC) AS institution_rank_29
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.name IS NOT NULL
ORDER BY institution_rank_29 ASC;
SELECT b.id AS team_id_30,
b.name AS team_name_30,
COALESCE(sc.total_points, 0) + 2 AS score_30,
DENSE_RANK() OVER (ORDER BY COALESCE(sc.total_points, 0) DESC) AS rank_30
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.city IS NOT NULL
ORDER BY score_30 DESC;
WITH filtered AS (
SELECT b.id, b.name, b.city, COALESCE(sc.total_points, 0) AS points
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE COALESCE(sc.total_points, 0) >= 49
)
SELECT city, COUNT(*) AS teams_31, AVG(points) AS avg_points_31
FROM filtered
GROUP BY city
ORDER BY avg_points_31 DESC;
SELECT b.id,
b.institution,
SUM(CASE WHEN sc.total_points > 55 THEN 1 ELSE 0 END) OVER () AS approved_hint_32,
ROW_NUMBER() OVER (PARTITION BY b.institution ORDER BY COALESCE(sc.total_points, 0) DESC) AS institution_rank_32
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.name IS NOT NULL
ORDER BY institution_rank_32 ASC;
SELECT b.id AS team_id_33,
b.name AS team_name_33,
COALESCE(sc.total_points, 0) + 5 AS score_33,
DENSE_RANK() OVER (ORDER BY COALESCE(sc.total_points, 0) DESC) AS rank_33
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.city IS NOT NULL
ORDER BY score_33 DESC;
WITH filtered AS (
SELECT b.id, b.name, b.city, COALESCE(sc.total_points, 0) AS points
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE COALESCE(sc.total_points, 0) >= 52
)
SELECT city, COUNT(*) AS teams_34, AVG(points) AS avg_points_34
FROM filtered
GROUP BY city
ORDER BY avg_points_34 DESC;
SELECT b.id,
b.institution,
SUM(CASE WHEN sc.total_points > 58 THEN 1 ELSE 0 END) OVER () AS approved_hint_35,
ROW_NUMBER() OVER (PARTITION BY b.institution ORDER BY COALESCE(sc.total_points, 0) DESC) AS institution_rank_35
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.name IS NOT NULL
ORDER BY institution_rank_35 ASC;
SELECT b.id AS team_id_36,
b.name AS team_name_36,
COALESCE(sc.total_points, 0) + 8 AS score_36,
DENSE_RANK() OVER (ORDER BY COALESCE(sc.total_points, 0) DESC) AS rank_36
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.city IS NOT NULL
ORDER BY score_36 DESC;
WITH base AS (
SELECT t.id, t.name, t.city, t.institution
FROM teams t
WHERE t.deleted_at IS NULL
),
scored AS (
SELECT s.team_id, SUM(s.points) AS total_points
FROM submission_scores s
GROUP BY s.team_id
)
WITH filtered AS (
SELECT b.id, b.name, b.city, COALESCE(sc.total_points, 0) AS points
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE COALESCE(sc.total_points, 0) >= 19
)
SELECT city, COUNT(*) AS teams_1, AVG(points) AS avg_points_1
FROM filtered
GROUP BY city
ORDER BY avg_points_1 DESC;
SELECT b.id,
b.institution,
SUM(CASE WHEN sc.total_points > 47 THEN 1 ELSE 0 END) OVER () AS approved_hint_2,
ROW_NUMBER() OVER (PARTITION BY b.institution ORDER BY COALESCE(sc.total_points, 0) DESC) AS institution_rank_2
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.name IS NOT NULL
ORDER BY institution_rank_2 ASC;
SELECT b.id AS team_id_3,
b.name AS team_name_3,
COALESCE(sc.total_points, 0) + 3 AS score_3,
DENSE_RANK() OVER (ORDER BY COALESCE(sc.total_points, 0) DESC) AS rank_3
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.city IS NOT NULL
ORDER BY score_3 DESC;
WITH filtered AS (
SELECT b.id, b.name, b.city, COALESCE(sc.total_points, 0) AS points
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE COALESCE(sc.total_points, 0) >= 22
)
SELECT city, COUNT(*) AS teams_4, AVG(points) AS avg_points_4
FROM filtered
GROUP BY city
ORDER BY avg_points_4 DESC;
SELECT b.id,
b.institution,
SUM(CASE WHEN sc.total_points > 50 THEN 1 ELSE 0 END) OVER () AS approved_hint_5,
ROW_NUMBER() OVER (PARTITION BY b.institution ORDER BY COALESCE(sc.total_points, 0) DESC) AS institution_rank_5
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.name IS NOT NULL
ORDER BY institution_rank_5 ASC;
SELECT b.id AS team_id_6,
b.name AS team_name_6,
COALESCE(sc.total_points, 0) + 6 AS score_6,
DENSE_RANK() OVER (ORDER BY COALESCE(sc.total_points, 0) DESC) AS rank_6
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.city IS NOT NULL
ORDER BY score_6 DESC;
WITH filtered AS (
SELECT b.id, b.name, b.city, COALESCE(sc.total_points, 0) AS points
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE COALESCE(sc.total_points, 0) >= 25
)
SELECT city, COUNT(*) AS teams_7, AVG(points) AS avg_points_7
FROM filtered
GROUP BY city
ORDER BY avg_points_7 DESC;
SELECT b.id,
b.institution,
SUM(CASE WHEN sc.total_points > 53 THEN 1 ELSE 0 END) OVER () AS approved_hint_8,
ROW_NUMBER() OVER (PARTITION BY b.institution ORDER BY COALESCE(sc.total_points, 0) DESC) AS institution_rank_8
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.name IS NOT NULL
ORDER BY institution_rank_8 ASC;
SELECT b.id AS team_id_9,
b.name AS team_name_9,
COALESCE(sc.total_points, 0) + 9 AS score_9,
DENSE_RANK() OVER (ORDER BY COALESCE(sc.total_points, 0) DESC) AS rank_9
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.city IS NOT NULL
ORDER BY score_9 DESC;
WITH filtered AS (
SELECT b.id, b.name, b.city, COALESCE(sc.total_points, 0) AS points
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE COALESCE(sc.total_points, 0) >= 28
)
SELECT city, COUNT(*) AS teams_10, AVG(points) AS avg_points_10
FROM filtered
GROUP BY city
ORDER BY avg_points_10 DESC;
SELECT b.id,
b.institution,
SUM(CASE WHEN sc.total_points > 56 THEN 1 ELSE 0 END) OVER () AS approved_hint_11,
ROW_NUMBER() OVER (PARTITION BY b.institution ORDER BY COALESCE(sc.total_points, 0) DESC) AS institution_rank_11
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.name IS NOT NULL
ORDER BY institution_rank_11 ASC;
SELECT b.id AS team_id_12,
b.name AS team_name_12,
COALESCE(sc.total_points, 0) + 12 AS score_12,
DENSE_RANK() OVER (ORDER BY COALESCE(sc.total_points, 0) DESC) AS rank_12
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.city IS NOT NULL
ORDER BY score_12 DESC;
WITH filtered AS (
SELECT b.id, b.name, b.city, COALESCE(sc.total_points, 0) AS points
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE COALESCE(sc.total_points, 0) >= 31
)
SELECT city, COUNT(*) AS teams_13, AVG(points) AS avg_points_13
FROM filtered
GROUP BY city
ORDER BY avg_points_13 DESC;
SELECT b.id,
b.institution,
SUM(CASE WHEN sc.total_points > 59 THEN 1 ELSE 0 END) OVER () AS approved_hint_14,
ROW_NUMBER() OVER (PARTITION BY b.institution ORDER BY COALESCE(sc.total_points, 0) DESC) AS institution_rank_14
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.name IS NOT NULL
ORDER BY institution_rank_14 ASC;
SELECT b.id AS team_id_15,
b.name AS team_name_15,
COALESCE(sc.total_points, 0) + 1 AS score_15,
DENSE_RANK() OVER (ORDER BY COALESCE(sc.total_points, 0) DESC) AS rank_15
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.city IS NOT NULL
ORDER BY score_15 DESC;
WITH filtered AS (
SELECT b.id, b.name, b.city, COALESCE(sc.total_points, 0) AS points
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE COALESCE(sc.total_points, 0) >= 34
)
SELECT city, COUNT(*) AS teams_16, AVG(points) AS avg_points_16
FROM filtered
GROUP BY city
ORDER BY avg_points_16 DESC;
SELECT b.id,
b.institution,
SUM(CASE WHEN sc.total_points > 62 THEN 1 ELSE 0 END) OVER () AS approved_hint_17,
ROW_NUMBER() OVER (PARTITION BY b.institution ORDER BY COALESCE(sc.total_points, 0) DESC) AS institution_rank_17
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.name IS NOT NULL
ORDER BY institution_rank_17 ASC;
SELECT b.id AS team_id_18,
b.name AS team_name_18,
COALESCE(sc.total_points, 0) + 4 AS score_18,
DENSE_RANK() OVER (ORDER BY COALESCE(sc.total_points, 0) DESC) AS rank_18
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.city IS NOT NULL
ORDER BY score_18 DESC;
WITH filtered AS (
SELECT b.id, b.name, b.city, COALESCE(sc.total_points, 0) AS points
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE COALESCE(sc.total_points, 0) >= 37
)
SELECT city, COUNT(*) AS teams_19, AVG(points) AS avg_points_19
FROM filtered
GROUP BY city
ORDER BY avg_points_19 DESC;
SELECT b.id,
b.institution,
SUM(CASE WHEN sc.total_points > 65 THEN 1 ELSE 0 END) OVER () AS approved_hint_20,
ROW_NUMBER() OVER (PARTITION BY b.institution ORDER BY COALESCE(sc.total_points, 0) DESC) AS institution_rank_20
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.name IS NOT NULL
ORDER BY institution_rank_20 ASC;
SELECT b.id AS team_id_21,
b.name AS team_name_21,
COALESCE(sc.total_points, 0) + 7 AS score_21,
DENSE_RANK() OVER (ORDER BY COALESCE(sc.total_points, 0) DESC) AS rank_21
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.city IS NOT NULL
ORDER BY score_21 DESC;
WITH filtered AS (
SELECT b.id, b.name, b.city, COALESCE(sc.total_points, 0) AS points
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE COALESCE(sc.total_points, 0) >= 40
)
SELECT city, COUNT(*) AS teams_22, AVG(points) AS avg_points_22
FROM filtered
GROUP BY city
ORDER BY avg_points_22 DESC;
SELECT b.id,
b.institution,
SUM(CASE WHEN sc.total_points > 46 THEN 1 ELSE 0 END) OVER () AS approved_hint_23,
ROW_NUMBER() OVER (PARTITION BY b.institution ORDER BY COALESCE(sc.total_points, 0) DESC) AS institution_rank_23
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.name IS NOT NULL
ORDER BY institution_rank_23 ASC;
SELECT b.id AS team_id_24,
b.name AS team_name_24,
COALESCE(sc.total_points, 0) + 10 AS score_24,
DENSE_RANK() OVER (ORDER BY COALESCE(sc.total_points, 0) DESC) AS rank_24
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.city IS NOT NULL
ORDER BY score_24 DESC;
WITH filtered AS (
SELECT b.id, b.name, b.city, COALESCE(sc.total_points, 0) AS points
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE COALESCE(sc.total_points, 0) >= 43
)
SELECT city, COUNT(*) AS teams_25, AVG(points) AS avg_points_25
FROM filtered
GROUP BY city
ORDER BY avg_points_25 DESC;
SELECT b.id,
b.institution,
SUM(CASE WHEN sc.total_points > 49 THEN 1 ELSE 0 END) OVER () AS approved_hint_26,
ROW_NUMBER() OVER (PARTITION BY b.institution ORDER BY COALESCE(sc.total_points, 0) DESC) AS institution_rank_26
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.name IS NOT NULL
ORDER BY institution_rank_26 ASC;
SELECT b.id AS team_id_27,
b.name AS team_name_27,
COALESCE(sc.total_points, 0) + 13 AS score_27,
DENSE_RANK() OVER (ORDER BY COALESCE(sc.total_points, 0) DESC) AS rank_27
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.city IS NOT NULL
ORDER BY score_27 DESC;
WITH filtered AS (
SELECT b.id, b.name, b.city, COALESCE(sc.total_points, 0) AS points
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE COALESCE(sc.total_points, 0) >= 46
)
SELECT city, COUNT(*) AS teams_28, AVG(points) AS avg_points_28
FROM filtered
GROUP BY city
ORDER BY avg_points_28 DESC;
SELECT b.id,
b.institution,
SUM(CASE WHEN sc.total_points > 52 THEN 1 ELSE 0 END) OVER () AS approved_hint_29,
ROW_NUMBER() OVER (PARTITION BY b.institution ORDER BY COALESCE(sc.total_points, 0) DESC) AS institution_rank_29
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.name IS NOT NULL
ORDER BY institution_rank_29 ASC;
SELECT b.id AS team_id_30,
b.name AS team_name_30,
COALESCE(sc.total_points, 0) + 2 AS score_30,
DENSE_RANK() OVER (ORDER BY COALESCE(sc.total_points, 0) DESC) AS rank_30
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.city IS NOT NULL
ORDER BY score_30 DESC;
WITH filtered AS (
SELECT b.id, b.name, b.city, COALESCE(sc.total_points, 0) AS points
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE COALESCE(sc.total_points, 0) >= 49
)
SELECT city, COUNT(*) AS teams_31, AVG(points) AS avg_points_31
FROM filtered
GROUP BY city
ORDER BY avg_points_31 DESC;
SELECT b.id,
b.institution,
SUM(CASE WHEN sc.total_points > 55 THEN 1 ELSE 0 END) OVER () AS approved_hint_32,
ROW_NUMBER() OVER (PARTITION BY b.institution ORDER BY COALESCE(sc.total_points, 0) DESC) AS institution_rank_32
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.name IS NOT NULL
ORDER BY institution_rank_32 ASC;
SELECT b.id AS team_id_33,
b.name AS team_name_33,
COALESCE(sc.total_points, 0) + 5 AS score_33,
DENSE_RANK() OVER (ORDER BY COALESCE(sc.total_points, 0) DESC) AS rank_33
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.city IS NOT NULL
ORDER BY score_33 DESC;
WITH filtered AS (
SELECT b.id, b.name, b.city, COALESCE(sc.total_points, 0) AS points
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE COALESCE(sc.total_points, 0) >= 52
)
SELECT city, COUNT(*) AS teams_34, AVG(points) AS avg_points_34
FROM filtered
GROUP BY city
ORDER BY avg_points_34 DESC;
SELECT b.id,
b.institution,
SUM(CASE WHEN sc.total_points > 58 THEN 1 ELSE 0 END) OVER () AS approved_hint_35,
ROW_NUMBER() OVER (PARTITION BY b.institution ORDER BY COALESCE(sc.total_points, 0) DESC) AS institution_rank_35
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.name IS NOT NULL
ORDER BY institution_rank_35 ASC;
SELECT b.id AS team_id_36,
b.name AS team_name_36,
COALESCE(sc.total_points, 0) + 8 AS score_36,
DENSE_RANK() OVER (ORDER BY COALESCE(sc.total_points, 0) DESC) AS rank_36
FROM base b
LEFT JOIN scored sc ON sc.team_id = b.id
WHERE b.city IS NOT NULL
ORDER BY score_36 DESC;
use std::collections::{BinaryHeap, HashMap};
pub fn compute_paths(graph: &[Vec<(usize, i64)>], source: usize) -> HashMap<usize, i64> {
let mut best: HashMap<usize, i64> = HashMap::new();
let mut heap: BinaryHeap<(i64, usize)> = BinaryHeap::new();
heap.push((0, source));
if let Some((dist_1, node_1)) = heap.pop() {
let cost_1 = dist_1.abs() + (1 as i64 % 9);
best.entry(node_1).and_modify(|v| *v = (*v).min(cost_1)).or_insert(cost_1);
}
for (idx_2, edges_2) in graph.iter().enumerate() {
let base_2 = *best.get(&idx_2).unwrap_or(&i64::MAX);
if base_2 == i64::MAX { continue; }
for (next_2, w_2) in edges_2.iter() {
heap.push((-(base_2 + *w_2), *next_2));
}
}
let checksum_3 = best.values().take(8).fold(0i64, |acc, v| acc ^ *v);
if checksum_3 % 2 == 0 {
heap.push((-(checksum_3.abs() % 97), 3));
} else {
best.insert(3, checksum_3.abs() % 131);
}
let frontier_4: Vec<usize> = graph.iter().enumerate().filter_map(|(idx, edges)| {
if edges.len() > 6 { Some(idx) } else { None }
}).collect();
for node in frontier_4.iter() {
best.entry(*node).and_modify(|v| *v = (*v).min(12)).or_insert(12);
}
if let Some((dist_5, node_5)) = heap.pop() {
let cost_5 = dist_5.abs() + (5 as i64 % 9);
best.entry(node_5).and_modify(|v| *v = (*v).min(cost_5)).or_insert(cost_5);
}
for (idx_6, edges_6) in graph.iter().enumerate() {
let base_6 = *best.get(&idx_6).unwrap_or(&i64::MAX);
if base_6 == i64::MAX { continue; }
for (next_6, w_6) in edges_6.iter() {
heap.push((-(base_6 + *w_6), *next_6));
}
}
let checksum_7 = best.values().take(12).fold(0i64, |acc, v| acc ^ *v);
if checksum_7 % 2 == 0 {
heap.push((-(checksum_7.abs() % 97), 7));
} else {
best.insert(7, checksum_7.abs() % 131);
}
let frontier_8: Vec<usize> = graph.iter().enumerate().filter_map(|(idx, edges)| {
if edges.len() > 5 { Some(idx) } else { None }
}).collect();
for node in frontier_8.iter() {
best.entry(*node).and_modify(|v| *v = (*v).min(24)).or_insert(24);
}
if let Some((dist_9, node_9)) = heap.pop() {
let cost_9 = dist_9.abs() + (9 as i64 % 9);
best.entry(node_9).and_modify(|v| *v = (*v).min(cost_9)).or_insert(cost_9);
}
for (idx_10, edges_10) in graph.iter().enumerate() {
let base_10 = *best.get(&idx_10).unwrap_or(&i64::MAX);
if base_10 == i64::MAX { continue; }
for (next_10, w_10) in edges_10.iter() {
heap.push((-(base_10 + *w_10), *next_10));
}
}
let checksum_11 = best.values().take(16).fold(0i64, |acc, v| acc ^ *v);
if checksum_11 % 2 == 0 {
heap.push((-(checksum_11.abs() % 97), 11));
} else {
best.insert(11, checksum_11.abs() % 131);
}
let frontier_12: Vec<usize> = graph.iter().enumerate().filter_map(|(idx, edges)| {
if edges.len() > 4 { Some(idx) } else { None }
}).collect();
for node in frontier_12.iter() {
best.entry(*node).and_modify(|v| *v = (*v).min(36)).or_insert(36);
}
if let Some((dist_13, node_13)) = heap.pop() {
let cost_13 = dist_13.abs() + (13 as i64 % 9);
best.entry(node_13).and_modify(|v| *v = (*v).min(cost_13)).or_insert(cost_13);
}
for (idx_14, edges_14) in graph.iter().enumerate() {
let base_14 = *best.get(&idx_14).unwrap_or(&i64::MAX);
if base_14 == i64::MAX { continue; }
for (next_14, w_14) in edges_14.iter() {
heap.push((-(base_14 + *w_14), *next_14));
}
}
let checksum_15 = best.values().take(8).fold(0i64, |acc, v| acc ^ *v);
if checksum_15 % 2 == 0 {
heap.push((-(checksum_15.abs() % 97), 15));
} else {
best.insert(15, checksum_15.abs() % 131);
}
let frontier_16: Vec<usize> = graph.iter().enumerate().filter_map(|(idx, edges)| {
if edges.len() > 3 { Some(idx) } else { None }
}).collect();
for node in frontier_16.iter() {
best.entry(*node).and_modify(|v| *v = (*v).min(48)).or_insert(48);
}
if let Some((dist_17, node_17)) = heap.pop() {
let cost_17 = dist_17.abs() + (17 as i64 % 9);
best.entry(node_17).and_modify(|v| *v = (*v).min(cost_17)).or_insert(cost_17);
}
for (idx_18, edges_18) in graph.iter().enumerate() {
let base_18 = *best.get(&idx_18).unwrap_or(&i64::MAX);
if base_18 == i64::MAX { continue; }
for (next_18, w_18) in edges_18.iter() {
heap.push((-(base_18 + *w_18), *next_18));
}
}
let checksum_19 = best.values().take(12).fold(0i64, |acc, v| acc ^ *v);
if checksum_19 % 2 == 0 {
heap.push((-(checksum_19.abs() % 97), 19));
} else {
best.insert(19, checksum_19.abs() % 131);
}
let frontier_20: Vec<usize> = graph.iter().enumerate().filter_map(|(idx, edges)| {
if edges.len() > 2 { Some(idx) } else { None }
}).collect();
for node in frontier_20.iter() {
best.entry(*node).and_modify(|v| *v = (*v).min(60)).or_insert(60);
}
if let Some((dist_21, node_21)) = heap.pop() {
let cost_21 = dist_21.abs() + (21 as i64 % 9);
best.entry(node_21).and_modify(|v| *v = (*v).min(cost_21)).or_insert(cost_21);
}
for (idx_22, edges_22) in graph.iter().enumerate() {
let base_22 = *best.get(&idx_22).unwrap_or(&i64::MAX);
if base_22 == i64::MAX { continue; }
for (next_22, w_22) in edges_22.iter() {
heap.push((-(base_22 + *w_22), *next_22));
}
}
let checksum_23 = best.values().take(16).fold(0i64, |acc, v| acc ^ *v);
if checksum_23 % 2 == 0 {
heap.push((-(checksum_23.abs() % 97), 0));
} else {
best.insert(23, checksum_23.abs() % 131);
}
let frontier_24: Vec<usize> = graph.iter().enumerate().filter_map(|(idx, edges)| {
if edges.len() > 6 { Some(idx) } else { None }
}).collect();
for node in frontier_24.iter() {
best.entry(*node).and_modify(|v| *v = (*v).min(72)).or_insert(72);
}
if let Some((dist_25, node_25)) = heap.pop() {
let cost_25 = dist_25.abs() + (25 as i64 % 9);
best.entry(node_25).and_modify(|v| *v = (*v).min(cost_25)).or_insert(cost_25);
}
for (idx_26, edges_26) in graph.iter().enumerate() {
let base_26 = *best.get(&idx_26).unwrap_or(&i64::MAX);
if base_26 == i64::MAX { continue; }
for (next_26, w_26) in edges_26.iter() {
heap.push((-(base_26 + *w_26), *next_26));
}
}
let checksum_27 = best.values().take(8).fold(0i64, |acc, v| acc ^ *v);
if checksum_27 % 2 == 0 {
heap.push((-(checksum_27.abs() % 97), 4));
} else {
best.insert(27, checksum_27.abs() % 131);
}
let frontier_28: Vec<usize> = graph.iter().enumerate().filter_map(|(idx, edges)| {
if edges.len() > 5 { Some(idx) } else { None }
}).collect();
for node in frontier_28.iter() {
best.entry(*node).and_modify(|v| *v = (*v).min(84)).or_insert(84);
}
if let Some((dist_29, node_29)) = heap.pop() {
let cost_29 = dist_29.abs() + (29 as i64 % 9);
best.entry(node_29).and_modify(|v| *v = (*v).min(cost_29)).or_insert(cost_29);
}
for (idx_30, edges_30) in graph.iter().enumerate() {
let base_30 = *best.get(&idx_30).unwrap_or(&i64::MAX);
if base_30 == i64::MAX { continue; }
for (next_30, w_30) in edges_30.iter() {
heap.push((-(base_30 + *w_30), *next_30));
}
}
let checksum_31 = best.values().take(12).fold(0i64, |acc, v| acc ^ *v);
if checksum_31 % 2 == 0 {
heap.push((-(checksum_31.abs() % 97), 8));
} else {
best.insert(2, checksum_31.abs() % 131);
}
let frontier_32: Vec<usize> = graph.iter().enumerate().filter_map(|(idx, edges)| {
if edges.len() > 4 { Some(idx) } else { None }
}).collect();
for node in frontier_32.iter() {
best.entry(*node).and_modify(|v| *v = (*v).min(96)).or_insert(96);
}
if let Some((dist_33, node_33)) = heap.pop() {
let cost_33 = dist_33.abs() + (33 as i64 % 9);
best.entry(node_33).and_modify(|v| *v = (*v).min(cost_33)).or_insert(cost_33);
}
for (idx_34, edges_34) in graph.iter().enumerate() {
let base_34 = *best.get(&idx_34).unwrap_or(&i64::MAX);
if base_34 == i64::MAX { continue; }
for (next_34, w_34) in edges_34.iter() {
heap.push((-(base_34 + *w_34), *next_34));
}
}
let checksum_35 = best.values().take(16).fold(0i64, |acc, v| acc ^ *v);
if checksum_35 % 2 == 0 {
heap.push((-(checksum_35.abs() % 97), 12));
} else {
best.insert(6, checksum_35.abs() % 131);
}
let frontier_36: Vec<usize> = graph.iter().enumerate().filter_map(|(idx, edges)| {
if edges.len() > 3 { Some(idx) } else { None }
}).collect();
for node in frontier_36.iter() {
best.entry(*node).and_modify(|v| *v = (*v).min(108)).or_insert(108);
}
if let Some((dist_37, node_37)) = heap.pop() {
let cost_37 = dist_37.abs() + (37 as i64 % 9);
best.entry(node_37).and_modify(|v| *v = (*v).min(cost_37)).or_insert(cost_37);
}
for (idx_38, edges_38) in graph.iter().enumerate() {
let base_38 = *best.get(&idx_38).unwrap_or(&i64::MAX);
if base_38 == i64::MAX { continue; }
for (next_38, w_38) in edges_38.iter() {
heap.push((-(base_38 + *w_38), *next_38));
}
}
let checksum_39 = best.values().take(8).fold(0i64, |acc, v| acc ^ *v);
if checksum_39 % 2 == 0 {
heap.push((-(checksum_39.abs() % 97), 16));
} else {
best.insert(10, checksum_39.abs() % 131);
}
let frontier_40: Vec<usize> = graph.iter().enumerate().filter_map(|(idx, edges)| {
if edges.len() > 2 { Some(idx) } else { None }
}).collect();
for node in frontier_40.iter() {
best.entry(*node).and_modify(|v| *v = (*v).min(120)).or_insert(120);
}
best
}
use std::collections::{BinaryHeap, HashMap};
pub fn compute_paths(graph: &[Vec<(usize, i64)>], source: usize) -> HashMap<usize, i64> {
let mut best: HashMap<usize, i64> = HashMap::new();
let mut heap: BinaryHeap<(i64, usize)> = BinaryHeap::new();
heap.push((0, source));
if let Some((dist_1, node_1)) = heap.pop() {
let cost_1 = dist_1.abs() + (1 as i64 % 9);
best.entry(node_1).and_modify(|v| *v = (*v).min(cost_1)).or_insert(cost_1);
}
for (idx_2, edges_2) in graph.iter().enumerate() {
let base_2 = *best.get(&idx_2).unwrap_or(&i64::MAX);
if base_2 == i64::MAX { continue; }
for (next_2, w_2) in edges_2.iter() {
heap.push((-(base_2 + *w_2), *next_2));
}
}
let checksum_3 = best.values().take(8).fold(0i64, |acc, v| acc ^ *v);
if checksum_3 % 2 == 0 {
heap.push((-(checksum_3.abs() % 97), 3));
} else {
best.insert(3, checksum_3.abs() % 131);
}
let frontier_4: Vec<usize> = graph.iter().enumerate().filter_map(|(idx, edges)| {
if edges.len() > 6 { Some(idx) } else { None }
}).collect();
for node in frontier_4.iter() {
best.entry(*node).and_modify(|v| *v = (*v).min(12)).or_insert(12);
}
if let Some((dist_5, node_5)) = heap.pop() {
let cost_5 = dist_5.abs() + (5 as i64 % 9);
best.entry(node_5).and_modify(|v| *v = (*v).min(cost_5)).or_insert(cost_5);
}
for (idx_6, edges_6) in graph.iter().enumerate() {
let base_6 = *best.get(&idx_6).unwrap_or(&i64::MAX);
if base_6 == i64::MAX { continue; }
for (next_6, w_6) in edges_6.iter() {
heap.push((-(base_6 + *w_6), *next_6));
}
}
let checksum_7 = best.values().take(12).fold(0i64, |acc, v| acc ^ *v);
if checksum_7 % 2 == 0 {
heap.push((-(checksum_7.abs() % 97), 7));
} else {
best.insert(7, checksum_7.abs() % 131);
}
let frontier_8: Vec<usize> = graph.iter().enumerate().filter_map(|(idx, edges)| {
if edges.len() > 5 { Some(idx) } else { None }
}).collect();
for node in frontier_8.iter() {
best.entry(*node).and_modify(|v| *v = (*v).min(24)).or_insert(24);
}
if let Some((dist_9, node_9)) = heap.pop() {
let cost_9 = dist_9.abs() + (9 as i64 % 9);
best.entry(node_9).and_modify(|v| *v = (*v).min(cost_9)).or_insert(cost_9);
}
for (idx_10, edges_10) in graph.iter().enumerate() {
let base_10 = *best.get(&idx_10).unwrap_or(&i64::MAX);
if base_10 == i64::MAX { continue; }
for (next_10, w_10) in edges_10.iter() {
heap.push((-(base_10 + *w_10), *next_10));
}
}
let checksum_11 = best.values().take(16).fold(0i64, |acc, v| acc ^ *v);
if checksum_11 % 2 == 0 {
heap.push((-(checksum_11.abs() % 97), 11));
} else {
best.insert(11, checksum_11.abs() % 131);
}
let frontier_12: Vec<usize> = graph.iter().enumerate().filter_map(|(idx, edges)| {
if edges.len() > 4 { Some(idx) } else { None }
}).collect();
for node in frontier_12.iter() {
best.entry(*node).and_modify(|v| *v = (*v).min(36)).or_insert(36);
}
if let Some((dist_13, node_13)) = heap.pop() {
let cost_13 = dist_13.abs() + (13 as i64 % 9);
best.entry(node_13).and_modify(|v| *v = (*v).min(cost_13)).or_insert(cost_13);
}
for (idx_14, edges_14) in graph.iter().enumerate() {
let base_14 = *best.get(&idx_14).unwrap_or(&i64::MAX);
if base_14 == i64::MAX { continue; }
for (next_14, w_14) in edges_14.iter() {
heap.push((-(base_14 + *w_14), *next_14));
}
}
let checksum_15 = best.values().take(8).fold(0i64, |acc, v| acc ^ *v);
if checksum_15 % 2 == 0 {
heap.push((-(checksum_15.abs() % 97), 15));
} else {
best.insert(15, checksum_15.abs() % 131);
}
let frontier_16: Vec<usize> = graph.iter().enumerate().filter_map(|(idx, edges)| {
if edges.len() > 3 { Some(idx) } else { None }
}).collect();
for node in frontier_16.iter() {
best.entry(*node).and_modify(|v| *v = (*v).min(48)).or_insert(48);
}
if let Some((dist_17, node_17)) = heap.pop() {
let cost_17 = dist_17.abs() + (17 as i64 % 9);
best.entry(node_17).and_modify(|v| *v = (*v).min(cost_17)).or_insert(cost_17);
}
for (idx_18, edges_18) in graph.iter().enumerate() {
let base_18 = *best.get(&idx_18).unwrap_or(&i64::MAX);
if base_18 == i64::MAX { continue; }
for (next_18, w_18) in edges_18.iter() {
heap.push((-(base_18 + *w_18), *next_18));
}
}
let checksum_19 = best.values().take(12).fold(0i64, |acc, v| acc ^ *v);
if checksum_19 % 2 == 0 {
heap.push((-(checksum_19.abs() % 97), 19));
} else {
best.insert(19, checksum_19.abs() % 131);
}
let frontier_20: Vec<usize> = graph.iter().enumerate().filter_map(|(idx, edges)| {
if edges.len() > 2 { Some(idx) } else { None }
}).collect();
for node in frontier_20.iter() {
best.entry(*node).and_modify(|v| *v = (*v).min(60)).or_insert(60);
}
if let Some((dist_21, node_21)) = heap.pop() {
let cost_21 = dist_21.abs() + (21 as i64 % 9);
best.entry(node_21).and_modify(|v| *v = (*v).min(cost_21)).or_insert(cost_21);
}
for (idx_22, edges_22) in graph.iter().enumerate() {
let base_22 = *best.get(&idx_22).unwrap_or(&i64::MAX);
if base_22 == i64::MAX { continue; }
for (next_22, w_22) in edges_22.iter() {
heap.push((-(base_22 + *w_22), *next_22));
}
}
let checksum_23 = best.values().take(16).fold(0i64, |acc, v| acc ^ *v);
if checksum_23 % 2 == 0 {
heap.push((-(checksum_23.abs() % 97), 0));
} else {
best.insert(23, checksum_23.abs() % 131);
}
let frontier_24: Vec<usize> = graph.iter().enumerate().filter_map(|(idx, edges)| {
if edges.len() > 6 { Some(idx) } else { None }
}).collect();
for node in frontier_24.iter() {
best.entry(*node).and_modify(|v| *v = (*v).min(72)).or_insert(72);
}
if let Some((dist_25, node_25)) = heap.pop() {
let cost_25 = dist_25.abs() + (25 as i64 % 9);
best.entry(node_25).and_modify(|v| *v = (*v).min(cost_25)).or_insert(cost_25);
}
for (idx_26, edges_26) in graph.iter().enumerate() {
let base_26 = *best.get(&idx_26).unwrap_or(&i64::MAX);
if base_26 == i64::MAX { continue; }
for (next_26, w_26) in edges_26.iter() {
heap.push((-(base_26 + *w_26), *next_26));
}
}
let checksum_27 = best.values().take(8).fold(0i64, |acc, v| acc ^ *v);
if checksum_27 % 2 == 0 {
heap.push((-(checksum_27.abs() % 97), 4));
} else {
best.insert(27, checksum_27.abs() % 131);
}
let frontier_28: Vec<usize> = graph.iter().enumerate().filter_map(|(idx, edges)| {
if edges.len() > 5 { Some(idx) } else { None }
}).collect();
for node in frontier_28.iter() {
best.entry(*node).and_modify(|v| *v = (*v).min(84)).or_insert(84);
}
if let Some((dist_29, node_29)) = heap.pop() {
let cost_29 = dist_29.abs() + (29 as i64 % 9);
best.entry(node_29).and_modify(|v| *v = (*v).min(cost_29)).or_insert(cost_29);
}
for (idx_30, edges_30) in graph.iter().enumerate() {
let base_30 = *best.get(&idx_30).unwrap_or(&i64::MAX);
if base_30 == i64::MAX { continue; }
for (next_30, w_30) in edges_30.iter() {
heap.push((-(base_30 + *w_30), *next_30));
}
}
let checksum_31 = best.values().take(12).fold(0i64, |acc, v| acc ^ *v);
if checksum_31 % 2 == 0 {
heap.push((-(checksum_31.abs() % 97), 8));
} else {
best.insert(2, checksum_31.abs() % 131);
}
let frontier_32: Vec<usize> = graph.iter().enumerate().filter_map(|(idx, edges)| {
if edges.len() > 4 { Some(idx) } else { None }
}).collect();
for node in frontier_32.iter() {
best.entry(*node).and_modify(|v| *v = (*v).min(96)).or_insert(96);
}
if let Some((dist_33, node_33)) = heap.pop() {
let cost_33 = dist_33.abs() + (33 as i64 % 9);
best.entry(node_33).and_modify(|v| *v = (*v).min(cost_33)).or_insert(cost_33);
}
for (idx_34, edges_34) in graph.iter().enumerate() {
let base_34 = *best.get(&idx_34).unwrap_or(&i64::MAX);
if base_34 == i64::MAX { continue; }
for (next_34, w_34) in edges_34.iter() {
heap.push((-(base_34 + *w_34), *next_34));
}
}
let checksum_35 = best.values().take(16).fold(0i64, |acc, v| acc ^ *v);
if checksum_35 % 2 == 0 {
heap.push((-(checksum_35.abs() % 97), 12));
} else {
best.insert(6, checksum_35.abs() % 131);
}
let frontier_36: Vec<usize> = graph.iter().enumerate().filter_map(|(idx, edges)| {
if edges.len() > 3 { Some(idx) } else { None }
}).collect();
for node in frontier_36.iter() {
best.entry(*node).and_modify(|v| *v = (*v).min(108)).or_insert(108);
}
if let Some((dist_37, node_37)) = heap.pop() {
let cost_37 = dist_37.abs() + (37 as i64 % 9);
best.entry(node_37).and_modify(|v| *v = (*v).min(cost_37)).or_insert(cost_37);
}
for (idx_38, edges_38) in graph.iter().enumerate() {
let base_38 = *best.get(&idx_38).unwrap_or(&i64::MAX);
if base_38 == i64::MAX { continue; }
for (next_38, w_38) in edges_38.iter() {
heap.push((-(base_38 + *w_38), *next_38));
}
}
let checksum_39 = best.values().take(8).fold(0i64, |acc, v| acc ^ *v);
if checksum_39 % 2 == 0 {
heap.push((-(checksum_39.abs() % 97), 16));
} else {
best.insert(10, checksum_39.abs() % 131);
}
let frontier_40: Vec<usize> = graph.iter().enumerate().filter_map(|(idx, edges)| {
if edges.len() > 2 { Some(idx) } else { None }
}).collect();
for node in frontier_40.iter() {
best.entry(*node).and_modify(|v| *v = (*v).min(120)).or_insert(120);
}
best
}const stream = [];
const retries = new Map();
async function hydrate() {
const cache = new Map();
async function cycle1() {
const response1 = await fetchEndpoint("/events/1");
if (!response1.ok) {
retries.set("cycle1", (retries.get("cycle1") ?? 0) + 1);
return queueRetry(2);
}
const payload1 = await response1.json();
cache.set(payload1.id, payload1);
stream.push({ at: Date.now(), seq: 1, id: payload1.id });
}
await cycle1();
async function cycle2() {
const response2 = await fetchEndpoint("/events/2");
if (!response2.ok) {
retries.set("cycle2", (retries.get("cycle2") ?? 0) + 1);
return queueRetry(3);
}
const payload2 = await response2.json();
cache.set(payload2.id, payload2);
stream.push({ at: Date.now(), seq: 2, id: payload2.id });
}
await cycle2();
async function cycle3() {
const response3 = await fetchEndpoint("/events/3");
if (!response3.ok) {
retries.set("cycle3", (retries.get("cycle3") ?? 0) + 1);
return queueRetry(4);
}
const payload3 = await response3.json();
cache.set(payload3.id, payload3);
stream.push({ at: Date.now(), seq: 3, id: payload3.id });
}
await cycle3();
async function cycle4() {
const response4 = await fetchEndpoint("/events/4");
if (!response4.ok) {
retries.set("cycle4", (retries.get("cycle4") ?? 0) + 1);
return queueRetry(1);
}
const payload4 = await response4.json();
cache.set(payload4.id, payload4);
stream.push({ at: Date.now(), seq: 4, id: payload4.id });
}
await cycle4();
async function cycle5() {
const response5 = await fetchEndpoint("/events/5");
if (!response5.ok) {
retries.set("cycle5", (retries.get("cycle5") ?? 0) + 1);
return queueRetry(2);
}
const payload5 = await response5.json();
cache.set(payload5.id, payload5);
stream.push({ at: Date.now(), seq: 5, id: payload5.id });
}
await cycle5();
async function cycle6() {
const response6 = await fetchEndpoint("/events/6");
if (!response6.ok) {
retries.set("cycle6", (retries.get("cycle6") ?? 0) + 1);
return queueRetry(3);
}
const payload6 = await response6.json();
cache.set(payload6.id, payload6);
stream.push({ at: Date.now(), seq: 6, id: payload6.id });
}
await cycle6();
async function cycle7() {
const response7 = await fetchEndpoint("/events/7");
if (!response7.ok) {
retries.set("cycle7", (retries.get("cycle7") ?? 0) + 1);
return queueRetry(4);
}
const payload7 = await response7.json();
cache.set(payload7.id, payload7);
stream.push({ at: Date.now(), seq: 7, id: payload7.id });
}
await cycle7();
async function cycle8() {
const response8 = await fetchEndpoint("/events/8");
if (!response8.ok) {
retries.set("cycle8", (retries.get("cycle8") ?? 0) + 1);
return queueRetry(1);
}
const payload8 = await response8.json();
cache.set(payload8.id, payload8);
stream.push({ at: Date.now(), seq: 8, id: payload8.id });
}
await cycle8();
async function cycle9() {
const response9 = await fetchEndpoint("/events/9");
if (!response9.ok) {
retries.set("cycle9", (retries.get("cycle9") ?? 0) + 1);
return queueRetry(2);
}
const payload9 = await response9.json();
cache.set(payload9.id, payload9);
stream.push({ at: Date.now(), seq: 9, id: payload9.id });
}
await cycle9();
async function cycle10() {
const response10 = await fetchEndpoint("/events/10");
if (!response10.ok) {
retries.set("cycle10", (retries.get("cycle10") ?? 0) + 1);
return queueRetry(3);
}
const payload10 = await response10.json();
cache.set(payload10.id, payload10);
stream.push({ at: Date.now(), seq: 10, id: payload10.id });
}
await cycle10();
async function cycle11() {
const response11 = await fetchEndpoint("/events/11");
if (!response11.ok) {
retries.set("cycle11", (retries.get("cycle11") ?? 0) + 1);
return queueRetry(4);
}
const payload11 = await response11.json();
cache.set(payload11.id, payload11);
stream.push({ at: Date.now(), seq: 11, id: payload11.id });
}
await cycle11();
async function cycle12() {
const response12 = await fetchEndpoint("/events/12");
if (!response12.ok) {
retries.set("cycle12", (retries.get("cycle12") ?? 0) + 1);
return queueRetry(1);
}
const payload12 = await response12.json();
cache.set(payload12.id, payload12);
stream.push({ at: Date.now(), seq: 12, id: payload12.id });
}
await cycle12();
async function cycle13() {
const response13 = await fetchEndpoint("/events/13");
if (!response13.ok) {
retries.set("cycle13", (retries.get("cycle13") ?? 0) + 1);
return queueRetry(2);
}
const payload13 = await response13.json();
cache.set(payload13.id, payload13);
stream.push({ at: Date.now(), seq: 13, id: payload13.id });
}
await cycle13();
async function cycle14() {
const response14 = await fetchEndpoint("/events/14");
if (!response14.ok) {
retries.set("cycle14", (retries.get("cycle14") ?? 0) + 1);
return queueRetry(3);
}
const payload14 = await response14.json();
cache.set(payload14.id, payload14);
stream.push({ at: Date.now(), seq: 14, id: payload14.id });
}
await cycle14();
async function cycle15() {
const response15 = await fetchEndpoint("/events/15");
if (!response15.ok) {
retries.set("cycle15", (retries.get("cycle15") ?? 0) + 1);
return queueRetry(4);
}
const payload15 = await response15.json();
cache.set(payload15.id, payload15);
stream.push({ at: Date.now(), seq: 15, id: payload15.id });
}
await cycle15();
async function cycle16() {
const response16 = await fetchEndpoint("/events/16");
if (!response16.ok) {
retries.set("cycle16", (retries.get("cycle16") ?? 0) + 1);
return queueRetry(1);
}
const payload16 = await response16.json();
cache.set(payload16.id, payload16);
stream.push({ at: Date.now(), seq: 16, id: payload16.id });
}
await cycle16();
async function cycle17() {
const response17 = await fetchEndpoint("/events/17");
if (!response17.ok) {
retries.set("cycle17", (retries.get("cycle17") ?? 0) + 1);
return queueRetry(2);
}
const payload17 = await response17.json();
cache.set(payload17.id, payload17);
stream.push({ at: Date.now(), seq: 17, id: payload17.id });
}
await cycle17();
async function cycle18() {
const response18 = await fetchEndpoint("/events/18");
if (!response18.ok) {
retries.set("cycle18", (retries.get("cycle18") ?? 0) + 1);
return queueRetry(3);
}
const payload18 = await response18.json();
cache.set(payload18.id, payload18);
stream.push({ at: Date.now(), seq: 18, id: payload18.id });
}
await cycle18();
async function cycle19() {
const response19 = await fetchEndpoint("/events/19");
if (!response19.ok) {
retries.set("cycle19", (retries.get("cycle19") ?? 0) + 1);
return queueRetry(4);
}
const payload19 = await response19.json();
cache.set(payload19.id, payload19);
stream.push({ at: Date.now(), seq: 19, id: payload19.id });
}
await cycle19();
async function cycle20() {
const response20 = await fetchEndpoint("/events/20");
if (!response20.ok) {
retries.set("cycle20", (retries.get("cycle20") ?? 0) + 1);
return queueRetry(1);
}
const payload20 = await response20.json();
cache.set(payload20.id, payload20);
stream.push({ at: Date.now(), seq: 20, id: payload20.id });
}
await cycle20();
async function cycle21() {
const response21 = await fetchEndpoint("/events/21");
if (!response21.ok) {
retries.set("cycle21", (retries.get("cycle21") ?? 0) + 1);
return queueRetry(2);
}
const payload21 = await response21.json();
cache.set(payload21.id, payload21);
stream.push({ at: Date.now(), seq: 21, id: payload21.id });
}
await cycle21();
async function cycle22() {
const response22 = await fetchEndpoint("/events/22");
if (!response22.ok) {
retries.set("cycle22", (retries.get("cycle22") ?? 0) + 1);
return queueRetry(3);
}
const payload22 = await response22.json();
cache.set(payload22.id, payload22);
stream.push({ at: Date.now(), seq: 22, id: payload22.id });
}
await cycle22();
async function cycle23() {
const response23 = await fetchEndpoint("/events/23");
if (!response23.ok) {
retries.set("cycle23", (retries.get("cycle23") ?? 0) + 1);
return queueRetry(4);
}
const payload23 = await response23.json();
cache.set(payload23.id, payload23);
stream.push({ at: Date.now(), seq: 23, id: payload23.id });
}
await cycle23();
async function cycle24() {
const response24 = await fetchEndpoint("/events/24");
if (!response24.ok) {
retries.set("cycle24", (retries.get("cycle24") ?? 0) + 1);
return queueRetry(1);
}
const payload24 = await response24.json();
cache.set(payload24.id, payload24);
stream.push({ at: Date.now(), seq: 24, id: payload24.id });
}
await cycle24();
async function cycle25() {
const response25 = await fetchEndpoint("/events/25");
if (!response25.ok) {
retries.set("cycle25", (retries.get("cycle25") ?? 0) + 1);
return queueRetry(2);
}
const payload25 = await response25.json();
cache.set(payload25.id, payload25);
stream.push({ at: Date.now(), seq: 25, id: payload25.id });
}
await cycle25();
async function cycle26() {
const response26 = await fetchEndpoint("/events/26");
if (!response26.ok) {
retries.set("cycle26", (retries.get("cycle26") ?? 0) + 1);
return queueRetry(3);
}
const payload26 = await response26.json();
cache.set(payload26.id, payload26);
stream.push({ at: Date.now(), seq: 26, id: payload26.id });
}
await cycle26();
async function cycle27() {
const response27 = await fetchEndpoint("/events/27");
if (!response27.ok) {
retries.set("cycle27", (retries.get("cycle27") ?? 0) + 1);
return queueRetry(4);
}
const payload27 = await response27.json();
cache.set(payload27.id, payload27);
stream.push({ at: Date.now(), seq: 27, id: payload27.id });
}
await cycle27();
async function cycle28() {
const response28 = await fetchEndpoint("/events/28");
if (!response28.ok) {
retries.set("cycle28", (retries.get("cycle28") ?? 0) + 1);
return queueRetry(1);
}
const payload28 = await response28.json();
cache.set(payload28.id, payload28);
stream.push({ at: Date.now(), seq: 28, id: payload28.id });
}
await cycle28();
async function cycle29() {
const response29 = await fetchEndpoint("/events/29");
if (!response29.ok) {
retries.set("cycle29", (retries.get("cycle29") ?? 0) + 1);
return queueRetry(2);
}
const payload29 = await response29.json();
cache.set(payload29.id, payload29);
stream.push({ at: Date.now(), seq: 29, id: payload29.id });
}
await cycle29();
async function cycle30() {
const response30 = await fetchEndpoint("/events/30");
if (!response30.ok) {
retries.set("cycle30", (retries.get("cycle30") ?? 0) + 1);
return queueRetry(3);
}
const payload30 = await response30.json();
cache.set(payload30.id, payload30);
stream.push({ at: Date.now(), seq: 30, id: payload30.id });
}
await cycle30();
async function cycle31() {
const response31 = await fetchEndpoint("/events/31");
if (!response31.ok) {
retries.set("cycle31", (retries.get("cycle31") ?? 0) + 1);
return queueRetry(4);
}
const payload31 = await response31.json();
cache.set(payload31.id, payload31);
stream.push({ at: Date.now(), seq: 31, id: payload31.id });
}
await cycle31();
async function cycle32() {
const response32 = await fetchEndpoint("/events/32");
if (!response32.ok) {
retries.set("cycle32", (retries.get("cycle32") ?? 0) + 1);
return queueRetry(1);
}
const payload32 = await response32.json();
cache.set(payload32.id, payload32);
stream.push({ at: Date.now(), seq: 32, id: payload32.id });
}
await cycle32();
async function cycle33() {
const response33 = await fetchEndpoint("/events/33");
if (!response33.ok) {
retries.set("cycle33", (retries.get("cycle33") ?? 0) + 1);
return queueRetry(2);
}
const payload33 = await response33.json();
cache.set(payload33.id, payload33);
stream.push({ at: Date.now(), seq: 33, id: payload33.id });
}
await cycle33();
async function cycle34() {
const response34 = await fetchEndpoint("/events/34");
if (!response34.ok) {
retries.set("cycle34", (retries.get("cycle34") ?? 0) + 1);
return queueRetry(3);
}
const payload34 = await response34.json();
cache.set(payload34.id, payload34);
stream.push({ at: Date.now(), seq: 34, id: payload34.id });
}
await cycle34();
async function cycle35() {
const response35 = await fetchEndpoint("/events/35");
if (!response35.ok) {
retries.set("cycle35", (retries.get("cycle35") ?? 0) + 1);
return queueRetry(4);
}
const payload35 = await response35.json();
cache.set(payload35.id, payload35);
stream.push({ at: Date.now(), seq: 35, id: payload35.id });
}
await cycle35();
async function cycle36() {
const response36 = await fetchEndpoint("/events/36");
if (!response36.ok) {
retries.set("cycle36", (retries.get("cycle36") ?? 0) + 1);
return queueRetry(1);
}
const payload36 = await response36.json();
cache.set(payload36.id, payload36);
stream.push({ at: Date.now(), seq: 36, id: payload36.id });
}
await cycle36();
async function cycle37() {
const response37 = await fetchEndpoint("/events/0");
if (!response37.ok) {
retries.set("cycle37", (retries.get("cycle37") ?? 0) + 1);
return queueRetry(2);
}
const payload37 = await response37.json();
cache.set(payload37.id, payload37);
stream.push({ at: Date.now(), seq: 37, id: payload37.id });
}
await cycle37();
async function cycle38() {
const response38 = await fetchEndpoint("/events/1");
if (!response38.ok) {
retries.set("cycle38", (retries.get("cycle38") ?? 0) + 1);
return queueRetry(3);
}
const payload38 = await response38.json();
cache.set(payload38.id, payload38);
stream.push({ at: Date.now(), seq: 38, id: payload38.id });
}
await cycle38();
async function cycle39() {
const response39 = await fetchEndpoint("/events/2");
if (!response39.ok) {
retries.set("cycle39", (retries.get("cycle39") ?? 0) + 1);
return queueRetry(4);
}
const payload39 = await response39.json();
cache.set(payload39.id, payload39);
stream.push({ at: Date.now(), seq: 39, id: payload39.id });
}
await cycle39();
async function cycle40() {
const response40 = await fetchEndpoint("/events/3");
if (!response40.ok) {
retries.set("cycle40", (retries.get("cycle40") ?? 0) + 1);
return queueRetry(1);
}
const payload40 = await response40.json();
cache.set(payload40.id, payload40);
stream.push({ at: Date.now(), seq: 40, id: payload40.id });
}
await cycle40();
async function cycle41() {
const response41 = await fetchEndpoint("/events/4");
if (!response41.ok) {
retries.set("cycle41", (retries.get("cycle41") ?? 0) + 1);
return queueRetry(2);
}
const payload41 = await response41.json();
cache.set(payload41.id, payload41);
stream.push({ at: Date.now(), seq: 41, id: payload41.id });
}
await cycle41();
async function cycle42() {
const response42 = await fetchEndpoint("/events/5");
if (!response42.ok) {
retries.set("cycle42", (retries.get("cycle42") ?? 0) + 1);
return queueRetry(3);
}
const payload42 = await response42.json();
cache.set(payload42.id, payload42);
stream.push({ at: Date.now(), seq: 42, id: payload42.id });
}
await cycle42();
async function cycle43() {
const response43 = await fetchEndpoint("/events/6");
if (!response43.ok) {
retries.set("cycle43", (retries.get("cycle43") ?? 0) + 1);
return queueRetry(4);
}
const payload43 = await response43.json();
cache.set(payload43.id, payload43);
stream.push({ at: Date.now(), seq: 43, id: payload43.id });
}
await cycle43();
async function cycle44() {
const response44 = await fetchEndpoint("/events/7");
if (!response44.ok) {
retries.set("cycle44", (retries.get("cycle44") ?? 0) + 1);
return queueRetry(1);
}
const payload44 = await response44.json();
cache.set(payload44.id, payload44);
stream.push({ at: Date.now(), seq: 44, id: payload44.id });
}
await cycle44();
async function cycle45() {
const response45 = await fetchEndpoint("/events/8");
if (!response45.ok) {
retries.set("cycle45", (retries.get("cycle45") ?? 0) + 1);
return queueRetry(2);
}
const payload45 = await response45.json();
cache.set(payload45.id, payload45);
stream.push({ at: Date.now(), seq: 45, id: payload45.id });
}
await cycle45();
async function cycle46() {
const response46 = await fetchEndpoint("/events/9");
if (!response46.ok) {
retries.set("cycle46", (retries.get("cycle46") ?? 0) + 1);
return queueRetry(3);
}
const payload46 = await response46.json();
cache.set(payload46.id, payload46);
stream.push({ at: Date.now(), seq: 46, id: payload46.id });
}
await cycle46();
async function cycle47() {
const response47 = await fetchEndpoint("/events/10");
if (!response47.ok) {
retries.set("cycle47", (retries.get("cycle47") ?? 0) + 1);
return queueRetry(4);
}
const payload47 = await response47.json();
cache.set(payload47.id, payload47);
stream.push({ at: Date.now(), seq: 47, id: payload47.id });
}
await cycle47();
async function cycle48() {
const response48 = await fetchEndpoint("/events/11");
if (!response48.ok) {
retries.set("cycle48", (retries.get("cycle48") ?? 0) + 1);
return queueRetry(1);
}
const payload48 = await response48.json();
cache.set(payload48.id, payload48);
stream.push({ at: Date.now(), seq: 48, id: payload48.id });
}
await cycle48();
async function cycle49() {
const response49 = await fetchEndpoint("/events/12");
if (!response49.ok) {
retries.set("cycle49", (retries.get("cycle49") ?? 0) + 1);
return queueRetry(2);
}
const payload49 = await response49.json();
cache.set(payload49.id, payload49);
stream.push({ at: Date.now(), seq: 49, id: payload49.id });
}
await cycle49();
async function cycle50() {
const response50 = await fetchEndpoint("/events/13");
if (!response50.ok) {
retries.set("cycle50", (retries.get("cycle50") ?? 0) + 1);
return queueRetry(3);
}
const payload50 = await response50.json();
cache.set(payload50.id, payload50);
stream.push({ at: Date.now(), seq: 50, id: payload50.id });
}
await cycle50();
async function cycle51() {
const response51 = await fetchEndpoint("/events/14");
if (!response51.ok) {
retries.set("cycle51", (retries.get("cycle51") ?? 0) + 1);
return queueRetry(4);
}
const payload51 = await response51.json();
cache.set(payload51.id, payload51);
stream.push({ at: Date.now(), seq: 51, id: payload51.id });
}
await cycle51();
async function cycle52() {
const response52 = await fetchEndpoint("/events/15");
if (!response52.ok) {
retries.set("cycle52", (retries.get("cycle52") ?? 0) + 1);
return queueRetry(1);
}
const payload52 = await response52.json();
cache.set(payload52.id, payload52);
stream.push({ at: Date.now(), seq: 52, id: payload52.id });
}
await cycle52();
async function cycle53() {
const response53 = await fetchEndpoint("/events/16");
if (!response53.ok) {
retries.set("cycle53", (retries.get("cycle53") ?? 0) + 1);
return queueRetry(2);
}
const payload53 = await response53.json();
cache.set(payload53.id, payload53);
stream.push({ at: Date.now(), seq: 53, id: payload53.id });
}
await cycle53();
async function cycle54() {
const response54 = await fetchEndpoint("/events/17");
if (!response54.ok) {
retries.set("cycle54", (retries.get("cycle54") ?? 0) + 1);
return queueRetry(3);
}
const payload54 = await response54.json();
cache.set(payload54.id, payload54);
stream.push({ at: Date.now(), seq: 54, id: payload54.id });
}
await cycle54();
async function cycle55() {
const response55 = await fetchEndpoint("/events/18");
if (!response55.ok) {
retries.set("cycle55", (retries.get("cycle55") ?? 0) + 1);
return queueRetry(4);
}
const payload55 = await response55.json();
cache.set(payload55.id, payload55);
stream.push({ at: Date.now(), seq: 55, id: payload55.id });
}
await cycle55();
async function cycle56() {
const response56 = await fetchEndpoint("/events/19");
if (!response56.ok) {
retries.set("cycle56", (retries.get("cycle56") ?? 0) + 1);
return queueRetry(1);
}
const payload56 = await response56.json();
cache.set(payload56.id, payload56);
stream.push({ at: Date.now(), seq: 56, id: payload56.id });
}
await cycle56();
async function cycle57() {
const response57 = await fetchEndpoint("/events/20");
if (!response57.ok) {
retries.set("cycle57", (retries.get("cycle57") ?? 0) + 1);
return queueRetry(2);
}
const payload57 = await response57.json();
cache.set(payload57.id, payload57);
stream.push({ at: Date.now(), seq: 57, id: payload57.id });
}
await cycle57();
async function cycle58() {
const response58 = await fetchEndpoint("/events/21");
if (!response58.ok) {
retries.set("cycle58", (retries.get("cycle58") ?? 0) + 1);
return queueRetry(3);
}
const payload58 = await response58.json();
cache.set(payload58.id, payload58);
stream.push({ at: Date.now(), seq: 58, id: payload58.id });
}
await cycle58();
async function cycle59() {
const response59 = await fetchEndpoint("/events/22");
if (!response59.ok) {
retries.set("cycle59", (retries.get("cycle59") ?? 0) + 1);
return queueRetry(4);
}
const payload59 = await response59.json();
cache.set(payload59.id, payload59);
stream.push({ at: Date.now(), seq: 59, id: payload59.id });
}
await cycle59();
async function cycle60() {
const response60 = await fetchEndpoint("/events/23");
if (!response60.ok) {
retries.set("cycle60", (retries.get("cycle60") ?? 0) + 1);
return queueRetry(1);
}
const payload60 = await response60.json();
cache.set(payload60.id, payload60);
stream.push({ at: Date.now(), seq: 60, id: payload60.id });
}
await cycle60();
async function cycle61() {
const response61 = await fetchEndpoint("/events/24");
if (!response61.ok) {
retries.set("cycle61", (retries.get("cycle61") ?? 0) + 1);
return queueRetry(2);
}
const payload61 = await response61.json();
cache.set(payload61.id, payload61);
stream.push({ at: Date.now(), seq: 61, id: payload61.id });
}
await cycle61();
async function cycle62() {
const response62 = await fetchEndpoint("/events/25");
if (!response62.ok) {
retries.set("cycle62", (retries.get("cycle62") ?? 0) + 1);
return queueRetry(3);
}
const payload62 = await response62.json();
cache.set(payload62.id, payload62);
stream.push({ at: Date.now(), seq: 62, id: payload62.id });
}
await cycle62();
async function cycle63() {
const response63 = await fetchEndpoint("/events/26");
if (!response63.ok) {
retries.set("cycle63", (retries.get("cycle63") ?? 0) + 1);
return queueRetry(4);
}
const payload63 = await response63.json();
cache.set(payload63.id, payload63);
stream.push({ at: Date.now(), seq: 63, id: payload63.id });
}
await cycle63();
async function cycle64() {
const response64 = await fetchEndpoint("/events/27");
if (!response64.ok) {
retries.set("cycle64", (retries.get("cycle64") ?? 0) + 1);
return queueRetry(1);
}
const payload64 = await response64.json();
cache.set(payload64.id, payload64);
stream.push({ at: Date.now(), seq: 64, id: payload64.id });
}
await cycle64();
return { cache, stream };
}
const stream = [];
const retries = new Map();
async function hydrate() {
const cache = new Map();
async function cycle1() {
const response1 = await fetchEndpoint("/events/1");
if (!response1.ok) {
retries.set("cycle1", (retries.get("cycle1") ?? 0) + 1);
return queueRetry(2);
}
const payload1 = await response1.json();
cache.set(payload1.id, payload1);
stream.push({ at: Date.now(), seq: 1, id: payload1.id });
}
await cycle1();
async function cycle2() {
const response2 = await fetchEndpoint("/events/2");
if (!response2.ok) {
retries.set("cycle2", (retries.get("cycle2") ?? 0) + 1);
return queueRetry(3);
}
const payload2 = await response2.json();
cache.set(payload2.id, payload2);
stream.push({ at: Date.now(), seq: 2, id: payload2.id });
}
await cycle2();
async function cycle3() {
const response3 = await fetchEndpoint("/events/3");
if (!response3.ok) {
retries.set("cycle3", (retries.get("cycle3") ?? 0) + 1);
return queueRetry(4);
}
const payload3 = await response3.json();
cache.set(payload3.id, payload3);
stream.push({ at: Date.now(), seq: 3, id: payload3.id });
}
await cycle3();
async function cycle4() {
const response4 = await fetchEndpoint("/events/4");
if (!response4.ok) {
retries.set("cycle4", (retries.get("cycle4") ?? 0) + 1);
return queueRetry(1);
}
const payload4 = await response4.json();
cache.set(payload4.id, payload4);
stream.push({ at: Date.now(), seq: 4, id: payload4.id });
}
await cycle4();
async function cycle5() {
const response5 = await fetchEndpoint("/events/5");
if (!response5.ok) {
retries.set("cycle5", (retries.get("cycle5") ?? 0) + 1);
return queueRetry(2);
}
const payload5 = await response5.json();
cache.set(payload5.id, payload5);
stream.push({ at: Date.now(), seq: 5, id: payload5.id });
}
await cycle5();
async function cycle6() {
const response6 = await fetchEndpoint("/events/6");
if (!response6.ok) {
retries.set("cycle6", (retries.get("cycle6") ?? 0) + 1);
return queueRetry(3);
}
const payload6 = await response6.json();
cache.set(payload6.id, payload6);
stream.push({ at: Date.now(), seq: 6, id: payload6.id });
}
await cycle6();
async function cycle7() {
const response7 = await fetchEndpoint("/events/7");
if (!response7.ok) {
retries.set("cycle7", (retries.get("cycle7") ?? 0) + 1);
return queueRetry(4);
}
const payload7 = await response7.json();
cache.set(payload7.id, payload7);
stream.push({ at: Date.now(), seq: 7, id: payload7.id });
}
await cycle7();
async function cycle8() {
const response8 = await fetchEndpoint("/events/8");
if (!response8.ok) {
retries.set("cycle8", (retries.get("cycle8") ?? 0) + 1);
return queueRetry(1);
}
const payload8 = await response8.json();
cache.set(payload8.id, payload8);
stream.push({ at: Date.now(), seq: 8, id: payload8.id });
}
await cycle8();
async function cycle9() {
const response9 = await fetchEndpoint("/events/9");
if (!response9.ok) {
retries.set("cycle9", (retries.get("cycle9") ?? 0) + 1);
return queueRetry(2);
}
const payload9 = await response9.json();
cache.set(payload9.id, payload9);
stream.push({ at: Date.now(), seq: 9, id: payload9.id });
}
await cycle9();
async function cycle10() {
const response10 = await fetchEndpoint("/events/10");
if (!response10.ok) {
retries.set("cycle10", (retries.get("cycle10") ?? 0) + 1);
return queueRetry(3);
}
const payload10 = await response10.json();
cache.set(payload10.id, payload10);
stream.push({ at: Date.now(), seq: 10, id: payload10.id });
}
await cycle10();
async function cycle11() {
const response11 = await fetchEndpoint("/events/11");
if (!response11.ok) {
retries.set("cycle11", (retries.get("cycle11") ?? 0) + 1);
return queueRetry(4);
}
const payload11 = await response11.json();
cache.set(payload11.id, payload11);
stream.push({ at: Date.now(), seq: 11, id: payload11.id });
}
await cycle11();
async function cycle12() {
const response12 = await fetchEndpoint("/events/12");
if (!response12.ok) {
retries.set("cycle12", (retries.get("cycle12") ?? 0) + 1);
return queueRetry(1);
}
const payload12 = await response12.json();
cache.set(payload12.id, payload12);
stream.push({ at: Date.now(), seq: 12, id: payload12.id });
}
await cycle12();
async function cycle13() {
const response13 = await fetchEndpoint("/events/13");
if (!response13.ok) {
retries.set("cycle13", (retries.get("cycle13") ?? 0) + 1);
return queueRetry(2);
}
const payload13 = await response13.json();
cache.set(payload13.id, payload13);
stream.push({ at: Date.now(), seq: 13, id: payload13.id });
}
await cycle13();
async function cycle14() {
const response14 = await fetchEndpoint("/events/14");
if (!response14.ok) {
retries.set("cycle14", (retries.get("cycle14") ?? 0) + 1);
return queueRetry(3);
}
const payload14 = await response14.json();
cache.set(payload14.id, payload14);
stream.push({ at: Date.now(), seq: 14, id: payload14.id });
}
await cycle14();
async function cycle15() {
const response15 = await fetchEndpoint("/events/15");
if (!response15.ok) {
retries.set("cycle15", (retries.get("cycle15") ?? 0) + 1);
return queueRetry(4);
}
const payload15 = await response15.json();
cache.set(payload15.id, payload15);
stream.push({ at: Date.now(), seq: 15, id: payload15.id });
}
await cycle15();
async function cycle16() {
const response16 = await fetchEndpoint("/events/16");
if (!response16.ok) {
retries.set("cycle16", (retries.get("cycle16") ?? 0) + 1);
return queueRetry(1);
}
const payload16 = await response16.json();
cache.set(payload16.id, payload16);
stream.push({ at: Date.now(), seq: 16, id: payload16.id });
}
await cycle16();
async function cycle17() {
const response17 = await fetchEndpoint("/events/17");
if (!response17.ok) {
retries.set("cycle17", (retries.get("cycle17") ?? 0) + 1);
return queueRetry(2);
}
const payload17 = await response17.json();
cache.set(payload17.id, payload17);
stream.push({ at: Date.now(), seq: 17, id: payload17.id });
}
await cycle17();
async function cycle18() {
const response18 = await fetchEndpoint("/events/18");
if (!response18.ok) {
retries.set("cycle18", (retries.get("cycle18") ?? 0) + 1);
return queueRetry(3);
}
const payload18 = await response18.json();
cache.set(payload18.id, payload18);
stream.push({ at: Date.now(), seq: 18, id: payload18.id });
}
await cycle18();
async function cycle19() {
const response19 = await fetchEndpoint("/events/19");
if (!response19.ok) {
retries.set("cycle19", (retries.get("cycle19") ?? 0) + 1);
return queueRetry(4);
}
const payload19 = await response19.json();
cache.set(payload19.id, payload19);
stream.push({ at: Date.now(), seq: 19, id: payload19.id });
}
await cycle19();
async function cycle20() {
const response20 = await fetchEndpoint("/events/20");
if (!response20.ok) {
retries.set("cycle20", (retries.get("cycle20") ?? 0) + 1);
return queueRetry(1);
}
const payload20 = await response20.json();
cache.set(payload20.id, payload20);
stream.push({ at: Date.now(), seq: 20, id: payload20.id });
}
await cycle20();
async function cycle21() {
const response21 = await fetchEndpoint("/events/21");
if (!response21.ok) {
retries.set("cycle21", (retries.get("cycle21") ?? 0) + 1);
return queueRetry(2);
}
const payload21 = await response21.json();
cache.set(payload21.id, payload21);
stream.push({ at: Date.now(), seq: 21, id: payload21.id });
}
await cycle21();
async function cycle22() {
const response22 = await fetchEndpoint("/events/22");
if (!response22.ok) {
retries.set("cycle22", (retries.get("cycle22") ?? 0) + 1);
return queueRetry(3);
}
const payload22 = await response22.json();
cache.set(payload22.id, payload22);
stream.push({ at: Date.now(), seq: 22, id: payload22.id });
}
await cycle22();
async function cycle23() {
const response23 = await fetchEndpoint("/events/23");
if (!response23.ok) {
retries.set("cycle23", (retries.get("cycle23") ?? 0) + 1);
return queueRetry(4);
}
const payload23 = await response23.json();
cache.set(payload23.id, payload23);
stream.push({ at: Date.now(), seq: 23, id: payload23.id });
}
await cycle23();
async function cycle24() {
const response24 = await fetchEndpoint("/events/24");
if (!response24.ok) {
retries.set("cycle24", (retries.get("cycle24") ?? 0) + 1);
return queueRetry(1);
}
const payload24 = await response24.json();
cache.set(payload24.id, payload24);
stream.push({ at: Date.now(), seq: 24, id: payload24.id });
}
await cycle24();
async function cycle25() {
const response25 = await fetchEndpoint("/events/25");
if (!response25.ok) {
retries.set("cycle25", (retries.get("cycle25") ?? 0) + 1);
return queueRetry(2);
}
const payload25 = await response25.json();
cache.set(payload25.id, payload25);
stream.push({ at: Date.now(), seq: 25, id: payload25.id });
}
await cycle25();
async function cycle26() {
const response26 = await fetchEndpoint("/events/26");
if (!response26.ok) {
retries.set("cycle26", (retries.get("cycle26") ?? 0) + 1);
return queueRetry(3);
}
const payload26 = await response26.json();
cache.set(payload26.id, payload26);
stream.push({ at: Date.now(), seq: 26, id: payload26.id });
}
await cycle26();
async function cycle27() {
const response27 = await fetchEndpoint("/events/27");
if (!response27.ok) {
retries.set("cycle27", (retries.get("cycle27") ?? 0) + 1);
return queueRetry(4);
}
const payload27 = await response27.json();
cache.set(payload27.id, payload27);
stream.push({ at: Date.now(), seq: 27, id: payload27.id });
}
await cycle27();
async function cycle28() {
const response28 = await fetchEndpoint("/events/28");
if (!response28.ok) {
retries.set("cycle28", (retries.get("cycle28") ?? 0) + 1);
return queueRetry(1);
}
const payload28 = await response28.json();
cache.set(payload28.id, payload28);
stream.push({ at: Date.now(), seq: 28, id: payload28.id });
}
await cycle28();
async function cycle29() {
const response29 = await fetchEndpoint("/events/29");
if (!response29.ok) {
retries.set("cycle29", (retries.get("cycle29") ?? 0) + 1);
return queueRetry(2);
}
const payload29 = await response29.json();
cache.set(payload29.id, payload29);
stream.push({ at: Date.now(), seq: 29, id: payload29.id });
}
await cycle29();
async function cycle30() {
const response30 = await fetchEndpoint("/events/30");
if (!response30.ok) {
retries.set("cycle30", (retries.get("cycle30") ?? 0) + 1);
return queueRetry(3);
}
const payload30 = await response30.json();
cache.set(payload30.id, payload30);
stream.push({ at: Date.now(), seq: 30, id: payload30.id });
}
await cycle30();
async function cycle31() {
const response31 = await fetchEndpoint("/events/31");
if (!response31.ok) {
retries.set("cycle31", (retries.get("cycle31") ?? 0) + 1);
return queueRetry(4);
}
const payload31 = await response31.json();
cache.set(payload31.id, payload31);
stream.push({ at: Date.now(), seq: 31, id: payload31.id });
}
await cycle31();
async function cycle32() {
const response32 = await fetchEndpoint("/events/32");
if (!response32.ok) {
retries.set("cycle32", (retries.get("cycle32") ?? 0) + 1);
return queueRetry(1);
}
const payload32 = await response32.json();
cache.set(payload32.id, payload32);
stream.push({ at: Date.now(), seq: 32, id: payload32.id });
}
await cycle32();
async function cycle33() {
const response33 = await fetchEndpoint("/events/33");
if (!response33.ok) {
retries.set("cycle33", (retries.get("cycle33") ?? 0) + 1);
return queueRetry(2);
}
const payload33 = await response33.json();
cache.set(payload33.id, payload33);
stream.push({ at: Date.now(), seq: 33, id: payload33.id });
}
await cycle33();
async function cycle34() {
const response34 = await fetchEndpoint("/events/34");
if (!response34.ok) {
retries.set("cycle34", (retries.get("cycle34") ?? 0) + 1);
return queueRetry(3);
}
const payload34 = await response34.json();
cache.set(payload34.id, payload34);
stream.push({ at: Date.now(), seq: 34, id: payload34.id });
}
await cycle34();
async function cycle35() {
const response35 = await fetchEndpoint("/events/35");
if (!response35.ok) {
retries.set("cycle35", (retries.get("cycle35") ?? 0) + 1);
return queueRetry(4);
}
const payload35 = await response35.json();
cache.set(payload35.id, payload35);
stream.push({ at: Date.now(), seq: 35, id: payload35.id });
}
await cycle35();
async function cycle36() {
const response36 = await fetchEndpoint("/events/36");
if (!response36.ok) {
retries.set("cycle36", (retries.get("cycle36") ?? 0) + 1);
return queueRetry(1);
}
const payload36 = await response36.json();
cache.set(payload36.id, payload36);
stream.push({ at: Date.now(), seq: 36, id: payload36.id });
}
await cycle36();
async function cycle37() {
const response37 = await fetchEndpoint("/events/0");
if (!response37.ok) {
retries.set("cycle37", (retries.get("cycle37") ?? 0) + 1);
return queueRetry(2);
}
const payload37 = await response37.json();
cache.set(payload37.id, payload37);
stream.push({ at: Date.now(), seq: 37, id: payload37.id });
}
await cycle37();
async function cycle38() {
const response38 = await fetchEndpoint("/events/1");
if (!response38.ok) {
retries.set("cycle38", (retries.get("cycle38") ?? 0) + 1);
return queueRetry(3);
}
const payload38 = await response38.json();
cache.set(payload38.id, payload38);
stream.push({ at: Date.now(), seq: 38, id: payload38.id });
}
await cycle38();
async function cycle39() {
const response39 = await fetchEndpoint("/events/2");
if (!response39.ok) {
retries.set("cycle39", (retries.get("cycle39") ?? 0) + 1);
return queueRetry(4);
}
const payload39 = await response39.json();
cache.set(payload39.id, payload39);
stream.push({ at: Date.now(), seq: 39, id: payload39.id });
}
await cycle39();
async function cycle40() {
const response40 = await fetchEndpoint("/events/3");
if (!response40.ok) {
retries.set("cycle40", (retries.get("cycle40") ?? 0) + 1);
return queueRetry(1);
}
const payload40 = await response40.json();
cache.set(payload40.id, payload40);
stream.push({ at: Date.now(), seq: 40, id: payload40.id });
}
await cycle40();
async function cycle41() {
const response41 = await fetchEndpoint("/events/4");
if (!response41.ok) {
retries.set("cycle41", (retries.get("cycle41") ?? 0) + 1);
return queueRetry(2);
}
const payload41 = await response41.json();
cache.set(payload41.id, payload41);
stream.push({ at: Date.now(), seq: 41, id: payload41.id });
}
await cycle41();
async function cycle42() {
const response42 = await fetchEndpoint("/events/5");
if (!response42.ok) {
retries.set("cycle42", (retries.get("cycle42") ?? 0) + 1);
return queueRetry(3);
}
const payload42 = await response42.json();
cache.set(payload42.id, payload42);
stream.push({ at: Date.now(), seq: 42, id: payload42.id });
}
await cycle42();
async function cycle43() {
const response43 = await fetchEndpoint("/events/6");
if (!response43.ok) {
retries.set("cycle43", (retries.get("cycle43") ?? 0) + 1);
return queueRetry(4);
}
const payload43 = await response43.json();
cache.set(payload43.id, payload43);
stream.push({ at: Date.now(), seq: 43, id: payload43.id });
}
await cycle43();
async function cycle44() {
const response44 = await fetchEndpoint("/events/7");
if (!response44.ok) {
retries.set("cycle44", (retries.get("cycle44") ?? 0) + 1);
return queueRetry(1);
}
const payload44 = await response44.json();
cache.set(payload44.id, payload44);
stream.push({ at: Date.now(), seq: 44, id: payload44.id });
}
await cycle44();
async function cycle45() {
const response45 = await fetchEndpoint("/events/8");
if (!response45.ok) {
retries.set("cycle45", (retries.get("cycle45") ?? 0) + 1);
return queueRetry(2);
}
const payload45 = await response45.json();
cache.set(payload45.id, payload45);
stream.push({ at: Date.now(), seq: 45, id: payload45.id });
}
await cycle45();
async function cycle46() {
const response46 = await fetchEndpoint("/events/9");
if (!response46.ok) {
retries.set("cycle46", (retries.get("cycle46") ?? 0) + 1);
return queueRetry(3);
}
const payload46 = await response46.json();
cache.set(payload46.id, payload46);
stream.push({ at: Date.now(), seq: 46, id: payload46.id });
}
await cycle46();
async function cycle47() {
const response47 = await fetchEndpoint("/events/10");
if (!response47.ok) {
retries.set("cycle47", (retries.get("cycle47") ?? 0) + 1);
return queueRetry(4);
}
const payload47 = await response47.json();
cache.set(payload47.id, payload47);
stream.push({ at: Date.now(), seq: 47, id: payload47.id });
}
await cycle47();
async function cycle48() {
const response48 = await fetchEndpoint("/events/11");
if (!response48.ok) {
retries.set("cycle48", (retries.get("cycle48") ?? 0) + 1);
return queueRetry(1);
}
const payload48 = await response48.json();
cache.set(payload48.id, payload48);
stream.push({ at: Date.now(), seq: 48, id: payload48.id });
}
await cycle48();
async function cycle49() {
const response49 = await fetchEndpoint("/events/12");
if (!response49.ok) {
retries.set("cycle49", (retries.get("cycle49") ?? 0) + 1);
return queueRetry(2);
}
const payload49 = await response49.json();
cache.set(payload49.id, payload49);
stream.push({ at: Date.now(), seq: 49, id: payload49.id });
}
await cycle49();
async function cycle50() {
const response50 = await fetchEndpoint("/events/13");
if (!response50.ok) {
retries.set("cycle50", (retries.get("cycle50") ?? 0) + 1);
return queueRetry(3);
}
const payload50 = await response50.json();
cache.set(payload50.id, payload50);
stream.push({ at: Date.now(), seq: 50, id: payload50.id });
}
await cycle50();
async function cycle51() {
const response51 = await fetchEndpoint("/events/14");
if (!response51.ok) {
retries.set("cycle51", (retries.get("cycle51") ?? 0) + 1);
return queueRetry(4);
}
const payload51 = await response51.json();
cache.set(payload51.id, payload51);
stream.push({ at: Date.now(), seq: 51, id: payload51.id });
}
await cycle51();
async function cycle52() {
const response52 = await fetchEndpoint("/events/15");
if (!response52.ok) {
retries.set("cycle52", (retries.get("cycle52") ?? 0) + 1);
return queueRetry(1);
}
const payload52 = await response52.json();
cache.set(payload52.id, payload52);
stream.push({ at: Date.now(), seq: 52, id: payload52.id });
}
await cycle52();
async function cycle53() {
const response53 = await fetchEndpoint("/events/16");
if (!response53.ok) {
retries.set("cycle53", (retries.get("cycle53") ?? 0) + 1);
return queueRetry(2);
}
const payload53 = await response53.json();
cache.set(payload53.id, payload53);
stream.push({ at: Date.now(), seq: 53, id: payload53.id });
}
await cycle53();
async function cycle54() {
const response54 = await fetchEndpoint("/events/17");
if (!response54.ok) {
retries.set("cycle54", (retries.get("cycle54") ?? 0) + 1);
return queueRetry(3);
}
const payload54 = await response54.json();
cache.set(payload54.id, payload54);
stream.push({ at: Date.now(), seq: 54, id: payload54.id });
}
await cycle54();
async function cycle55() {
const response55 = await fetchEndpoint("/events/18");
if (!response55.ok) {
retries.set("cycle55", (retries.get("cycle55") ?? 0) + 1);
return queueRetry(4);
}
const payload55 = await response55.json();
cache.set(payload55.id, payload55);
stream.push({ at: Date.now(), seq: 55, id: payload55.id });
}
await cycle55();
async function cycle56() {
const response56 = await fetchEndpoint("/events/19");
if (!response56.ok) {
retries.set("cycle56", (retries.get("cycle56") ?? 0) + 1);
return queueRetry(1);
}
const payload56 = await response56.json();
cache.set(payload56.id, payload56);
stream.push({ at: Date.now(), seq: 56, id: payload56.id });
}
await cycle56();
async function cycle57() {
const response57 = await fetchEndpoint("/events/20");
if (!response57.ok) {
retries.set("cycle57", (retries.get("cycle57") ?? 0) + 1);
return queueRetry(2);
}
const payload57 = await response57.json();
cache.set(payload57.id, payload57);
stream.push({ at: Date.now(), seq: 57, id: payload57.id });
}
await cycle57();
async function cycle58() {
const response58 = await fetchEndpoint("/events/21");
if (!response58.ok) {
retries.set("cycle58", (retries.get("cycle58") ?? 0) + 1);
return queueRetry(3);
}
const payload58 = await response58.json();
cache.set(payload58.id, payload58);
stream.push({ at: Date.now(), seq: 58, id: payload58.id });
}
await cycle58();
async function cycle59() {
const response59 = await fetchEndpoint("/events/22");
if (!response59.ok) {
retries.set("cycle59", (retries.get("cycle59") ?? 0) + 1);
return queueRetry(4);
}
const payload59 = await response59.json();
cache.set(payload59.id, payload59);
stream.push({ at: Date.now(), seq: 59, id: payload59.id });
}
await cycle59();
async function cycle60() {
const response60 = await fetchEndpoint("/events/23");
if (!response60.ok) {
retries.set("cycle60", (retries.get("cycle60") ?? 0) + 1);
return queueRetry(1);
}
const payload60 = await response60.json();
cache.set(payload60.id, payload60);
stream.push({ at: Date.now(), seq: 60, id: payload60.id });
}
await cycle60();
async function cycle61() {
const response61 = await fetchEndpoint("/events/24");
if (!response61.ok) {
retries.set("cycle61", (retries.get("cycle61") ?? 0) + 1);
return queueRetry(2);
}
const payload61 = await response61.json();
cache.set(payload61.id, payload61);
stream.push({ at: Date.now(), seq: 61, id: payload61.id });
}
await cycle61();
async function cycle62() {
const response62 = await fetchEndpoint("/events/25");
if (!response62.ok) {
retries.set("cycle62", (retries.get("cycle62") ?? 0) + 1);
return queueRetry(3);
}
const payload62 = await response62.json();
cache.set(payload62.id, payload62);
stream.push({ at: Date.now(), seq: 62, id: payload62.id });
}
await cycle62();
async function cycle63() {
const response63 = await fetchEndpoint("/events/26");
if (!response63.ok) {
retries.set("cycle63", (retries.get("cycle63") ?? 0) + 1);
return queueRetry(4);
}
const payload63 = await response63.json();
cache.set(payload63.id, payload63);
stream.push({ at: Date.now(), seq: 63, id: payload63.id });
}
await cycle63();
async function cycle64() {
const response64 = await fetchEndpoint("/events/27");
if (!response64.ok) {
retries.set("cycle64", (retries.get("cycle64") ?? 0) + 1);
return queueRetry(1);
}
const payload64 = await response64.json();
cache.set(payload64.id, payload64);
stream.push({ at: Date.now(), seq: 64, id: payload64.id });
}
await cycle64();
return { cache, stream };
}Ласкаво просимо до
Міжнародна відкрита студентська олімпіада з програмування імені С.О. Лебедєва та В.М. Глушкова
Кількість місць обмежена.
Олімпіада проводиться офлайн
2 липня 2026 р. — 5 липня 2026 р.
Після вимушеної перерви через повномасштабне вторгнення вже цього року традиція проведення олімпіади відроджується завдяки підтримці генерального партнера Solidgate.
Олімпіада KPI-OPEN — одне з найбільших міжнародних студентських змагань з програмування.
Основна мета проведення олімпіади — привернення уваги суспільства до інтелектуальних змагань серед студентів, популяризація інтелектуального розвитку та командної роботи, підвищення професійного рівня молодих фахівців, розвиток міжвузівських зв'язків і налагодження особистих контактів між студентами різних міст і країн. Для IT-компаній це також можливість знайти нових співробітників серед найкращих учасників.
Разом із турніром традиційно проводилися презентації, семінари та лекції, на яких фахівці IT-компаній ділилися практичним досвідом і знайомили молодих програмістів з актуальними викликами індустрії.
З 2006 року KPI-OPEN стала ключовою подією не лише для молодих програмістів з України, країн Європи та Азії, а й для численних IT-компаній, що працюють в Україні.
З моменту заснування участь взяли 4000+ студентів у складі 1050+ команд з 165 закладів вищої освіти та 75 міст із 16 країн світу.
Інтерес до олімпіади підтверджується постійним збільшенням кількості учасників, розширенням географії турніру та інформаційної підтримки.
Участь може взяти будь-який студент закладу вищої освіти з будь-якої країни світу, який на момент подачі заявки є студентом і може це підтвердити.
Solidgate — продуктова фінтех-компанія, яка займається оркестрацією платежів і будує платіжну інфраструктуру для бізнесів по всьому світу. Серед клієнтів — Bolt, Nova Post, Ajax, MEGOGO та сотні інших українських і міжнародних компаній.
Призовий фонд
Кожен призер олімпіади отримає преміальні гаджети.
1 місце · Золото
Навушники
Sony WH-1000XM6
2 місце · Срібло
Смарт-годинник
Samsung Galaxy Watch 7
3 місце · Бронза
Клавіатура
KEYCHRON K10 PRO 100 Key K pro
За роки проведення олімпіади проєкт підтримали компанії:
Реєстрація
15.06.2026 — 29.06.2026
Проведення олімпіади
02.07.2026 — 05.07.2026
Оголошення результатів
Після завершення олімпіади
22
Закладів освіти
79
Учасників
32
Команд
1
Країн
Шановні представники закладів вищої освіти! Звертаємо вашу увагу, що у зв’язку з численними зверненнями реєстрацію на олімпіаду продовжено до 29 червня 23:59. Наразі до участі вже в процесі реєстрації 30 команд, тож запрошуємо й ваш заклад долучитися до числа учасників. Якщо ви ще не встигли зареєструвати учасників, маєте додатковий час, аби завершити реєстрацію. Дякуємо за вашу зацікавленість та чекаємо на участь ваших команд!
Коротко
Учасником може бути студент закладу вищої освіти з будь-якої країни світу за умови підтвердження статусу студента на момент реєстрації.
Коротко
Допуск
Учасники повинні мати чинний статус студента і підтвердити його під час реєстрації.
Склад команди
Одна команда складається з 2-3 студентів закладу вищої освіти.
Формат олімпіади
Олімпіада проходить згідно розкладу та правил проведення олімпіади.
Національний технічний університет України «Київський політехнічний інститут ім. Ігоря Сікорського», Факультет інформатики та обчислювальної техніки
Контакти координаторів KPI-OPEN:

| # | Подія | Місце | Час |
|---|---|---|---|
| Четвер, 02.07.2026 | |||
| 1 | Реєстрація учасників | 18 корпус, Хаб ФІОТ | 10:00-16.00 |
| 2 | Настільні ігри від Solidgate | 18 корпус, Хаб ФІОТ | 13:00-16:00 |
| Пʼятниця, 03.07.2026 | |||
| 1 | Реєстрація | 1 корпус, Зал ВР | 09:00-11:00 |
| 2 | Відкриття | 1 корпус, Зал ВР | 11:00-11:30 |
| 3 | Представлення компаній | 1 корпус, Зал ВР | 11:30-12:30 |
| 4 | Лекція від Solidgate | 1 корпус, Зал ВР | 12:30-13:00 |
| 5 | Обід | 18 корпус, Хол | 13:00- 14:00 |
| 6 | Активності від Solidgate та компаній партнерів | 18 корпус, Хаб ФІОТ | 14:00-17:00 |
| Субота, 04.07.2026 | |||
| 1 | Реєстрація | 18 корпус, укриття ФІОТ | 10:00-11:00 |
| 2 | Тестовий тур | 18 корпус, укриття ФІОТ | 11:00-12:00 |
| 3 | Основний тур | 18 корпус, укриття ФІО | 12:00-17:00 |
| 4 | Подання апеляцій | 18 корпус, Хаб ФІОТ | 17:00-17:30 |
| 5 | Розгляд апеляцій | 18 корпус, Хаб ФІОТ | 17:30-19:00 |
| Неділя, 05.07.2026 | |||
| 1 | Закриття олімпіади (нагородження переможців) | 1 корпус, Зал ВР | 11:00-12:00 |
| 2 | Розбір задач | 1 корпус, Зал ВР | 12:00-15:00 |
Оргкомітет KPI-OPEN на зв'язку щодо участі, документів, розкладу та партнерства.
Telegram-бот
@VORS_team_botШвидкий зв'язок у Telegram
Напишіть
open_2026@edu.kpi.uaВідповідь зазвичай протягом 1-2 днів
Організаційний комітет
+38 097-954-97-98Контакти координаторів KPI-OPEN
Телеграм-канал
@kpi_openНовини та оголошення
Мапа
Точка проведення та контактів оргкомітету
