본문 바로가기
BaekJoon/Bronze

[BOJ/JAVA] 백준 3765 : Celebrity jeopardy (자바)

by HoonSikE 2023. 7. 8.
반응형
SMALL
문제 정보
  문제명   - Celebrity jeopardy
  난이도   - 브론즈 IV
문제 번호 - 3765번

문제 링크

https://www.acmicpc.net/problem/3765

 

3765번: Celebrity jeopardy

It’s hard to construct a problem that’s so easy that everyone will get it, yet still difficult enough to be worthy of some respect. Usually, we err on one side or the other. How simple can a problem really be? Here, as in Celebrity Jepoardy, questions

www.acmicpc.net


문제
It’s hard to construct a problem that’s so easy that everyone will get it, yet still difficult enough to be worthy of some respect. Usually, we err on one side or the other. How simple can a problem really be?
Here, as in Celebrity Jepoardy, questions and answers are a bit confused, and, because the participants are celebrities, there’s a real need to make the challenges simple. Your program needs to prepare a question to be solved --- an equation to be solved --- given the answer. Specifically, you have to write a program which finds the simplest possible equation to be solved given the answer, considering all possible equations using the standard mathematical symbols in the usual manner. In this context, simplest can be defined unambiguously several different ways leading to the same path of resolution. For now, find the equation whose transformation into the desired answer requires the least effort.
For example, given the answer X = 2, you might create the equation 9 – X = 7. Alternately, you could build the system X > 0; X^2 = 4. These may not be the simplest possible equations. Solving these mind-scratchers might be hard for a celebrity.

입력
Each input line contains a solution in the form =

출력
For each input line, print the simplest system of equations which would to lead to the provided solution, respecting the use of space exactly as in the input.

예제 입력/출력
예제 입력 예제 출력
2 3

알고리즘 분류
● 구현
● 문자열
● 애드 훅


소스코드
package Lv1_Bronze;

import java.io.*;

/**
 * @author HanHoon
 * @category 구현, 문자열, 애드 훅
 * https://www.acmicpc.net/problem/3765
 */
public class BOJ_B4_3765_Celebrity_jeopardy {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder str = new StringBuilder();

        while(true){
            String s = br.readLine();
            if(s == null || s.equals(""))
                break;
            str.append(s).append("\n");
        }

        System.out.print(str);
        br.close();
    }
}

 


BaekJoon List
 

BaekJoon List

BOJ Start!! ● [BOJ] 백준 회원가입, 시작하는 법 ● [BOJ] 등급(티어) 및 Solved.AC 적용 ● [BOJ/JAVA] 백준 소스코드 제출 시 유의사항(자바) Bronze ● Bronze V  - ● Bronze IV  - ● Bronze III  -..

han-hoon.tistory.com


  

기회는 준비된 자에게 찾아온다.

 


 

반응형
LIST

댓글