본문 바로가기

Programming62

[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.
[Lucky Algorithm] Diagonal Difference Given a square matrix of size , calculate the absolute difference between the sums of its diagonals.Input FormatThe first line contains a single integer, . The next lines denote the matrix's rows, with each line containing space-separated integers describing the columns.ConstraintsOutput FormatPrint the absolute difference between the two sums of the matrix's diagonals as a single integer. impor.. 2017. 10. 3.
[Lucky Algorithm] A Very Big Sum You are given an array of integers of size . You need to print the sum of the elements in the array, keeping in mind that some of those integers may be quite large.Input FormatThe first line of the input consists of an integer . The next line contains space-separated integers contained in the array.Output FormatPrint a single value equal to the sum of the elements in the array.Constraints import.. 2017. 10. 3.
[Lucky Algorithm] Compare the Triplets Alice and Bob each created one problem for HackerRank. A reviewer rates the two challenges, awarding points on a scale from to for three categories: problem clarity, originality, and difficulty.We define the rating for Alice's challenge to be the triplet , and the rating for Bob's challenge to be the triplet .Your task is to find their comparison points by comparing with , with , and with .If , .. 2017. 10. 3.
[Lucky Algorithm] Simple Array Sum Given an array of integers, can you find the sum of its elements?Input FormatThe first line contains an integer, , denoting the size of the array. The second line contains space-separated integers representing the array's elements.Output FormatPrint the sum of the array's elements as a single integer.import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.r.. 2017. 10. 3.