This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class Main { | |
public static void main(String[] args) { | |
Scanner scn = new Scanner(System.in); | |
while(scn.hasNext()) { | |
int cnt = 0; | |
int n = scn.nextInt(); | |
for (int i = 0; i < 10; i++) { | |
for (int j = 0; j < 10; j++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class Main { | |
public static void main(String[] args) { | |
Scanner scn = new Scanner(System.in); | |
while(scn.hasNext()) { | |
int n = scn.nextInt(); | |
if (n == 1) { //n = 1のとき、素数の数は0 | |
System.out.println(0); | |
continue; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MillerRabinTest{ | |
public static boolean isPrime(int n, int k) { | |
if (n == 2) { | |
return true; | |
} | |
if (n == 1 || n % 2 == 0) { | |
return false; | |
} | |
int d = (n - 1) / 2; | |
int s = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class Main { | |
public static void main(String[] args) { | |
Scanner scn = new Scanner(System.in); | |
StringBuffer str = new StringBuffer(scn.next()); | |
System.out.println(str.reverse()); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
import java.text.DecimalFormat; | |
public class Main { | |
public static void main(String[] args) { | |
Scanner scn = new Scanner(System.in); | |
int n = scn.nextInt(); | |
for (int i = 0; i < n; i++) { | |
double x1 = scn.nextDouble(); | |
double y1 = scn.nextDouble(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class Main { | |
public static void main(String[] args) { | |
Scanner scn = new Scanner(System.in); | |
int w = scn.nextInt(); | |
int n = scn.nextInt(); | |
int[] ls = new int[w + 1]; | |
for (int i = 1; i <= w; i++) { | |
ls[i] = i; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class Main { | |
public static void main(String[] args) { | |
Scanner scn = new Scanner(System.in); | |
while (scn.hasNext()) { | |
double x1 = scn.nextDouble(); | |
double y1 = scn.nextDouble(); | |
double[] xarr = new double[3]; | |
double[] yarr = new double[3]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
import java.util.Stack; | |
public class Main { | |
public static void main(String[] args) { | |
Scanner scn = new Scanner(System.in); | |
Stack<Integer> stack = new Stack<Integer>(); | |
while (scn.hasNext()) { | |
int n = scn.nextInt(); | |
if (n == 0) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class Main { | |
public static void main(String[] args) { | |
Scanner scn = new Scanner(System.in); | |
while (scn.hasNext()) { | |
int d = scn.nextInt(); | |
int n = 600 / d; | |
int area = 0; | |
for (int i = 1; i < n; i++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
import java.math.BigDecimal; | |
public class Main { | |
public static void main(String[] args) { | |
Scanner scn = new Scanner(System.in); | |
int n = scn.nextInt(); | |
for(int i = 0; i < n; i++) { | |
BigDecimal a = new BigDecimal(scn.next()); | |
BigDecimal b = new BigDecimal(scn.next()); |