소소한개발팁
반응형
article thumbnail
[완전 탐색] 2839번 설탕배달
알고리즘/백준 2023. 6. 8. 18:20

출처 : https://www.acmicpc.net/problem/2839 Problem Code package baek.bruteForce; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); sc.close(); // 3 , 5 int a = 3; int b = 5; int value = 0; if (N == 4 || N == 7) { value = -1; // 3 , 5로 나누어 떨어지지 않는 수 } else { int remainder = N % b; if (remainder == 0) { ..

article thumbnail
[완전탐색]1436번 영화감독
알고리즘/백준 2023. 6. 8. 17:50

출처 : https://www.acmicpc.net/problem/1436 Problem Code import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); sc.close(); int num = 666; int cnt = 1; while (cnt != N) { num++; if (String.valueOf(num).contains("666")) cnt++; } System.out.println(num); } } 순회하면서 666이 포함될때마다 카운트를 하도록 했습니다.

article thumbnail
[완전탐색]1018번 체스판 다시칠하기
알고리즘/백준 2023. 6. 7. 19:41

출처 : https://www.acmicpc.net/problem/1018 Problem Code import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws IOException { boolean[][] arr; 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.ne..

article thumbnail
[완전탐색]19352번 수학은 비대면강의입니다.
알고리즘/백준 2023. 6. 7. 16:50

출처 : https://www.acmicpc.net/problem/19352 Problem Code import java.io.*; import java.util.StringTokenizer; 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 x = 0, y = 0; int a = Integer.parseInt(st.nextToken()); int b = Intege..

article thumbnail
Firebase 등록 방법 정리
프레임워크/Flutter 2023. 6. 7. 15:31

프로젝트 추가 Flutter 에 Firebase 추가 Flutter Icon 클릭 Firebase CLI 클릭 OS 에 맞춰서 npm 으로 설치 진행 정상적으로 설치 완료된 모습이며 실행이 되지 않을 경우 Node를 다운로드 진행하거나 업데이트 진행 https://nodejs.org/en 설치 완료 후 firebase login 명령어를 실행하면 위와 같은 문구가 나오며 Y를 클릭 시 구글 로그인 페이지로 이동 이 후 2번째 단계 진행 첫번째 명령어 실행 시 화면 경로를 복사하여 시스템 변수의 Path에 추가 이 후 3번째 단계 진행 flutterfire config 명령어 시 생성할 OS 선택 ( SpaceBar로 선택가능) main 함수 수정 후 기능 확인

article thumbnail
[완전탐색]2231번 분해합
알고리즘/백준 2023. 6. 6. 22:38

출처 : https://www.acmicpc.net/problem/2231 Problem Code import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); sc.close(); int value = 0; for (int i = 0; i < N; i++) { int num = i; int sum = 0; while (num != 0) { sum += num % 10; // 각 자릿수 더하기 num /= 10; } if (sum + i == N) { value = i; break; } } System.out..

반응형