Skip to content

Commit 82e4129

Browse files
committed
[Bronze V] Title: 코딩은 체육과목 입니다, Time: 128 ms, Memory: 14128 KB -BaekjoonHub
1 parent 1de4ff9 commit 82e4129

6 files changed

Lines changed: 56 additions & 0 deletions

File tree

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# [Bronze V] 코딩은 체육과목 입니다 - 25314
2+
3+
[문제 링크](https://www.acmicpc.net/problem/25314)
4+
5+
### 성능 요약
6+
7+
메모리: 14128 KB, 시간: 128 ms
8+
9+
### 분류
10+
11+
구현
12+
13+
### 제출 일자
14+
15+
2023년 2월 20일 21:43:51
16+
17+
### 문제 설명
18+
19+
<p style="margin-bottom: 15px;"><img alt="" src="" style="display: block; margin-left: auto; margin-right: auto; width: 100%; max-width: 400px;"></p>
20+
21+
<p>오늘은 혜아의 면접 날이다. 면접 준비를 열심히 해서 앞선 질문들을 잘 대답한 혜아는 이제 마지막으로 칠판에 직접 코딩하는 문제를 받았다. 혜아가 받은 문제는 두 수를 더하는 문제였다. C++ 책을 열심히 읽었던 혜아는 간단히 두 수를 더하는 코드를 칠판에 적었다. 코드를 본 면접관은 다음 질문을 했다. “만약, 입출력이 $N$바이트 크기의 정수라면 프로그램을 어떻게 구현해야 할까요?”</p>
22+
23+
<p>혜아는 책에 있는 정수 자료형과 관련된 내용을 기억해 냈다. 책에는 <span style="color:#e74c3c;"><code>long int</code></span>는 $4$바이트 정수까지 저장할 수 있는 정수 자료형이고 <span style="color:#e74c3c;"><code>long long int</code></span>는 $8$바이트 정수까지 저장할 수 있는 정수 자료형이라고 적혀 있었다. 혜아는 이런 생각이 들었다. “<span style="color:#e74c3c;"><code>int</code></span> 앞에 <span style="color:#e74c3c;"><code>long</code></span>을 하나씩 더 붙일 때마다 $4$바이트씩 저장할 수 있는 공간이 늘어나는 걸까? 분명 <span style="color:#e74c3c;"><code>long long long int</code></span>는 $12$바이트, <span style="color:#e74c3c;"><code>long long long long int</code></span>는 $16$바이트까지 저장할 수 있는 정수 자료형일 거야!” 그렇게 혜아는 당황하는 면접관의 얼굴을 뒤로한 채 칠판에 정수 자료형을 써 내려가기 시작했다.</p>
24+
25+
<p>혜아가 $N$바이트 정수까지 저장할 수 있다고 생각해서 칠판에 쓴 정수 자료형의 이름은 무엇일까?</p>
26+
27+
### 입력
28+
29+
<p>첫 번째 줄에는 문제의 정수 $N$이 주어진다. $(4\le N\le 1\, 000$; $N$은 $4$의 배수$)$</p>
30+
31+
### 출력
32+
33+
<p>혜아가 $N$바이트 정수까지 저장할 수 있다고 생각하는 정수 자료형의 이름을 출력하여라.</p>
34+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
4
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
20
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
long int
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
long long long long long int
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import java.io.*;
2+
import java.util.StringTokenizer;
3+
4+
public class Main {
5+
public static void main(String[] args) throws IOException {
6+
BufferedReader br =new BufferedReader(new InputStreamReader(System.in));
7+
int num = Integer.parseInt(br.readLine());
8+
9+
10+
for (int i = 0; i < num/4; i++) {
11+
System.out.print("long ");
12+
13+
}
14+
System.out.println("int");
15+
16+
}
17+
}
18+

0 commit comments

Comments
 (0)