Codeforces April Fools Problems A's list

Codeforces April Fools Contests All Problems A's list







Here is the list of all the Problem A's of previous year April Fool Problems. The list will be updated every year (if not please let me inform to update) btw these all are easy problems and definitely if you are a beginner these will boost you up. I don't guarantee you will get new skills but definitely get a bent towards "coding for fun". Hope you like it don't forget to subscribe my channel or comment a suggestion I am always up for help as much as I can. 


The 9th April Fools Day Contest will take place on Thursday April 1st. This is a joke competition in which solving the problem is often easier than figuring out what the actual task is.

April Fools Day Contest 2021


A. Is it rated - 2
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output
Interaction

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.


Example
input

Is it rated?
Is it rated?
Is it rated?
output

NO
NO
NO

Python:
while True:
    try:
        q = input()
    except EOFError:
        break
    print("no", flush=True)



 
A. Is it rated?
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Very easy problem. All april fool contests are not rated. So, the answer is "NO"

Python :
  1. print("NO")









A. Thanos Sort
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

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.


Input

The first line of input contains a single number n (1n16) — the size of the array. n is guaranteed to be a power of 2.

The second line of input contains n space-separated integers ai (1ai100) — the elements of the array.

Output

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.


Examples

input
Copy
4
1 2 2 4
output
Copy
4
input
Copy
8
11 12 1 2 13 14 3 4
output
Copy
2
input
Copy
4
7 6 5 4
output
Copy
1

Python :
  1. n = int(input())
  2. a = [ int(b) for b in input().split()]
  3.  
  4. def t(a):
  5. if a==sorted(a):
  6. return len(a)
  7. else:
  8. return max(t(a[:len(a)//2]), t(a[len(a)//2:]))
  9. print(t(a))







A. Quirky Quantifiers
time limit per test
2 seconds
memory limit per test
64 megabytes
input
standard input
output
standard output
Input

The input contains a single integer a (10 ≤ a ≤ 999).


Output

Output 0 or 1.

Examples
input
Copy
13
output
Copy
1
input
Copy
927
output
Copy
1
input
Copy
48
output
Copy
0

Python:
  1. n = int(input())
  2. if n%2==0:
  3. print(0)
  4. else:
  5. print(1)







A. Numbers Joke
time limit per test
2 seconds
memory limit per test
64 megabytes
input
standard input
output
standard output
Input

The input contains a single integer a (1 ≤ a ≤ 30).

Output

Output a single integer.

Example
input
Copy
3
output
Copy
27

Python:

  1. 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]
  2. print(a[int(input())])
  3.  
  4. #https://oeis.org/A006753
  5. #Find solution their :))







A. Da Vinci Powers
time limit per test
2 seconds
memory limit per test
64 megabytes
input
standard input
output
standard output
Input

The input contains a single integer a (0 ≤ a ≤ 35).

Output

Output a single integer.

Examples
input
Copy
3
output
Copy
8
input
Copy
10
output
Copy
1024

Python :

  1. n=int(input())
  2. print(int(2**n-(n>12)*2**(n-13)*100))
  3. #http://oeis.org/A221180
  4. #656A — Da Vinci Powers
  5. #This problem asked to figure out an integer sequence from two samples
  6. #and problem title. It turned out to be surprisingly hard, a lot harder than
  7. #I anticipated. A quick search through OEIS shows that while there are a lot of
  8. #sequences which have these two numbers in them, only one is related to Leonardo da
  9. #Vinci (and if you're looking for da Vinci, there are only two sequences overall).
  10. #http://oeis.org/A221180 is an erroneous series of powers of 2, written down by da
  11. #Vinci in his diaries and available as part of "Codex Madrid I".
  12. #n=int(input());print(int(2**n-(n>12)*2**(n-13)*100))




A. The Great Game
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Two teams meet in The Game World Championship. Some scientists consider this game to be the most intellectually challenging game in the world. You are given two strings describing the teams' actions in the final battle. Figure out who became the champion.

Input

The input contains two strings of equal length (between 2 and 20 characters, inclusive). Each line describes the actions of one team.

Output

Output "TEAM 1 WINS" if the first team won, "TEAM 2 WINS" if the second team won, and "TIE" if there was a tie.

Examples
input
Copy
[]()[]8<
8<[]()8<
output
Copy
TEAM 2 WINS
input
Copy
8<8<()
[]8<[]
output
Copy
TIE

Python :

  1. w = {
  2. "8<":"[]",
  3. "[]":"()",
  4. "()":"8<"
  5. }
  6.  
  7. a,b = input(), input()
  8. p = 0
  9.  
  10. for i in range(0, len(a), 2):
  11. r,s = a[i:i+2],b[i:i+2]
  12. if(w[r]==s):
  13. p+=1
  14. elif(w[s]==r):
  15. p-=1
  16.  
  17. if p==0:
  18. print("TIE")
  19. elif p<0:
  20. print("TEAM 2 WINS")
  21. else:
  22. print("TEAM 1 WINS")








A. Mysterious strings
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output
Input

The input contains a single integer a (1 ≤ a ≤ 40).

Output

Output a single string.

Examples
input
Copy
2
output
Copy
Adams
input
Copy
8
output
Copy
Van Buren
input
Copy
29
output
Copy
Harding
Python :

  1. 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"]
  2. print(a[int(input())])








A. Mysterious numbers - 1
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output
Input

The input contains two integers a1, a2 (0 ≤ ai ≤ 109), separated by a single space.

Output

Output a single integer.

Examples
input
Copy
3 14
output
Copy
44
input
Copy
27 12
output
Copy
48
input
Copy
100 200
output
Copy
102

Python :

  1. a,b = input().split()
  2. print(int(a) + int(b[::-1]) )


April Fool Codeforces Video Material

If you want to understand the codes through video, then here it is :