Guess the permutation
Practice
3 (54 votes)
Approved
Implementation
Medium
Open
Problem
15% Success 2200 Attempts 30 Points 1s Time Limit 8MB Memory 1024 KB Max Code

In this problem your goal is to guess some secret permutation A of integers from 1 to 16.

There are 17 tests in this problem. Test number i for 1 <= i <= 16 will have the following form:

  • the first line of the input contains string "ELEMENT" (without quotes)
  • the second line of the input of the test i contains two integers from 1 to 16 each - i and element A[i] of the secret permutation
  • the only line of the output file contains one integer - A[i] too.

Input of the last (the 17-th test) will contain the only string "PERMUTATION" (without quotes). For this test your program should output some permutation of integers from 1 to 16 - your variant of the secret permutation.

If this permutation equals to the secret permuation A and passes all the 17 tests with your solution , you will receive 100 points. Otherwise you will receive 0 points. Note that for each wrong try you will receive 20 minutes penalty time after you solved this problem (as in ACM ICPC format)

Let us remind you that after you submit solution you can see a detailed feedback for each test separately.

You can't use "compile and test" without using custom input. If you want to test your solution on hackerearth platform , please use custom input.

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:30
9 votes
Tags:
AlgorithmsBasic ProgrammingString Manipulation
Points:20
8 votes
Tags:
MathematicsEasy
Points:30
5 votes
Tags:
Basic ProgrammingBasics of ImplementationHiringImplementationMedium