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] |