반응형
반응형
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; import java.util.StringTokenizer; public class Main { public void solution() throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringBuilder sb = new StringBuilder(); Boolean[] booleans = new Boolean[1001]; Arrays.fill(booleans, false)..
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; public class Main { public void solution() throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringBuilder sb = new StringBuilder(); long[] numArray = new long[1000001]; Arrays.fill(numArray,1); for(int i = 2; i
import java.io.IOException; import java.io.InputStreamReader; import java.io.BufferedReader; import java.util.Arrays; import java.util.StringTokenizer; public class Main { public void solution() throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()); int a = Integer.parseInt(st.nextToken()); int b = I..
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public void solution() throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int num = Integer.parseInt(br.readLine()); sumOfDivisor(num); } public void sumOfDivisor(int n){ long result = 0; for(int i = 1; i
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; import java.util.StringTokenizer; public class Main { public void solution() throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int count = Integer.parseInt(br.readLine()); StringTokenizer st = new StringTokenizer(br.readLine()); int[] ..
import java.util.Scanner; public class Main { public void solution(){ Scanner sc = new Scanner(System.in); while(sc.hasNextInt()){ int num = sc.nextInt(); int checkNumber = 0; int count = 0; while(true){ checkNumber = (checkNumber*10+1)%num; if(checkNumber==0){ count++; System.out.println(count); break; } count++; } } } public static void main(String[] args){ new Main().solution(); } } 처음엔 아래와 같..