목록Problem Solving (223)
Life Engineering
https://www.acmicpc.net/problem/19237 19237번: 어른 상어 첫 줄에는 N, M, k가 주어진다. (2 ≤ N ≤ 20, 2 ≤ M ≤ N2, 1 ≤ k ≤ 1,000) 그 다음 줄부터 N개의 줄에 걸쳐 격자의 모습이 주어진다. 0은 빈칸이고, 0이 아닌 수 x는 x번 상어가 들어있는 칸을 의미 www.acmicpc.net import java.util.Scanner; public class P19237 { static int N, M, k; static Info[][] board; static Shark[] sharks; static int[][][] priority; static Shark[] save; static int[] dr= {0,-1,1,0,0}; stati..
https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV14ABYKADACFAYh SW Expert Academy SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요! swexpertacademy.com import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class SW1210 { static int[] dr= {0,-1,0}; static int[] dc= {-1,0,1}; static int[][] ladder..
https://programmers.co.kr/learn/courses/30/lessons/92335# 코딩테스트 연습 - k진수에서 소수 개수 구하기 문제 설명 양의 정수 n이 주어집니다. 이 숫자를 k진수로 바꿨을 때, 변환된 수 안에 아래 조건에 맞는 소수(Prime number)가 몇 개인지 알아보려 합니다. 0P0처럼 소수 양쪽에 0이 있는 경우 P0처럼 소 programmers.co.kr class Solution { public int solution(int n, int k) { int answer = 0; String s=kJinsu(n,k); String num=""; for (int i=0; i0){ long in=Long.parseLong(num); if (isPrime(in)){ a..
https://programmers.co.kr/learn/courses/30/lessons/76502 코딩테스트 연습 - 괄호 회전하기 programmers.co.kr import java.util.Stack; class Solution { static char[] open={'[','(','{'}; static char[] close={']',')','}'}; public int solution(String s) { int answer = 0; String rotate=s; for (int i=0; i