MapleStory Cookie With Halo

๐Ÿ•ธ Algorithm 84

[๋ฐฑ์ค€][java][25304][์˜์ˆ˜์ฆ]

import java.util.Scanner; // 25304์˜์ˆ˜์ฆ public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int sum = sc.nextInt(); int num = sc.nextInt(); int itemPrice = 0; for (int i=0; i < num; i++) { int price = sc.nextInt(); int item = sc.nextInt(); itemPrice += price*item; } sc.close(); System.out.print(sum == itemPrice ? "Yes" : "No"); } }

[๋ฐฑ์ค€][java][10950][A+B - 3]

import java.util.Scanner; // 10950A+B - 3 public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int num = sc.nextInt(); int[] times = new int[num]; int[] sum = new int[num]; for (int i=0; i < times.length; i++) { sum[i] += sc.nextInt(); sum[i] += sc.nextInt(); } sc.close(); for (int s : sum) System.out.println(s); } } ์ž…๋ ฅ์กฐ๊ฑด์˜ ํ…Œ์ŠคํŠธ์ผ€์ด์Šค ๊ฐฏ์ˆ˜๋ฅผ ๋จผ์ € ์ž…๋ ฅํ•œ๋‹ค๋Š” ์  ์ฃผ์˜ int..

[๋ฐฑ์ค€][java][2480][์ฃผ์‚ฌ์œ„ ์„ธ๊ฐœ]

import java.util.Scanner; // 2480์ฃผ์‚ฌ์œ„ ์„ธ๊ฐœ public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int reward = 0; int max = 0; int a = sc.nextInt(); int b = sc.nextInt(); int c = sc.nextInt(); sc.close(); if (a == b) { if (b == c) reward = 1; else reward = 2; max = a; } else if (a == c) { if (c == b) reward = 1; else reward = 2; max = a; } else if (b == c)..

[๋ฐฑ์ค€][java][2525][์˜ค๋ธ ์‹œ๊ณ„]

import java.util.Scanner; public class Main { public static void main(String[] agrs) { Scanner sc = new Scanner(System.in); int hour = sc.nextInt(); int min = sc.nextInt(); int time = sc.nextInt(); int total = hour*60 + min + time; int printHour = total / 60; int printMin = total % 60; if (printHour >= 24) printHour -= 24; System.out.printf("%d %d", printHour, printMin); } } ์ž…๋ ฅ๋œ ์‹œ hour * 60๋ถ„ + ์ž…..

[๋ฐฑ์ค€][java][2884][์•Œ๋žŒ ์‹œ๊ณ„]

import java.util.Scanner; // 2884์•Œ๋žŒ ์‹œ๊ณ„ public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int hour = sc.nextInt(); int min = sc.nextInt(); sc.close(); if (45 > min) { hour--; min = 60 - (45-min); } else min -= 45; if (0 > hour) hour += 24; System.out.printf("%d %d", hour, min); } } ์ž…๋ ฅ๋œ ๋ถ„์ด 45๋ถ„๋ณด๋‹ค ์ ์„ ๊ฒฝ์šฐ์—๋งŒ ์‹œhour๊ฐ€ --; ๋œ๋‹ค๋Š” ๊ฒƒ 60๋ถ„์—์„œ (45๋ถ„ - ์ž…๋ ฅ๋œ ๋ถ„min)์ด ์ค„์–ด๋“  ๋‹ค๋Š”..

[๋ฐฑ์ค€][java][14681][์‚ฌ๋ถ„๋ฉด ๊ณ ๋ฅด๊ธฐ]

import java.util.Scanner; // 14681์‚ฌ๋ถ„๋ฉด ๊ณ ๋ฅด๊ธฐ public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int result = 0; int firstInput = sc.nextInt(); int secondInput = sc.nextInt(); sc.close(); if (firstInput > 0 && secondInput > 0) result = 1; else if (firstInput 0) result = 2; else if (firstInput < 0 && secondInput < 0) result = 3; else..

[๋ฐฑ์ค€][java][2753][์œค๋…„]

import java.util.Scanner; // 2753์œค๋…„ public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int year = sc.nextInt(); System.out.print(year%4 == 0 && (year%100 != 0 || year%400 == 0) ? 1 : 0); } } java์—์„œ % ํผ์„ผํŠธ ๊ธฐํ˜ธ๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ๊ฐ’์˜ ๋‚˜๋จธ์ง€๋ฅผ ๊ตฌํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. 4 ์˜ ๋ฐฐ์ˆ˜๋ผ๋ฉด 20 % 4๋ฅผ ํ–ˆ์„ ๊ฒฝ์šฐ 0์ด ๋‚จ๊ณ , 21 % 4๋ฅผํ•˜๋ฉด 1์ด ๋‚จ์Šต๋‹ˆ๋‹ค. ๋”ฐ๋ผ์„œ ๋ฐฐ์ˆ˜๋ฅผ ๊ตฌํ•˜๋ ค๋ฉด ๋‚˜๋จธ์ง€๊ฐ€ 0์ธ์ง€ ์•„๋‹Œ ์ง€๋งŒ ํ™•์ธํ•˜๋ฉด ๋ฉ๋‹ˆ๋‹ค.

[๋ฐฑ์ค€][java][9498][์‹œํ—˜ ์„ฑ์ ]

import java.util.Scanner; // 9498์‹œํ—˜ ์„ฑ์  public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int score = sc.nextInt(); String result = ""; sc.close(); switch (score / 10) { case 10: case 9 : result = "A"; break; case 8 : result = "B"; break; case 7 : result = "C"; break; case 6 : result = "D"; break; default: result = "F"; break; } System.out.println(r..

๋ฐ˜์‘ํ˜•