*This was the most well-attended April Fools Day Contest in the whole history of them: 10343 participants solved at least one problem! It was also fairly well-balanced: while each problem has been solved by at least 200 participants, only 17 of them solved all 8 problems.*

## 1331A - Is it rated?

This was the consolation problem of the contest, and still a lot of participants asked me for hints on this problem — some even before the beginning of the round! If you're still not sure how to solve it, the contest announcement itself promised that the contest is not rated, so the answer is a resolute ``NO'' (case insensitive, quotes for clarity only) :-)

## 1331B - Limericks

Unusually for this type of contests, the second problem had an actual problem statement! The real task was hidden in it using Steganography 101 — the first letters of the lines spelled out "TWO FACTORS". A quick look at the examples confirmed that you needed to factor the given number and print its factors (in non-decreasing order, without space between them).

## 1331C - ...And after happily lived ever they

You are probably familiar with the fairy tale ending "... and they lived happily ever after". The problem title is almost that phrase, but with the words scrambled. If you check the problem statement in the other language, it will be a different 6-word phrase that underwent the same scramble. The constraints on the input say that it is an integer are from 0 to 2^{6}-1; these two things together should push you towards thinking about binary. The solution is as follows: read the input, convert it into a 6-bit binary representation and scramble it in the same way as the words in the title are scrambled (swapping the 2nd with the 6th and the 3rd with the 4th) before converting it back to the integer. You didn't need to worry whether you need to apply the permutation or the inverse permutation, since those two were the same.

## 1331D - Again?

*This problem has been written by kit1980.*

The answer is just the hexadecimal number given in the input taken modulo 2. The problem is absolutely unrelated to OEIS, same as 656F - Ace It!.

## 1331E - Jordan Smiley

The problem was inspired by the Jordan curve theorem, more specifically by this blog post. You were given the coordinates of a pixel within the picture, and you had to figure out whether it was inside or outside of the region defined by the closed curve that made up the picture.

Once you figured that out, the problem became mostly image parsing :-) The easiest way was to flood-fill the region inside the curve using an image editor, and then somehow convert pixels of different colors into an array of 0s and 1s.

## 1331F - Elementary!

YES or NO answer implies that you need to figure out whether the given word is "elementary!". At a glance this seems *elementary, my dear Watson!* — but the fact that "HOLMES" is a "NO" while "WATSON" is a "YES" suggests that this is not what's going on here. In fact you were supposed to use another meaning of the word "elementary" — the one of the periodic table of chemical elements. The word was "elementary" if it could be spelled using only the abbreviated symbols of elements: Ge-Ni-U-S or W-At-S-O-N.

## 1331G - Lingua Romana

*This problem has been written by kit1980.*

The problem statement is actual source code of a program written in Perligata. If you manage to run it (or translate it from Latin, though I wouldn't recommend that!), you might recognize TPK algorithm. After that you can implement it yourself or look it up on RosettaCode.

## 1331H - It's showtime

Both the problem title and the error message you'd get if you try to run some random code like "123" in custom invocation tab point you to an esoteric language ArnoldC — a language based on the one-liners of Arnold Schwarzenegger. You'd have to experiment a bit with finer and less documented points of the language, such as reading input, but modulo function is defined in the documentation, and overall it's a fairly approachable language — as long as you don't try anything fancy like arrays!

What about problem H

ArnoldC

it is still unknown :)

IT'S SHOWTIME YOU HAVE BEEN TERMINATED

IT HAS BEEN TERMINATED

STICK AROUND CHILL

GET YOUR ASS TO MARS

The answer for the first problem should be "YES" since it is April FOOLS Day. Like if you agree.

Then it would have been the first time a contestant would have felt a shock after getting an AC xD

Well, if that's the case, they could've taken it even further by updating the ratings and changing it back afterwards.

No thank you

"""You are probably familiar with the fairy tale ending "... and they lived happily ever after". """

NOPE

I didn't know that too. I figured it out myself.

Forever tourist orz

Are permutation in title in Russian and English statement consistent?

This inconsistency made me recover permutation from samples. I think, something is wrong with Russian statement, because English permutation is same as for samples.

I was confused with it aswell, but thought that english version is tested better and I used a permutation of english words.

Yeah, and the double “и” threw me off anyway.

And the samples actually allow two different permutations.

Alright, so the trick this time was to either try both permutations, or look at the statement in English.

That awkward moment when you use Google translate for the Russian version, and then realise "wtf am I doing" xD

Exactly, russian doesn't work correctly.

My bad, sorry about that!

I've believed that Toho only attracts East Asian…… But now I know it would attract everyone, just like Vodka would even attract Patchouli!

You are probably familiar with the fairy tale ending "... and they lived happily ever after"...uhhh,not really:)

How to find a solution for D? Is it just a random thing you should notice? I did submit x%2 at 9th minute of the contest, but was absolutely sure it's a wrong solution.

x should be the last digit here as today's is April fool day

print the last digit of binary code of given HEX code.

Are Problem G and H have the same solution as these are the boundaries of the last solution ->xd

After seeing problem A I was like, why it's not loading completely, but it was something different

hahaha,I just refresh for many times even though I have saw the complete problem

This contest was a proper waste of time. Had little high hopes from it...

but it was totally fun

no idea you're talking about which fun to be honest... -_-

I think the first question is telling us that my "Plot Twist 2: Contest is rated" will not happen. :)

How it feels to participate in fools day contest

gg

Really, wonder what next year will bring :D

Can anyone give me the actual code of H?

Here you go: 75151340

CodeLadies and gentlemen, we got her. Bessie the cow herself outside of Farmer John's barn.

Thank you!

But now i am going to die seeing the solution! -_-

Cool tasks! thanks!!! Like if you agree.

Even though I only got 4 problems, I enjoyed this year's April Fools contest much more than last year's. Great job!

Problem E: "somehow"(https://littlevgl.com/image-to-c-array)

I am quite disappointed that it turned out to be a real language in G :( I was deducing the actions based on the common knowledge of latin words, and THAT was actually very entertaining.

Maripium has made 73 submissions to get an AC to problem F! I am amazed! So much effort. Such Perseverance!!!!

meh, it's not interesting to solve like that

What a contest cool!!!!

Most people during the first 15 min of the contest:Busy reading questions and submitting solutionsMe:Furiously typing my login details literally every 2 minutes to try to read a question.Seriously though, does anyone know what's going on here?

I feel so sad for printing YES or NO instead of 0 or 1 in D :( . Really cool contest, btw I enjoyed it. I guess I was too engaged in searching about limericks, and analyze that mathematical limerick to notice it was also an acrostic. But I guess researching Limericks is a time well spent.

This contest was fun, especially during this Quarantined Lockdown due to Corona....

Many of us were bored at home and this was kinda entertaining.

better than actual rounds :)

This contest made me miss the IPSC, but this contest is way better. Thanks for giving me this interesting experience <3

For D, realizing I've found a pattern, I tried to fetch the given OEIS sequence and print the first element of it. The first submission got me RTE. But I kept trying, until I realized, I was fooled.

Submission:

can anyone provide me the code for B. how many inputs we have to take??

Unfortunately, the following didn't work for G: 75134077

Fortunately, you can add

`converte`

parameter to the`use`

statement and run locally. It outputs perl code that is almost valid.I had the same idea too

Unfortunately it was the only problem I couldn't solve in the contest as I didn't have the setup to run Perl

Yes, we checked that Codeforces doesn't have Perligata installed — that would've defeated the purpose of making you write a little code :-)

Can anyone tell me how to convert that image to string in C++/Python ? (in Problem E)

I used this code to get the answers for E:

(Here I filled the insides with red)

Someone please,explain H number problem...It is still unknown.

I agree. With large numbers like 100, it seems unreasonable to calculate the double factorial of n when n is too large.

The solutions that were given seem to be based on the assumption that, for any m > 0 and n > 2:

n!! mod m = (n x ((n-2)!! mod m)) mod m

and then calculate by recursion.

However I am not quite certain about the mathematical truth behind this assumption?

Edit: it seems the previously stated assumption is not actually true. However the algorithm still seems valid. Here is a readable version of the solution, courtesy of the winner, tourist:

I'd simplify the algorithm as such:

It seems to work, but I can't figure the mathematical proof behind it. Feel free to comment.

Okay I think I have a sort of proof.

We'll consider the congruence relation, defined here.

The core of the algorithm is the property that, for any positive integers

`a`

,`b`

, and`k`

, and an integer`m > 1`

, if`a ≡ b (mod m)`

then`ka ≡ kb (mod m)`

(stated here)We'll consider integers

`n`

and`m`

, so that n > 2 and m > 1. The goal of the algorithm is to compute`n!! mod m`

.Let

`p = n mod m`

. Therefore, by definition`n ≡ p (mod m)`

.So

`n(n - 2) ≡ p(n - 2) (mod m)`

.This means

`(n(n - 2)) mod m = (p(n - 2)) mod m = ((n mod m)(n - 2)) mod m`

.We'll call this number

`p'`

, so`p' = (p(n - 2)) mod m`

.Therefore

`n(n - 2) ≡ p(n - 2) (mod m)`

and`n(n - 2) ≡ p' (mod m)`

.So

`(n(n - 2)(n - 4)) mod m = (p(n - 2)(n - 4)) mod m = (p'(n - 4)) mod m`

...If we keep iterating like this, we can eventually compute

`n!! mod m`

through the aforementioned algorithm, without having to compute the potentially large number,`n!!`

.Feel free to comment.

fun contest and my first ac submissions

what is wrong with problem B ? for(i=2; i<=n/2; i++) { if(n % i == 0) cout<<i; }

your output should be i and (n/i) without space.