Jame Street

jame and jame are secret undercovers in Jame street*. In order to communicate secretely, jame** send encrypted messages known as JAME (Just A Message Encrypted)

To test their JAME, jame will choose a random integer a between 1 and 1000. He will then encrypt it to some integer b between 1 and 1000000000, and send a JAME containing b to jame.

Once jame receives b through jame's JAME, she will decrypt b back to the original integer a, and send a via JAME back to jame. The whole sequence is successful if jame receives the exact same integer a that he chose.

You are not jame or jame but the engineer of the JAME system. Implement JAME!

* Jame street is a major sponsor of this event
** jame is the plural form of jame

Communication Protocol

You are to implement two files.

The first file is jame.cpp

You are to implement the function int sendjame(int a)

a is an integer between 1 and 1000, and the function must return an integer between 1 and 1000000000

The second file is jame.cpp

You are to implement the function int sendjame(int b)

b is an integer between 1 and 1000000000, and the function must return an integer between 1 and 1000.

Sample Grader

You may find the grader and the two files in the attachment to test locally. The same grader reads from an input file with the following format:

The first line is a secret string. The second line is T, the number of testcase. Following which, each test case spans one line, which contains a single integer a.

The grader will first call sendjame(a) from jame.cpp and store the return value as b. Next, the grader will call sendjame(b) from jame.cpp, and if the return value is a it will be judged as correct.

If in any testcase, the return value is not exactly a, the program will terminate and you will be given the wrong answer verdict.

Note that the actual grader is identical to the sample grader.

Submitting jame.cpp to 'Jame Street'


You're not logged in! Click here to login

Time Limit: 1 Seconds
Memory Limit: 1024MB
Your best score: 0
Source: April Fools 2024 (oolimry)

Subtask Score
1 100