시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
5 초 512 MB 70 40 35 55.556%

문제

"전화번호가 뭐에요?"

"제 전화번호의 각 자리를 영어단어로 바꾸고, 철자를 잘 섞으면 OZONE TOWER가 나와요."

"예?"

"그리고 제 전화번호는 오름차순으로 정렬되어 있어요."

"..."

입력

첫 줄에 테스트케이스의 개수 T가 주어진다. 각 테스트케이스에는 상대방이 제시한 스트링 S가 주어진다. S는 영어 대문자로만 이루어져 있다.

1≤ T ≤ 100이고, S의 길이는 3 이상 20 이하이다. 모든 테스트케이스에는 유일한 해답이 있다.

출력

각 줄에 테스트케이스 번호 x와 전화번호 y를 Case #x: y의 형태로 출력한다.

예제 입력 1

4
OZONETOWER
WEIGHFOXTOURIST
OURNEONFOE
ETHER

예제 출력 1

Case #1: 012
Case #2: 2468
Case #3: 114
Case #4: 3

힌트

ZERO ONE TWO의 철자를 잘 배열하면 OZONETOWER가 나온다.

W3sicHJvYmxlbV9pZCI6IjE0MzY5IiwicHJvYmxlbV9sYW5nIjoiMCIsInRpdGxlIjoiXHVjODA0XHVkNjU0XHViYzg4XHVkNjM4IFx1YzIxOFx1YzIxOFx1YWVkOFx1YjA3YyAoU21hbGwpIiwiZGVzY3JpcHRpb24iOiI8cD4mcXVvdDtcdWM4MDRcdWQ2NTRcdWJjODhcdWQ2MzhcdWFjMDAgXHViYjUwXHVjNWQwXHVjNjk0PyZxdW90OzxcL3A+XHJcblxyXG48cD4mcXVvdDtcdWM4MWMgXHVjODA0XHVkNjU0XHViYzg4XHVkNjM4XHVjNzU4IFx1YWMwMSBcdWM3OTBcdWI5YWNcdWI5N2MgXHVjNjAxXHVjNWI0XHViMmU4XHVjNWI0XHViODVjIFx1YmMxNFx1YWZiOFx1YWNlMCwgXHVjY2EwXHVjNzkwXHViOTdjIFx1Yzc5OCBcdWMxMWVcdWM3M2NcdWJhNzQgT1pPTkUgVE9XRVJcdWFjMDAgXHViMDk4XHVjNjQwXHVjNjk0LiZxdW90OzxcL3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G51bWJlciB0byBkbyB0aGF0ISBXaGF0IGlzIGl0PzxcL3A+XHJcbiIsImlucHV0IjoiPHA+VGhlIGZpcnN0IGxpbmUgb2YgdGhlIGlucHV0IGdpdmVzIHRoZSBudW1iZXIgb2YgdGVzdCBjYXNlcywmbmJzcDtULiZuYnNwO1QmbmJzcDt0ZXN0IGNhc2VzIGZvbGxvdy4gRWFjaCBjb25zaXN0cyBvZiBvbmUgbGluZSB3aXRoIGEgc3RyaW5nJm5ic3A7UyZuYnNwO29mIHVwcGVyY2FzZSBFbmdsaXNoIGxldHRlcnMuPFwvcD5cclxuXHJcbjxoMz5MaW1pdHM8XC9oMz5cclxuXHJcbjx1bD5cclxuXHQ8bGk+MSAmbGU7Jm5ic3A7VCZuYnNwOyZsZTsgMTAwLjxcL2xpPlxyXG5cdDxsaT5BIHVuaXF1ZSBhbnN3ZXIgaXMgZ3VhcmFudGVlZCB0byBleGlzdC48XC9saT5cclxuXHQ8bGk+MyAmbGU7IGxlbmd0aCBvZiZuYnNwO1MmbmJzcDsmbGU7IDIwLjxcL2xpPlxyXG48XC91bD5cclxuIiwib3V0cHV0IjoiPHA+Rm9yIGVhY2ggdGVzdCBjYXNlLCBvdXRwdXQgb25lIGxpbmUgY29udGFpbmluZyZuYnNwOzxjb2RlPkNhc2UgI3g6IHk8XC9jb2RlPiwgd2hlcmUmbmJzcDs8Y29kZT54PFwvY29kZT4mbmJzcDtpcyB0aGUgdGVzdCBjYXNlIG51bWJlciAoc3RhcnRpbmcgZnJvbSAxKSBhbmQmbmJzcDs8Y29kZT55PFwvY29kZT4mbmJzcDtpcyBhIHN0cmluZyBvZiBkaWdpdHM6IHRoZSBwaG9uZSBudW1iZXIuPFwvcD5cclxuIiwiaGludCI6IiIsIm9yaWdpbmFsIjoiMSIsInByb2JsZW1fbGFuZ19jb2RlIjoiXHVjNjAxXHVjNWI0In1d

출처

Contest > Google Code Jam > Google Code Jam 2016 > Round 1B A1번

  • 문제를 번역한 사람: jh05013

채점

  • 예제는 채점하지 않는다.