# Author: Finn Lidbetter INT(1, 200000, n) NEWLINE SET(passengermax=0) SET(locationmax=0) REPI(i, n) SET(passengers[i+1]=0) END REP(n*2) INT(1,n,passenger) SPACE INT(1, n*2, location) NEWLINE SET(passengers[passenger]=passengers[passenger]+1) # The passenger number appears at most twice. ASSERT(passengers[passenger]<=2) IF(passenger > passengermax) # A new passenger number is the next smallest passenger. ASSERT(passenger == passengermax + 1) SET(passengermax=passenger) END IF(location > locationmax) # A new location number is the next smallest location. ASSERT(location == locationmax + 1) SET(locationmax=location) END END # Each passenger number appears exactly twice. REPI(i, n) ASSERT(passengers[i+1]==2) END # https://github.com/DOMjudge/checktestdata # https://github.com/DOMjudge/checktestdata/blob/main/doc/format-spec.md # # Quick reference: # # integer := 0|-?[1-9][0-9]* # float := -?[0-9]+(\.[0-9]+)?([eE][+-]?[0-9]+)? # string := ".*" # varname := [a-z][a-z0-9]* # variable := | '[' [',' ...] ']' # value := | | | | # compare := '<' | '>' | '<=' | '>=' | '==' | '!=' # logical := '&&' | '||' # expr := | [+-] # term := | [*%/] # factor := | '-' | '(' ')' | '^' # test := '!' | | '(' ')' | | # # Test Commands: # MATCH( str) # ISEOF # UNIQUE( a [, b ...]) # INARRAY( val, var) # # Functions: # STRLEN( str) # # Commands: # SPACE / NEWLINE # EOF # INT( min, max [, name]) # FLOAT( min, max [, name [, option]]) # FLOATP( min, max, mindecimals, maxdecimals, [, name [, option]]) # STRING( str) # REGEX( str [, name]) # ASSERT( condition) # SET( name '=' value[, ...]) # UNSET( a [, b ...]) # REP( count [, separator]) [...] END # REPI( i, count [, separator]) [...] END # WHILE( condition [, separator]) [...] END # WHILEI( i, condition [, separator]) [...] END # IF( cond) [ cmds1...] [ELSE [ cmds2...]] END