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

variablenames Batch , stdin/stdout

Registered Users Only

Please login to utilize this feature.

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

variablenames.html

All of you have probably heard about the amazing adventures of Rar the Cat. But he has one weakness that nobody knows about. Long variable names! Due to some weird form of obsession with squished code, Rar the Cat goes crazy whenever he sees variable names that are longer than 5 characters long.

Knowing his secret weakness, his evil junior, Bradley, has decided to exploit such a weakness by bombarding Rar the Cat with long variable names. Help code a program to shorten any of the long variable names submitted by Bradley.

Rar the Cat is a very picky cat, thus the variable names must be shortened in a very special way. Bradley likes to use overly_descriptive_variable_names that are words joined by underscores between them. Rar the Cat, however, would only want the first letter of each word to be used so that the code remains concise and understandable [for him]. For example, In this case, the variable would be shortened to 'odvn'.

Your Task:

Create a program that shortens Bradley's long variable names. The long variable names will not be longer than 10000 characters long.

Input

The first line of input will be a single integer, t
t is the total number of testcases that follow. 0 < t < 100.
The following t lines would contain the evil variable names that Bradley uses to attack Rar the Cat.

Output

Output the shortened form of the variable names that Bradley gives Rar the Cat.
If the shortened variable name still exceeds 5 characters, output "CENSORED" to prevent Rar the Cat from going crazy.

Sample Input

4
a_variable_name
desmond_the_moonbear_is_crazy
why_are_my_variable_names_so_long
i_love_spongebob

Sample Output

avn
dtmic
CENSORED
ils

Tags

String Processing

Subtasks and Limits

Subtask Score #TC Time Memory Scoring
110051s64MBAverage
2011s64MBMinimum

Judge Compile Command

g++-8 ans.cpp -o variablenames -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.