All problems were prepared by me and magnus.hegdahl. Thanks to BucketPotato and Monogon for valuable feedback and testing. Special thanks to MikeMirzayanov for the comingh up with the idea and preparing the unique checker for 1663H - Cross-Language Program. I hope you enjoyed the contest.
Example Python code written by Agnimandur is provided for each problem.
1663A - Who Tested?
The problem statement is the title of the problem.
Re-read the original announcement blog.
If you carefully read the announcement blog, you will notice that I especially thanked BucketPotato for testing. Just print "BucketPotato".
print("bucketpotato")
1663B - Mike's Sequence
Did you notice the peculiar constraints on the variable $$$r$$$?
"Mike" is of course MikeMirzayanov. "Mike's sequence" has to do with Codeforces ratings.
3000 is the cutoff for the highest rating: Legendary Grandmaster.
Mike's sequence are the Codeforces rating thresholds: [1200,1400,1600,1900,2100,2300,2400,2600,3000]. Your task is simply to print the threshold immediately above the provided rating $$$r$$$.
R = int(input())
ratings = [1200,1400,1600,1900,2100,2300,2400,2600,3000]
higher = [r for r in ratings if r > R]
print(higher[0])
1663C - Pōja Verdon
Aenar Targaryen was a dragonlord of Old Valyria.
The main clue is the title: "Pōja Verdon".
Aenar Targaryen was a dragonlord of Valyria (an empire from a A Song of Ice and Fire) who moved his family to Westeros right before Valyria was destroyed.
pōja
means their
and verdon
means sum
(or amount
based on context) in High Valyrian (you can easily translate this on Duolingo).
In a nutshell: Print the sum of the array.
n = int(input())
nums = list(map(int,input().strip().split()))
print(sum(nums))
1663D - Is it rated - 3
Did you notice that the problem had a special "constraints" section? That's highly unusual for a Codeforces problem.
The length of S is 3. Are there any famous three letter programming contests?
The capital variable letters and the "constraints" section are designed to mimic how atcoder.jp formats their problem statements.
The problem is asking whether the Atcoder contest (ABC,ARC,AGC) is rated for a rating $$$X$$$. (Note that the judge ignores Atcoder heuristic contests for simplicity).
- ABC's are rated for $$$[0,1999]$$$
- ARC's are rated for $$$[0,2799]$$$
- AGC's are rated for $$$[1200,\infty]$$$
s = input().strip()
x = int(input().strip())
if (s=="ABC" and x<2000) or (s=="ARC" and x<2800) or (s=="AGC" and x>=1200):
print('yes')
else:
print('no')
1663E - Are You Safe?
Do you recognize the story of the Minotaur?
The problem is a word search, but not for the word "minotaur".
Perhaps you recognize the story of the minotaur? Less known is the hero who saved the kids from the minotaur: his name was Theseus [thee-see-us].
The problem is just a word search (horizontal, vertical, diagonal) for theseus
. You should only go in the forward direction when you search for a word.
The grid contains other clues embedded in it. Perhaps you can find esoteric
, java
, and script
(hints for problem G). You might be able to find atcoder
(hint for problem D). Also hero
(hinting at Theseus for this problem).
There are also some red herring words out there.
1663F - In Every Generation...
Where is the quote from?
"buffy", "the", "vampire", "slayer"
"buffy" (length 5), "the" (length 3), "vampire" (length 7), "slayer" (length 6). Remember how $$$3 \le |s| \le 7$$$? Now go back to the sample and see what you can do.
The quote is from the well known TV series Buffy the Vampire Slayer.
Perhaps you notice the lengths of the words buffy
, the
, vampire
, slayer
are unique integers in the set {3,5,6,7}.
Given the string $$$s$$$, simply "add" that string with the target word of the same length.
Here's how adding two letters work:
- Convert both letters to numbers in $$$[0,25]$$$.
- Add the two numbers up modulo 26.
- Convert the number back into a letter.
You can verify your addition algorithm is correct by checking whether "tourist" + "vampire" = "ooggqjx" (as provided in the sample).
Finally, if the length of $$$s$$$ is $$$4$$$, the answer is "none", because there is no word of length 4 in Buffy the Vampire Slayer.
s = input().strip()
words = ["","","","the","","buffy","slayer","vampire"]
if len(s)==4:
print("none")
else:
target = words[len(s)]
ans = ""
for i in range(len(s)):
a = ord(s[i])-ord('a')
b = ord(target[i])-ord('a')
ans += chr((a+b)%26 + ord('a'))
print(ans)
1663G - Six Characters
Input is a normal string of letters, but output consists of non-letter characters?
Think of an esoteric programming language.
JSF (an esoteric programming language equivalent to Javascript that only uses 6 characters).
The April Fool's Contests love of esoteric programming languages, combined with the reference to "six characters", will eventually lead you to JSFuck.
The six characters is a pun: the input is a string of length 6 like "abcdef", but the output is a string \textit{consisting} of only 6 characters: [ ] ( ) ! +
.
Brief research will demonstrate a mapping from each english letter to a JSFuck string. Two letters can be concatenated with "+".Note that the optimal mapping will make your solution file approximately 12KB in size, well within the 64KB requirement of Codeforces.
However, the mapping from each letter to javascript is not unique! However, the legend mentions that Aenar needs to go to the string's "home". JSFuck's home website is here, which is where the jury's mapping is created from.
Alternatively, instead of hardcoding the generated strings, you can simply use the encoding algorithm provided in the Github.
1663H - Cross-Language Program
Google research into how Pascal and C++ work will eventually lead you to a solution like this.
// \
begin end.
int main() {}