Are You Coding Me?

Limits: 1s, 512 MB

In the year 1992 AD, little Pranoti started to learn how to write. She already figured out that her left hand is far more stronger that her right. So she continued the subtle art of writing with her left hand. Unfortunately, no other friends of her’s used left arm for writing. Poor Pranoti observed that all the right handers including her teacher, starts writing from the left and continues to the right. For example, if they want to write the phrase, “Keep the faith”, first they write , ‘K’, then they put ‘e’ to the right of it, and so on. Pranoti thought she should also do the same thing, but with left hand! So she would start from right, write the first letter, and write the next one to it’s left. So she would write the same phrase above like ‘htiaf eht peeK’. But clearly, she was “doing it wrong”. Her teacher eventually found out this innocent mistake in her writing and fixed her. Even today, she uses her left arm for writing, but now everything is just alright!


This is a companion discussion topic for the original entry at https://toph.co/p/are-you-coding-me

There is absolutely something wrong with the problem.
Python submissions are not working!!
The following code is right in every aspect but yet generates a Wrong Answer.

for i in range(int(input())):
	print(input()[::-1])

but this submission wrtten in C++ follows the absolutely same logic and yet is Accepted?
Link to the code is here.

#include <bits/stdc++.h>
using namespace std;
int main() {
	int t;
	cin >> t;
	while(t--) {
		string s;
		cin >> s;
		reverse(s.begin(),s.end());
		cout << s <<endl;
	}
	return 0;
}

I think there may be something wrong. @hjr265

1 Like

Thank you, @touhidur!

The test I/O had some unnecessary space characters. The files have been updated and your Python submission has been rejudged.

https://toph.co/s/290759