ALGORITHM ๐Ÿค–

์•Œ๊ณ ๋ฆฌ์ฆ˜ ์—ฐ์Šต / ์ฝ”๋”ฉํ…Œ์ŠคํŠธ ์ค€๋น„
https://school.programmers.co.kr/learn/courses/30/lessons/12928 class Solution { public int solution(int n) { int answer = 0; for(int i = 1; i
https://school.programmers.co.kr/learn/courses/30/lessons/120910 class Solution { public int solution(int n, int t) { int answer = n; for (int i = 1; i
https://school.programmers.co.kr/learn/courses/30/lessons/120903 class Solution { public int solution(String[] s1, String[] s2) { int answer = 0; for(int i = 0; i < s2.length; i++){ for(int j = 0; j < s1.length; j++){ if(s2[i].equals(s1[j])){ // ๋ฌธ์ž์—ด์ด ๊ฐ™์€์ง€ ๋น„๊ตํ•  ๋•Œ๋Š” .equals() ๋ฅผ ์‚ฌ์šฉ answer++; } } } return answer; } }
https://school.programmers.co.kr/learn/courses/30/lessons/120909 class Solution { public int solution(int n) { int answer = 0; for(int i = 1; i
https://school.programmers.co.kr/learn/courses/30/lessons/120836 class Solution { public int solution(int n) { int answer = 0; for(int i = 1; i
https://www.acmicpc.net/problem/11021 11021๋ฒˆ: A+B - 7 ๊ฐ ํ…Œ์ŠคํŠธ ์ผ€์ด์Šค๋งˆ๋‹ค "Case #x: "๋ฅผ ์ถœ๋ ฅํ•œ ๋‹ค์Œ, A+B๋ฅผ ์ถœ๋ ฅํ•œ๋‹ค. ํ…Œ์ŠคํŠธ ์ผ€์ด์Šค ๋ฒˆํ˜ธ๋Š” 1๋ถ€ํ„ฐ ์‹œ์ž‘ํ•œ๋‹ค. www.acmicpc.net import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); int[] arr = new int[t]; // t๋งŒํผ ๋ฐฐ์—ด์˜ ํฌ๊ธฐ๋ฅผ ์ง€์ • int i = 0; while (i < t) { // t๋งŒํผ ๋ฐ˜๋ณต int a = sc.nextInt(); int b = sc.next..
https://school.programmers.co.kr/learn/courses/30/lessons/120837 class Solution { public int solution(int hp) { int general = 0; int soldier = 0; int worker = 0; general = hp / 5; // ์žฅ๊ตฐ๊ฐœ๋ฏธ hp %= 5; soldier = hp / 3; // ๋ณ‘์ •๊ฐœ๋ฏธ hp %= 3; worker = hp; // ์ผ๊ฐœ๋ฏธ int answer = general + soldier + worker; // ์ตœ์†Œ ๋ณ‘๋ ฅ return answer; } }
daxx0ne
'ALGORITHM ๐Ÿค–' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๊ธ€ ๋ชฉ๋ก (12 Page)