Skip to content

Commit ea227fe

Browse files
committed
[D1] Title: N줄덧셈, Time: 82 ms, Memory: 22,528 KB -BaekjoonHub
1 parent 8454c45 commit ea227fe

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import java.io.*;
2+
3+
class Solution
4+
{
5+
public static void main(String args[]) throws Exception
6+
{
7+
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
8+
int n = Integer.parseInt(br.readLine());
9+
10+
if(n==0) System.out.println("0");
11+
else if(n%2==0) System.out.println((n/2) * (n+1));
12+
else System.out.println((n/2)*(n+1)+(n/2+1));
13+
}
14+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# [D1] N줄덧셈 - 2025
2+
3+
[문제 링크](https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5QFZtaAscDFAUq)
4+
5+
### 성능 요약
6+
7+
메모리: 22,528 KB, 시간: 82 ms, 코드길이: 395 Bytes
8+
9+
### 제출 일자
10+
11+
2025-09-24 16:38
12+
13+
14+
15+
> 출처: SW Expert Academy, https://swexpertacademy.com/main/code/problem/problemList.do

0 commit comments

Comments
 (0)