Brightness of Brain
Contest
Problem J
Time limit: 1 second Memory: 16 MB
Meta Editor
The Problem
You got a job as a programmer in the ACM (ACool
Meta-editor)
company, which has has been serving as a producer of one of the coolest text
editor of the world. In the update process of the text editor program of that
company you are assigned a job to make a program unit which will grammatically
correct a line of text. Your job is very simple, take a line of text as input
and produce a line of output without the words repeated.
The Input
Contains several lines of text. Each line contains several
English words having no more then 50 characters each. A word may be defined as a portion of a string separated by one
or more spaces or tabs. There will be no blank line in the input. A line may
contain at most 20,000 characters. Input is terminated by EOF.
The Output
Produce a line of text for each line of input, after removing
any repeated pattern. The words must be separated by only one space.
Sample
Input
test string test string test string
repeat repeat
Sample
Output
test string
repeat
Suman Mahbub Created: 03-12-2002 Updated: 14-12-2002, 26-01-2003 Idea: mAruf Hasan