반응형
SMALL

언어 114

19532번 수학은 비대면강의입니다.

솔직히 제목부터 맘에안듬 수학을 못하기 때문 혼자 해결하지는 못하고 gpt힘을 빌림 크라메르 공식..? 첨들어봄 크레마는 들어봄 행렬식(det) 계산: int det = a * e - b * d; ​ Cramer의 규칙을 사용하여 x와 y 계산: int x = (c * e - b * f) / def; int y = (a * f - c * d) / def; import java.util.*; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); int c = sc.nextInt(); int d = sc.nextInt();..

JAVA/JAVA baekjoon 2023.09.01

24267번 알고리즘 수업0(n3)

import java.util.*; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); Long n = sc.nextLong(); System.out.println((n-2)*(n-1)*n/6); System.out.println("3"); } } 참고 https://rightbellboy.tistory.com/206 [백준/BOJ] 24267번 알고리즘 수업 - 알고리즘의 수행 시간 6 (C/C++) 백준 온라인 저지(BOJ) 24267번 알고리즘 수업 - 알고리즘의 수행 시간 6 https://www.acmicpc.net/problem/24267 24267번: 알고리즘 수업 - 알고리즘의 수..

JAVA/JAVA baekjoon 2023.09.01

24265번 알고리즘 수행 시간 0(n2)

MenOfPassion(A[], n) { sum 3 6 7 -> 2 7 -> 1 ​ 즉 7 입력 시 7-1의 합이 나옴 ​ 6+5+4+3+2+1 = 21 7(7-1)/2 = 21 ​ 즉 n(n-1)/2 ​ import java.util.*; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); Long a = sc.nextLong(); System.out.println(a*(a-1)/2); System.out.println("2"); } } https://mathbang.net/609#gsc.tab=0 등차수열의 합, 등차수열의 합 공식 이번 글에서는 등차수열의 각 항을 더한 등차수열의 합을 구할..

JAVA/JAVA baekjoon 2023.09.01
반응형
LIST