tcframe icon indicating copy to clipboard operation
tcframe copied to clipboard

Support jagged multiline input format

Open prabowo02 opened this issue 5 years ago • 0 comments

Suppose we have N arrays, each having the length M_i The arrays are given in the input in the following format:

N
M[1] A[1][1] A[1][2] ... A[1][M[1]]
M[2] A[2][1] A[2][2] ... A[2][M[2]]
.
.
M[N] A[N][1] A[N][2] ... A[N][M[N]]

Currently, the InputFormat is written as LINES(M, A) % SIZE(N) and the size of each array is checked again in the Constraints I think it is better to have the sizes of each array validated in the Input Format (maybe we can have something like LINES(M, A % SIZE(M)) % SIZE(N)).

This is also useful for multiple queries problem, where each query type has differing format.

Example problem: https://training.ia-toki.org/problemsets/182/problems/1065/

prabowo02 avatar Nov 10 '19 08:11 prabowo02