From 39831ecd98193ae83a6a16d848bbc3a6836290e3 Mon Sep 17 00:00:00 2001 From: Filippo Casarin Date: Tue, 5 Dec 2023 11:54:33 +0100 Subject: [PATCH] Improve gen/GEN generation from cases.gen --- .../src/ioi/format/italian_yaml/cases_gen.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/task-maker-format/src/ioi/format/italian_yaml/cases_gen.rs b/task-maker-format/src/ioi/format/italian_yaml/cases_gen.rs index 9c6648688..e8a3bf41c 100644 --- a/task-maker-format/src/ioi/format/italian_yaml/cases_gen.rs +++ b/task-maker-format/src/ioi/format/italian_yaml/cases_gen.rs @@ -227,12 +227,11 @@ where for entry in &self.result { match entry { TaskInputEntry::Subtask(subtask) => { + let _ = writeln!(gen, "\n# Subtask {}", subtask.id); + let _ = writeln!(gen, "#ST: {}", subtask.max_score); if let Some(name) = &subtask.name { - let _ = writeln!(gen, "\n# Subtask {}: {}", subtask.id, name); - } else { - let _ = writeln!(gen, "\n# Subtask {}", subtask.id); + let _ = writeln!(gen, "#STNAME: {}", name); } - let _ = writeln!(gen, "#ST: {}", subtask.max_score); if let Some(constraints) = self.subtask_constraints.get(subtask.id as usize) { for constr in constraints { let _ = writeln!(gen, "# {:?}", constr); @@ -529,7 +528,6 @@ where None }; self.subtask_name = name.clone(); - // FIXME: the cases.gen format does not yet support giving the subtasks a name. self.result.push(TaskInputEntry::Subtask(SubtaskInfo { id: self.subtask_id, name,