| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
- 건강
- COS PRO
- db
- Java
- 알고리즘
- 이분탐색
- SWEA
- oracle
- 문자열
- math
- 운동기록
- 백준
- 코딩테스트
- 코테
- MySQL
- 시뮬레이션
- greedy
- 투포인터
- BFS
- 문제해결
- binary search
- dfs
- 프로그래머스
- BOJ
- SQL
- priorityqueue
- 문제풀이
- 자바
- 러닝일지
- DP
- Today
- Total
목록Java (469)
슈콩
[소스 코드]class Main { public int solution(String pos) { int answer = 0; int row = pos.charAt(1) - '0'; int col = pos.charAt(0) - 'A' + 1; int[][] dirs = { {2,1},{1,2}, {2,-1},{1,-2}, {-1,2},{-2,1}, {-2,-1},{-1,-2} }; for(int[] d : dirs){ int nr = row + d[0]; int nc = col + d[1]; if(nr8 || nc8) continue; answer++; } return answer; ..
[소스 코드]class Main { public int[] solution(int N, int[] votes) { [[(guide-anchor):(한줄을 수정하시오)]] int voteCounter[] = new int[11]; for (int i = 0; i
[문제]https://www.acmicpc.net/problem/17779 [소스 코드]import java.io.*;import java.util.*;public class Main { static int n,result,total = 0; static int[][] map; public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st; n = Integer.parseInt(br.readLine()); map = new int[n][n]; for(int i=0;i=n) continue;..
[소스 코드]class Main { public int solution(int n) { int[][] map = new int[n][n]; int num = 1; int top = 0; int bottom = n-1; int max = n-1; int min = 0; int answer = 0; while(num=min;i--) map[i][bottom] = num++; bottom--; for(int i=bottom;i>=top;i--) map[min][i] = num++; min++; } for(int i=0;i
[문제]https://www.acmicpc.net/problem/17142 [소스 코드]import java.io.*;import java.util.*;public class Main { static int n,m,result = Integer.MAX_VALUE; static int[][] lab,copy; static boolean[] select; static List virus; static int[] dr = {-1,1,0,0}; static int[] dc = {0,0,-1,1}; public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(..
[문제]https://www.acmicpc.net/problem/17140 [소스 코드]import java.io.*;import java.util.*;public class Main { static int n,m; static int[][] map; public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()); int r = Integer.parseInt(st.nextToken()); int c = Integer.parse..
[문제]https://www.acmicpc.net/problem/17143 [소스 코드]import java.io.*;import java.util.*;public class Main { static class Shark{ int r,c,s,d,z; Shark(int r,int c,int s,int d,int z){ this.r = r; this.c = c; this.s = s; this.d = d; this.z = z; } } static int[] dr = {-1,0,1,0}; static int[] dc = {0,-1,0,1}; public static void main(String[] args) throws Exception { BufferedReader br = new..
[문제]https://www.acmicpc.net/problem/17144 [소스 코드]import java.io.*;import java.util.*;public class Main { static int r,c; static int[][] map,add; static int[] dr = {-1,1,0,0}; static int[] dc = {0,0,-1,1}; public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()); ..
[문제]https://www.acmicpc.net/problem/16236 [소스 코드]import java.io.*;import java.util.*;public class Main { static int[] dr = {-1,1,0,0}; static int[] dc = {0,0,-1,1}; public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st; int n = Integer.parseInt(br.readLine()); int[][] map = new int[n][n]; int s..
[문제]https://www.acmicpc.net/problem/16235 [소스 코드]import java.io.*;import java.util.*;public class Main { static class Tree { int r,c,age; Tree(int r,int c,int age){ this.r = r; this.c = c; this.age = age; } } static int[] dr = {-1,-1,0,1,1,1,0,-1}; static int[] dc = {0,1,1,1,0,-1,-1,-1}; public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(n..