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 Solution { | |
public static void main(String[] args) { | |
try (Scanner in = new Scanner(System.in)) { | |
int t = in.nextInt(); | |
for(int a0 = 0; a0 < t; a0++){ | |
int n = in.nextInt(); | |
int max_value = -1; |
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.*; | |
public class Solution { | |
public static void main(String[] args) { | |
//このプログラムは、事前計算した後に、入力値で表示させる機能を採用しています。 | |
boolean arr[] = new boolean[1000000 + 1]; | |
for(int i = 2; i <= 1000000; i++){ | |
arr[i] = true; | |
} |
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 Solution { | |
public static void main(String[] args) { | |
int[][] grid = new int[20][20]; | |
int[] x = {0, 0, 0, 1, 2, 3, 1, 2, 3, 1, 2, 3}; | |
int[] y = {1, 2, 3, 1, 2, 3, 0, 0, 0, -1, -2, -3}; | |
try (Scanner in = new Scanner(System.in)) { | |
for(int grid_i = 0; grid_i < 20; grid_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.*; | |
public class Solution { | |
static int factor(int a) { | |
int count = 0; | |
if(a == 1) { | |
return 1; | |
} | |
for(int i = 1; i < Math.ceil(Math.sqrt(a)); 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.math.BigInteger; | |
import java.util.Scanner; | |
public class Solution { | |
public static void main(String[] args) { | |
BigInteger bi = new BigInteger("0"); | |
try (Scanner sc = new Scanner(System.in)) { | |
int N = sc.nextInt(); | |
for(int i = 0; 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.*; | |
public class Solution { | |
public static int cnt = 0; | |
public static void main(String[] args) { | |
Scanner sc = new Scanner(System.in); | |
List<Integer> s = getMayors(5000000); | |
int T = sc.nextInt(); | |
for(int i = 0; i < T; 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
public class Solution { | |
public static void main(String[] args) { | |
long mod = 1000000007; | |
try (Scanner sc = new Scanner(System.in)) { | |
int T = sc.nextInt(); | |
for(int i = 0; i < T; i++) { | |
int N = sc.nextInt(); | |
int M = sc.nextInt(); | |
N++; |
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.math.BigInteger; | |
import java.util.*; | |
public class Solution { | |
static int getValue(String data) { | |
int res = 0; | |
for(int i = 0; i < data.length(); i++) { | |
res += Integer.parseInt(data.substring(i, i + 1)); | |
} | |
return res; |
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.*; | |
public class Solution { | |
private static final String[] FDigitsData = {"", "One ", "Two ", "Three ", "Four ", "Five ", "Six ", "Seven ", "Eight ", "Nine "}; | |
private static final String[] SDigitsData = {"Ten ", "Eleven ", "Twelve ", "Thirteen ", "Fourteen ", "Fifteen ", "Sixteen ", "Seventeen ", "Eighteen ", "Nineteen "}; | |
private static final String[] TensData = {"", "", "Twenty ", "Thirty ", "Forty ", "Fifty ", "Sixty ", "Seventy ", "Eighty ", "Ninety "}; | |
private static final String[] THData = {"", "Thousand ", "Million ", "Billion ", "Trillion "}; | |
static void printNumber(int ThirdDigitData, int SecondDigitData, int FirstDigitData, int THIndex) { | |
if(ThirdDigitData != 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.*; | |
public class Solution { | |
public static void main(String[] args) { | |
try (Scanner sc = new Scanner(System.in)) { | |
int T = sc.nextInt(); | |
for(int a0 = 0; a0 < T; a0++) { | |
int N = sc.nextInt(); | |
int[][] NumData = new int[N][N]; |
OlderNewer