Loading...

[백준] 13300번 방 배정 (java)

www.acmicpc.net/problem/13300 13300번: 방 배정 표준 입력으로 다음 정보가 주어진다. 첫 번째 줄에는 수학여행에 참가하는 학생 수를 나타내는 정수 N(1 ≤ N ≤ 1,000)과 한 방에 배정할 수 있는 최대 인원 수 K(1 < K ≤ 1,000)가 공백으로 분리되어 www.acmicpc.net import java.util.ArrayList; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int n=sc.nextInt(); int k=sc.nextInt(); int[] girls=new int[7]; in..

[백준] 2804번 크로스워드 만들기 (java)

www.acmicpc.net/problem/2804 2804번: 크로스워드 만들기 A의 길이를 N, B의 길이를 M이라고 했을 때, 출력은 총 M줄이고, 각 줄에는 N개 문자가 있어야 한다. 문제 설명에 나온 것 같이 두 단어가 교차된 형태로 출력되어야 한다. 나머지 글자는 '.'로 출력 www.acmicpc.net import java.util.Scanner; //2804번 public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); String a=sc.next(); String b=sc.next(); int n=0,m=0; for (int i = 0; i < a.length(); i++) ..

[백준] 2567번 색종이 -2 (java)

www.acmicpc.net/problem/2567 2567번: 색종이 - 2 가로, 세로의 크기가 각각 100인 정사각형 모양의 흰색 도화지가 있다. 이 도화지 위에 가로, 세로의 크기가 각각 10인 정사각형 모양의 검은색 색종이를 색종이의 변과 도화지의 변이 평행하도록 www.acmicpc.net import java.util.Scanner; public class Main { static int n; static int[][] map; static int[] xpos= {0,0,1,-1}; static int[] ypos= {1,-1,0,0}; public static void main(String[] args) { Scanner sc=new Scanner(System.in); n=sc.nextIn..

[백준 ] 10163번 색종이 (java)

import java.util.Scanner; public class Main { static int n; static int[][] map; public static void main(String[] args) { Scanner sc=new Scanner(System.in); n=sc.nextInt(); map=new int[101][101]; for (int k = 0; k = c; i--) { for (int j = r; j < r+width; j++..

[swexpert] 1234. 비밀번호 (java)

import java.util.ArrayList; import java.util.Scanner; public class Solution { static int t,n; public static void main(String[] args) { Scanner sc=new Scanner(System.in); int tc=1; String temp=""; while(tc!=11) { n=sc.nextInt(); String s=sc.next(); while(true) { boolean changed=false; for (int i = 0; i < s.length()-1; i++) { if(s.charAt(i)==s.charAt(i+1)) { String str=s.charAt(i)+""+s.charAt(i+1)..

[swexpert] 7272. 안경이 없어 (JAVA, D3)

import java.util.Scanner; public class Solution { static int t; static String a="CEFGHIJKLMNSTUVWXYZ"; static String b="ADOPQR"; public static void main(String[] args) { Scanner sc=new Scanner(System.in); t=sc.nextInt(); for (int tc = 1; tc

[swexpert] 프로세서 연결하기 (java, dfs, 백트래킹)

import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class Solution { static int t,n; static int[][] map; static List core; static boolean[][] vis; static int[] xpos= {1,-1,0,0}; static int[] ypos= {0,0,1,-1}; static int res; static int max_connect; public static void main(String[] args) { Scanner sc=new Scanner(System.in); t=sc.nextInt(); for (int tc = 1; tc res) ..

[swexpert] 2105. 디저트 카페 (java, 시뮬레이션, 모든 탐색)

좀 되는 대로 푼 시뮬 문제라서 다른 방법도 공부해야겠다 import java.util.Scanner; public class Solution { static int t,n; static int[][] map; static int [] xpos= {1,-1,-1,1}; static int [] ypos= {1,1,-1,-1}; static int ans; static boolean vis[]; static boolean vis_dir[]; static int sy,sx; public static void main(String[] args) { Scanner sc=new Scanner(System.in); t=sc.nextInt(); for (int tc = 1; tc

[React, NextJS] Module parse failed: Unexpected character '' (1:0) 에러 수정 및 Next에서 이미지 import 되도록 설정

오늘 기능 좀 만들어볼까 했더니 Module parse failed: Unexpected character '' (1:0) 에러가 떠서 몇 시간 동안 헤맸다. 기본적으로 nextjs의 최근 버전에서 import/export로 이미지를 불러오는 것을 지원하지 않는 것 같고 next-image라는 것을 따로 설치하여 설정을 해준다. 이에 따라 next-image 밑 next.config.js 설정을 해줘도 위의 에러는 사라지지 않았다. stackoverflow에서는 webpack 얘기가 등장하는데 다른 사람들은 안해줘도 되던데 나는 해줘야되나? 싶어서 다른 해결방법을 찾아봤는데 결론은.. 결국 webpack.config.js에서 file-loader 설정을 해줘야된다. (이 에러가 난 사람이라면 필수) 왜 ..

[React, Nextjs] nextjs 에 emotion 설치 (react cra 동일)

설치 설치 yarn add @emotion/react @emotion/styled yarn add --dev @emotion/babel-plugin .babelrc 파일 생성 및 내용 추가 { "presets": [ [ "next/babel", { "preset-react": { "runtime": "automatic", "importSource": "@emotion/react" } } ] ], "plugins": ["@emotion/babel-plugin"] } 글로벌 스타일 적용 및 스타일 적용 예제 style.js 파일 생성 (이름은 상관없음) import { css, Global, keyframes } from '@emotion/react' import styled from '@emotion/st..