| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | |||||
| 3 | 4 | 5 | 6 | 7 | 8 | 9 |
| 10 | 11 | 12 | 13 | 14 | 15 | 16 |
| 17 | 18 | 19 | 20 | 21 | 22 | 23 |
| 24 | 25 | 26 | 27 | 28 | 29 | 30 |
| 31 |
- db
- binary search
- 알고리즘
- 이분탐색
- 운동기록
- BFS
- 코딩테스트
- DP
- oracle
- SWEA
- priorityqueue
- math
- Java
- 문자열
- 문제해결
- 건강
- 러닝일지
- 투포인터
- greedy
- 시뮬레이션
- 문제풀이
- 프로그래머스
- COS PRO
- SQL
- 코테
- BOJ
- 자바
- dfs
- MySQL
- 백준
- Today
- Total
목록greedy (9)
슈콩
[문제]코딩테스트 연습 - 체육복 | 프로그래머스 스쿨 프로그래머스SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr [소스 코드]import java.util.*;class Solution { public int solution(int n, int[] lost, int[] reserve) { HashSet lost_hs = new HashSet(); HashSet reserve_hs = new HashSet(); for(int i : lost) lost_hs.add(i); for(int i : reserve) { if(lost_hs.contains..
[문제]https://www.acmicpc.net/problem/2170 [소스 코드]import java.io.*;import java.util.*;public class Main { static class Line{ int start,end; Line(int start,int end){ this.start = start; this.end = end; } } public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st; int n = Integer.pa..
[문제]https://www.acmicpc.net/problem/1744 [소스 코드]import java.io.*;import java.util.*;public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); PriorityQueue positive = new PriorityQueue((a,b)-> b.compareTo(a)); PriorityQueue negative = new Pr..
Set 사용: 기기의 종류가 적어서 속도 측면에서는 좀 느림! (but, 메모리 효율적) [문제]https://www.acmicpc.net/problem/1700 [소스 코드]import java.io.*;import java.util.*;public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()); int n = Integer.parseInt(st.nextToken..
[문제]https://www.acmicpc.net/problem/15903 [소스 코드]import java.io.*;import java.util.*;public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()); int n = Integer.parseInt(st.nextToken()); int m = Integer.parseInt(st.nextToken())..
[문제]https://www.acmicpc.net/problem/1541 [소스 코드]import java.io.*;import java.util.*;public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String s = br.readLine(); int num = 0; int sign = 1; int result = 0; for(int i=0;i
[문제]https://www.acmicpc.net/problem/1541 [소스 코드]import java.io.*;import java.util.*;public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String s = br.readLine(); int num = 0; int sign = 1; int result = 0; for(int i=0;i
[문제]https://www.acmicpc.net/problem/1439\ [소스 코드]import java.io.*;import java.util.*;public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String s = br.readLine(); int cnt = 0; for(int i=1;i
[문제]https://www.acmicpc.net/problem/11501 [소스 코드]import java.io.*;import java.util.*;public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st; int T = Integer.parseInt(br.readLine()); while(T-->0) { int n = Integer.parseInt(br.readLine()); int[] stock ..