본문 바로가기

Programming/>> Algorithm14

[Lucky Algorithm] Big Sorting Consider an array of numeric strings, , where each string is a positive number with anywhere from to digits. Sort the array's elements in non-decreasing (i.e., ascending) order of their real-world integer values and print each element of the sorted array on a new line.Input FormatThe first line contains an integer, , denoting the number of strings in . Each of the subsequent lines contains a str.. 2017. 10. 4.
[Lucky Algorithm] Super Reduced String 이제 warmup 끝났으니 랜덤모드로 하려고 했는데.. 랜덤으로 풀기 누르니까 Expert 등급이 떠서... 목차별로 하나씩 풀기로 변경..ㅠㅠ Steve has a string, , consisting of lowercase English alphabetic letters. In one operation, he can delete any pair of adjacent letters with same value. For example, string "aabcc" would become either "aab" or "bcc" after operation.Steve wants to reduce as much as possible. To do this, he will repeat the above operat.. 2017. 10. 4.
[Lucky Algorithm] Time Conversion Given a time in -hour AM/PM format, convert it to military (-hour) time. Note: Midnight is on a -hour clock, and on a -hour clock. Noon is on a -hour clock, and on a -hour clock.Input FormatA single string containing a time in -hour clock format (i.e.: or ), where and .Output FormatConvert and print the given time in -hour format, where . import java.io.*; import java.util.*; import java.text.*;.. 2017. 10. 4.
[Lucky Algorithm] Birthday Cake Candles Colleen is turning years old! Therefore, she has candles of various heights on her cake, and candle has height . Because the taller candles tower over the shorter ones, Colleen can only blow out the tallest candles.Given the for each individual candle, find and print the number of candles she can successfully blow out.Input FormatThe first line contains a single integer, , denoting the number of.. 2017. 10. 3.
[Lucky Algorithm] Staircase Consider a staircase of size : # ## ### #### Observe that its base and height are both equal to , and the image is drawn using # symbols and spaces. The last line is not preceded by any spaces.Write a program that prints a staircase of size .Input FormatA single integer, , denoting the size of the staircase.Output FormatPrint a staircase of size using # symbols and spaces.Note: The last line mus.. 2017. 10. 3.
[Lucky Algorithm] Plus Minus Given an array of integers, calculate which fraction of its elements are positive, which fraction of its elements are negative, and which fraction of its elements are zeroes, respectively. Print the decimal value of each fraction on a new line.Note: This challenge introduces precision problems. The test cases are scaled to six decimal places, though answers with absolute error of up to are accep.. 2017. 10. 3.