Codeforces April Fools Contests All Problems A's list
April Fools Day Contest 2021
This is an interactive problem. You need to read participants' queries from standard input and print your responses to standard output. You don't know the number of queries upfront, so you'll need to process them as you get them; you'll know you're done once you reach the end of the file.
In each query, you will be asked the question, written in one line. You have to answer it correctly, patiently and without any display of emotions. Your response is case-insensitive.
Please make sure to use the stream flushing operation after each response in order not to leave part of your output in some buffer.
Is it rated? Is it rated? Is it rated?
NO NO NO
while True:
try:
q = input()
except EOFError:
break
print("no", flush=True)
- print("NO")
Thanos sort is a supervillain sorting algorithm, which works as follows: if the array is not sorted, snap your fingers* to remove the first or the second half of the items, and repeat the process.
Given an input array, what is the size of the longest sorted array you can obtain from it using Thanos sort?
*Infinity Gauntlet required.
The first line of input contains a single number () — the size of the array. is guaranteed to be a power of 2.
The second line of input contains space-separated integers () — the elements of the array.
Return the maximal length of a sorted array you can obtain using Thanos sort. The elements of the array have to be sorted in non-decreasing order.
4 1 2 2 4
4
8 11 12 1 2 13 14 3 4
2
4 7 6 5 4
1
- n = int(input())
- a = [ int(b) for b in input().split()]
- def t(a):
- if a==sorted(a):
- return len(a)
- else:
- return max(t(a[:len(a)//2]), t(a[len(a)//2:]))
- print(t(a))
The input contains a single integer a (10 ≤ a ≤ 999).
Output 0 or 1.
13
1
927
1
48
0
- n = int(input())
- if n%2==0:
- print(0)
- else:
- print(1)
The input contains a single integer a (1 ≤ a ≤ 30).
Output a single integer.
3
27
- a=[0,4, 22, 27, 58, 85, 94, 121, 166, 202, 265, 274, 319, 346, 355, 378, 382, 391, 438, 454, 483, 517, 526, 535, 562, 576, 588, 627, 634, 636, 645, 648, 654, 663, 666, 690, 706, 728, 729, 762, 778, 825, 852, 861, 895, 913, 915, 922, 958, 985, 1086, 1111, 1165]
- print(a[int(input())])
- #https://oeis.org/A006753
- #Find solution their :))
- n=int(input())
- print(int(2**n-(n>12)*2**(n-13)*100))
- #http://oeis.org/A221180
- #656A — Da Vinci Powers
- #This problem asked to figure out an integer sequence from two samples
- #and problem title. It turned out to be surprisingly hard, a lot harder than
- #I anticipated. A quick search through OEIS shows that while there are a lot of
- #sequences which have these two numbers in them, only one is related to Leonardo da
- #Vinci (and if you're looking for da Vinci, there are only two sequences overall).
- #http://oeis.org/A221180 is an erroneous series of powers of 2, written down by da
- #Vinci in his diaries and available as part of "Codex Madrid I".
- #n=int(input());print(int(2**n-(n>12)*2**(n-13)*100))
- w = {
- "8<":"[]",
- "[]":"()",
- "()":"8<"
- }
- a,b = input(), input()
- p = 0
- for i in range(0, len(a), 2):
- r,s = a[i:i+2],b[i:i+2]
- if(w[r]==s):
- p+=1
- elif(w[s]==r):
- p-=1
- if p==0:
- print("TIE")
- elif p<0:
- print("TEAM 2 WINS")
- else:
- print("TEAM 1 WINS")
The input contains a single integer a (1 ≤ a ≤ 40).
Output a single string.
2
Adams
8
Van Buren
29
Harding
- a=["","Washington","Adams","Jefferson","Madison","Monroe","Adams","Jackson","Van Buren","Harrison","Tyler","Polk","Taylor","Fillmore","Pierce","Buchanan","Lincoln","Johnson","Grant","Hayes","Garfield","Arthur","Cleveland","Harrison","Cleveland","McKinley","Roosevelt","Taft","Wilson","Harding","Coolidge","Hoover","Roosevelt","Truman","Eisenhower","Kennedy","Johnson","Nixon","Ford","Carter","Reagan"]
- print(a[int(input())])
The input contains two integers a1, a2 (0 ≤ ai ≤ 109), separated by a single space.
Output a single integer.
3 14
44
27 12
48
100 200
102
- a,b = input().split()
- print(int(a) + int(b[::-1]) )