Ուղարկել | Բոլոր լուծումները | Լավագույն լուծումները | Վերադառնալ ցուցակին |
ACM_0105 - STRINGS WITH SAME LETTERS |
A professor assigned a program to his class for which the output is a string of lower-case letters. Unfortunately, he did not specify an ordering of the characters in the string, so he is having difficulty grading student submissions. Because of that, he has requested that ICPC teams help by writing a program that inputs pairs of strings of lower-case letters and determines whether or not the strings have the same letters, though possibly in different orders. Note that repeated letters are important; the string “abc” and “aabbbcccc” are not viewed as having the same letters since the second one has more copies of each letter.
Input
Input to be processed will be pairs of lines containing nonempty strings of lower-case letters. All input will be valid until the end of file indicator. End of file will be signaled by two lines that contain just the word “END” in upper case. No input line will be longer than 1,000 characters.
Output
Report whether pairs of strings have the same letters or not. Follow the format exactly: “Case”, a space, the case number, a colon and one space, and the result given as “same” or “different” (lower-case, no punctuation). Do not print any trailing spaces.
Examples
№ |
stdin |
stdout |
1 |
testing intestg abc aabbbcccc abcabcbcc aabbbcccc abc xyz END END |
Case 1: same Case 2: different Case 3: same Case 4: different |
Ավելացրեց. | Հրանտ Հովհաննիսյան |
Ամսաթիվ. | 2014-01-28 |
Ժամանակի սահմանափակումը. | 1s |
Ծրագրի տեքստի սահմանափակումը. | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Լեզուներ. | Բոլորը բացի ASM32 ASM64 GAWK CLPS CLOJURE D ERL FSHARP FORTRAN GOSU HASK ICON ICK NEM NIM OBJC-CLANG PICO PIKE PYPY PYPY3 PY_NBC RUST SCM guile CHICKEN SED TCL WHITESPACE |
Աղբյուրը. | NA North Central 2013.H |