This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.*; | |
| public class Main { | |
| static int N, M; | |
| static int []num; | |
| static boolean []visited; | |
| static StringBuilder sb = new StringBuilder(); | |
| public static void main(String[] args) { | |
| Scanner sc = new Scanner(System.in); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.*; | |
| public class Main { | |
| public static void main(String[] args) { | |
| Scanner sc = new Scanner(System.in); | |
| int N = sc.nextInt(); // ์ข ๋ฅ | |
| int K = sc.nextInt(); // ๋ง์ถ๋ ค๋ ๊ฐ | |
| int []coin = new int[N]; | |
| int sum=0; // ํ์ํ ๋์ ๊ฐ์์ ํฉ (๋ต) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public int[] solution(int[] heights) { | |
| int []answer = new int[heights.length]; // ์ด๊ธฐํ, int๋ ๊ธฐ๋ณธ๊ฐ 0 | |
| for(int i=heights.length-1; i>=0; i--){ // ๋งจ ๋ค ์์๋ถํฐ ํ์ธํฉ๋๋ค. | |
| int tower = heights[i]; // ๋งจ ๋ค ์์ ๋ฃ๊ธฐ | |
| for(int j=i-1; j>=0 ;j--){ // ๋งจ ๋ค ์์์ ๋ฐ๋ก ์ ์์๋ถํฐ ๋งจ ์ ์์๊น์ง ํ์ธํฉ๋๋ค. | |
| if (tower < heights[j]) { // ์์ ์์์ค ๋งจ ๋ค ์์๋ณด๋ค ํฐ ๊ฒ ์์ผ๋ฉด ์ฒดํฌ | |
| answer[i] = j+1; // 1๋ถํฐ ์ธ๊ธฐ ๋๋ฌธ์ ์ธ๋ฑ์ค + 1 | |
| break; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.*; | |
| public class Main { | |
| public static void main(String args[]) { | |
| Scanner sc = new Scanner(System.in); | |
| while (true) { | |
| int num1 = sc.nextInt(); | |
| int num2 = sc.nextInt(); | |
| if (num1+num2==0) break; // ๋ ์ ๋ ฅ๊ฐ์ด 0์ด๋ฉด ์ข ๋ฃ | |
| if (num2 % num1 == 0) { // ์ฝ์๋ผ๋ฉด |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const mysql = require('mysql'); | |
| var mysqlConnection = mysql.createConnection({ | |
| host : '13.124.119.246', | |
| user : 'root', | |
| password : 'root', | |
| database : 'USER', | |
| port : '56891' | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const mysql = require('mysql'); | |
| const express = require('express'); | |
| var app = express(); | |
| const bodyparser = require('body-parser'); | |
| app.use(bodyparser.json()); | |
| var mysqlConnection = mysql.createConnection({ | |
| host : '13.124.119.246', | |
| user : 'root', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.*; | |
| public class Main { | |
| public static void main(String args[]) { | |
| Scanner sc = new Scanner(System.in); | |
| int N = sc.nextInt(); | |
| int [][]schedule = new int[N][2]; // ํ์์ค์ ์์ ๋ํ ์์์๊ฐ๊ณผ ๋๋๋ ์๊ฐ | |
| for(int i=0; i<N; i++){ | |
| schedule[i][0] = sc.nextInt(); // ์์์๊ฐ | |
| schedule[i][1] = sc.nextInt(); // ๋๋๋ ์๊ฐ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.*; | |
| public class Main { | |
| public static void main(String args[]) { | |
| Scanner sc = new Scanner(System.in); | |
| int N = sc.nextInt(); | |
| int []person = new int[N]; | |
| for(int i=0; i<N; i++) | |
| person[i] = sc.nextInt(); | |
| sc.close(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.*; | |
| public class Main { | |
| public static void main(String args[]) { | |
| Scanner sc = new Scanner(System.in); | |
| String exp = sc.next(); | |
| sc.close(); | |
| String []str = exp.split("-"); // '-' ๊ธฐํธ ๊ธฐ์ค์ผ๋ก ๋ฐฐ์ด์ ๋ด๊ธฐ | |
| // ์ฒ์ '-'์ ๊น์ง ๋ชจ๋ ๋ํ๊ธฐ | |
| String []tmp = str[0].split("\\+"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.*; | |
| class Solution { | |
| public int[] solution(int[] progresses, int[] speeds) { | |
| ArrayList<Integer> period = new ArrayList<>(); // ๊ฐ ์์ ๋ง๋ค ๊ฑธ๋ฆฌ๋ ๊ธฐ๊ฐ | |
| ArrayList<Integer> result = new ArrayList<>(); // ๊ฒฐ๊ณผ ๊ฐ | |
| for(int i=0; i<speeds.length; i++){ | |
| double restProgress = 100-progresses[i]; | |
| period.add((int)(Math.ceil(restProgress/speeds[i]))); //๊ฐ ์์ ์ ๋ํ ๋ฐฐํฌ๊ฐ๋ฅํ ๋ ์ง | |
| // [7, 3, 9] |