onlinejudge_template.analyzer.output_types module

the module to analyze output types

この module は出力形式のパターンを分析し簡単化します。

たとえば

N
A_1 A_2 ... A_N

のような出力フォーマットの場合、戻り値を std::pair<int, std::vector<int> > とするのでなく、戻り値を std::vector<int> のみとし int N = A.size(); として N を復元するようにした方が便利です。この module このような最適化を目的としています。

onlinejudge_template.analyzer.output_types.analyze_output_type(*, output_format: onlinejudge_template.types.FormatNode, output_variables: Dict[NewType.<locals>.new_type, onlinejudge_template.types.VarDecl], constants: Dict[NewType.<locals>.new_type, onlinejudge_template.types.ConstantDecl]) → Optional[onlinejudge_template.types.OutputType][source]
onlinejudge_template.analyzer.output_types.match_indices(*, indices: List[NewType.<locals>.new_type], names: List[str]) → bool[source]