Skip to content

Instantly share code, notes, and snippets.

@BrendenHJH
BrendenHJH / B_2935.java
Created May 20, 2018 06:06
백준 2935 소음
import java.math.BigInteger;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
BigInteger n = new BigInteger(sc.nextLine());
char c = sc.nextLine().charAt(0);
BigInteger m = new BigInteger(sc.nextLine());
@BrendenHJH
BrendenHJH / B_8979.java
Created May 18, 2018 06:53
백준 8979 올림픽
import java.util.Arrays;
import java.util.Scanner;
class Nation implements Comparable<Nation>{
int nationNum;
int gold;
int silver;
int bronze;
int rank;
@BrendenHJH
BrendenHJH / B_10984.java
Created May 17, 2018 08:23
백준 10984 내 학점을 구해줘
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
while(n-- > 0) {
int m = sc.nextInt();
int gradeSum = 0;
@BrendenHJH
BrendenHJH / B_4673.java
Last active May 10, 2018 05:43
백준 4673 셀프 넘버
public class Main {
public static final int MAX = 10001;
public static int getNum(int x) {
int sum = x;
while(x >= 10) {
sum += x%10;
x /= 10;
}
sum += x;
return sum;
@BrendenHJH
BrendenHJH / B_6588.java
Created May 10, 2018 03:35
백준 6588 골드바흐의 추측
import java.util.Scanner;
public class Main {
public static final int MAX = 1000000;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
boolean[] isPrime = new boolean[MAX+1];
for(int i = 2; i <= MAX; i++) {
isPrime[i] = true;
@BrendenHJH
BrendenHJH / B_4948.java
Created May 10, 2018 02:32
백준 4948 베르트랑 공준
import java.util.Scanner;
public class Main {
public static final int MAX = 1000000;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
boolean[] isPrime = new boolean[MAX+1];
for(int i = 2; i <= MAX; i++) {
isPrime[i] = true;
@BrendenHJH
BrendenHJH / B_1978.java
Created May 10, 2018 02:12
백준 1978 소수 찾기
import java.util.Scanner;
public class Main {
public static final int MAX = 1001;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
boolean[] isPrime = new boolean[MAX];
for(int i = 2; i < MAX; i++) {
isPrime[i] = true;
@BrendenHJH
BrendenHJH / B_2960.java
Created May 9, 2018 07:13
백준 2960 에라토스네스의 체
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int k = sc.nextInt();
boolean[] isPrime = new boolean[n+1];
for(int i = 2; i <= n; i++) {
@BrendenHJH
BrendenHJH / Eratosthenes.java
Created May 9, 2018 06:25
에라토스테네스의 체(Sieve of Eratosthenes)
import java.util.ArrayList;
public class Main {
public static final int MAX = 25;
public static void main(String[] args) {
ArrayList<Integer> primeList = new ArrayList<Integer>();
boolean isPrime[] = new boolean[MAX + 1];
for(int i = 2; i <= MAX; i++) {
@BrendenHJH
BrendenHJH / B_2563.java
Created May 8, 2018 11:34
백준 2563 색종이
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[][] map = new int[100][100];
int cnt = 0;
for(int i = 0; i < n; i++) {