In programming contest circles, one of the most important roles is that of the Chief Equality Officer (CEO). This person is responsible for making sure that every team has an equal chance of winning the contest. Since last year's NWERC the current CEO, Gregor, has thought at length about how to make the contest even more fair and equal.
His answer is to introduce a new programming language as the only one allowed for submissions. This way, no team will be disadvantaged by not having mastered any of the allowed languages. This language is called Balloon, short for Building A Long List Of Ordinary Numbers. Its only data type is the list of integers. To keep the language fast, it contains only four instructions:
Naturally, we cannot use byte-by-byte output comparison any more when teams submit their solutions in Balloon, as its output is probabilistic. The judge server instead has to check whether a submitted program is equivalent to the sample solution created by the judges. Two programs are equivalent if for any list $$$L$$$ of integers, both programs have an equal probability of returning $$$L$$$.
It is your task to determine whether two given Balloon programs are equivalent.
The input consists of:
Each integer in each program is greater than $$$0$$$ and less than $$$10^{9}$$$.
If the two programs are equivalent, output "equal", otherwise output "not equal".
concat(shuffle([1,2]),shuffle([1,2])) shuffle([1,2,1,2])
not equal
sorted(concat([3,2,1],[4,5,6])) [1,2,3,4,5,6]
equal
concat(sorted([4,3,2,1]),shuffle([1])) concat(concat([1,2,3],shuffle([4])),sorted([1]))
equal
Name |
---|