oj mrJudge
Toggle navigation
  • Login
    • Forget Password
      Login
User Image

Hello, Stranger

Guest
  • Analysis Mode
  • Problems
    • All Problems
    • Latest Problems
  • Join Us Now
  • Registration
  • Contact Us
  • Infomation
  • About
    • Terms of Use
    • Technical Specifications
    • Credits

reverse Batch , stdin/stdout

Registered Users Only

Please login to utilize this feature.

Do note that this website only supports submissions in C++.

reverse.html

Problem Description

Rar the Cat is feeling weird today. He decided to text his girlfriend with using words that are spelled backwards.

For example: " RaWR I'm a Dinosaur! " will become " RwAR I'm a Ruasonid! "

Since it is hard to reverse or revert words that are spelled in reverse, he wants you to write a program to do it for him.

For clarity, words are defined as consecutive characters with each character being one of the following: A-Z, a-z.

The positions of punctuation marks and numbers (including apostrophes) should remain the same and the capitalization of the letters should remain the same (Eg: If the first letter is capitalized, the first letter of the reversed word should be capitalized as well).

Input

A single line, (with spaces and punctuations) consisting of not more than 1,000,000 characters.

Output

A single line, the reversed line of the input.

Subtasks

Subtask 1 (20%) will only consist of lowercase letters and spaces.

Subtask 2 (40%) will not consist uppercase letters

Subtask 3 (40%) will contain both uppercase and lowercase letters as well as numbers and punctuation marks.

Subtask 4 (0%) will be the sample testcases

Sample Testcase 1

Input

RaWR I'm a Dinosaur!

Output

RwAR I'm a Ruasonid!

Sample Testcase 2

Input

GniYnix123

Output

XinYing123

Tags

String Processing

Subtasks and Limits

Subtask Score #TC Time Memory Scoring
120151s32MBMinimum
240151s32MBMinimum
340151s32MBMinimum
4021s32MBMinimum

Judge Compile Command

g++-8 ans.cpp -o reverse -Wall -Wshadow -static -O2 -lm -m64 -s -w -std=gnu++17 -fmax-errors=512

Accepted Submissions

subIDUserTimeMax Time

Past Submissions

subIDUserTimeScore
mrJudge 09.05.20
Copyright © 2020 mrJudge. All rights reserved.