PostAddsense


태그 : easy 요약보기전체보기목록닫기

1 2 3 4 5 6

ChristmasBatteries

Problem건전지를 넣어 동작하는 장난감이 있다. 장난감은 총 N개, 건전지는 총 N개다. 장난감 번호는 0에서 N-1이고, i번 장난감은 (i mod 5)개 건전지를 필요로 한다. i번 장난감이 주는 즐거움(fun)의 양은 ((X*i*i + Y*i + Z) mod M)이다. 건전지 N개를 사용해 즐거움을 극대화할 수 있는 장난감 개수를 찾고, 이 때...

GoldenChain

Problem다양한 길이의 금사슬을 연결해 목걸이를 만들어야 한다. 연결시키려면, 한 사슬의 끝쪽 고리의 일부를 절단하고 이를 다른 사슬의 끝 고리에 연결하면 된다. 고리를 절단하는 횟수를 최소화해서 목걸이를 만들어라.Constraintssections의 길이는 1이상 50이하다.sections의 요소는 1부터 2,147,483,647이하다.s...

RectangularGrid

Codepublic class RectangularGrid{    public long countRectangles(int width, int height) {        long res = 0;    &nbs...

Bonuses

Codepublic class Bonuses{    public int[] getDivision(int[] points) {        int len = points.length;      &...

ExerciseMachine

Codepublic class ExerciseMachine {    public int getPercentages(String time) {        int total = Integer.parseInt(time.substring(0, 2)) *...

ArithmeticSequenceDiv1

Codepublic class ArithmeticSequenceDiv1 {    public int findMinCost(int[] x) {        int n = x.length;      ...

TreasureHunt

Codepublic class TreasureHunt{        int xLen,yLen;    char[][] land;    String[] inst;    boolea...

RepeatedSubstrings

Codepublic class RepeatedSubstrings{    public String decompress(String compressed) {        String[] sp = compressed.split("\\s*[^0-9]+\\...

T9Input

Codeimport java.util.Arrays;import java.util.HashMap;import java.util.TreeSet;public class T9Input {    public String[] getKeypresses(String[] messages) {    ...

WordForm

Codepublic class WordForm {    // The problem name is Stemmer.    public String getSequence(String word) {        word = word.to...
1 2 3 4 5 6