File tree Expand file tree Collapse file tree 4 files changed +48
-0
lines changed Expand file tree Collapse file tree 4 files changed +48
-0
lines changed Original file line number Diff line number Diff line change 204
204
| 01 | | [ Baekjoon-1717 μ§ν©μ νν] ( ./src/Graph/P1717 ) | [ Disjoint Set] ( ./notes/Graph/DisjointSet.md ) |
205
205
| 02 | | [ Baekjoon-2252 μ€ μΈμ°κΈ°] ( ./src/Graph/P2252 ) | [ μμμ λ ¬] ( ./notes/Graph/TopologicalSort.md ) |
206
206
207
+ ## Math
208
+
209
+ | # | β | Problem | Note |
210
+ | :-: | :-: | :--------------------------------------------- | :----- |
211
+ | 01 | | [ Baekjoon-13458 μν κ°λ
] ( ./src/Math/P13458 ) | |
212
+
207
213
## Number Theory
208
214
209
215
### GCD
Original file line number Diff line number Diff line change
1
+ package Math .P13458 ;
2
+
3
+ import java .io .*;
4
+ import java .util .StringTokenizer ;
5
+
6
+ public class Main {
7
+
8
+ static int N , B , C ;
9
+ static int [] A ;
10
+
11
+ public static void main (String [] args ) throws Exception {
12
+ System .setIn (new FileInputStream ("src/Math/P13458/input.txt" ));
13
+ BufferedReader br = new BufferedReader (new InputStreamReader (System .in ));
14
+
15
+ N = Integer .parseInt (br .readLine ());
16
+ A = new int [N ];
17
+
18
+ StringTokenizer st = new StringTokenizer (br .readLine ());
19
+ for (int i = 0 ; i < N ; i ++) A [i ] = Integer .parseInt (st .nextToken ());
20
+
21
+ st = new StringTokenizer (br .readLine ());
22
+ B = Integer .parseInt (st .nextToken ());
23
+ C = Integer .parseInt (st .nextToken ());
24
+
25
+ long sum = N ;
26
+ for (int i = 0 ; i < N ; i ++) sum += A [i ] - B > 0 ? Math .ceil ((double )(A [i ] - B ) / C ) : 0 ;
27
+ System .out .println (sum );
28
+ }
29
+ }
Original file line number Diff line number Diff line change
1
+ ## [ baekjoon-13458] μν κ°λ
2
+
3
+ ![ image] ( https://user-images.githubusercontent.com/22045163/107942623-d73d5880-6fce-11eb-9800-bde8a37b040f.png )
4
+
5
+ ### μ£Όμν΄μΌ ν μ
6
+
7
+ - λ¬Έμ μ λ²μλ₯Ό κ³ λ €νμ λ μ΄ κ°λ
κ΄ μλ₯Ό λ΄μ λ³μμ μλ£νμ ` long ` μ΄μ΄μΌ νλ€.
8
+ - ` A[i] - B ` μ κ°μ΄ μμμΌ κ²½μ° λλμ
μ νμ λ μμκ°μ΄ λμ¬ μ μμΌλ―λ‘ ν΄λΉ κ°μ΄ 0μ λμ λλ§ κ³μ°νλλ‘ μ‘°κ±΄μ μΆκ°ν΄μ£Όμ΄μΌ νλ€.
9
+
10
+ ![ image] ( https://user-images.githubusercontent.com/22045163/107942648-e3291a80-6fce-11eb-91e5-5a4deb939c0d.png )
Original file line number Diff line number Diff line change
1
+ 1
2
+ 1
3
+ 50 2
You canβt perform that action at this time.
0 commit comments