Skip to content

Instantly share code, notes, and snippets.

View peter279k's full-sized avatar
🎯
Focusing

Chun-Sheng, Li peter279k

🎯
Focusing
View GitHub Profile
import java.util.*;
public class main{
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
while(input.hasNext()) {
long g = input.nextLong();
long s = input.nextLong();
long sum = 0;
long result = 0;
if(g > s)
import java.util.*;
public class main{
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
while(input.hasNext()) {
int x = input.nextInt();
input.nextLine();
String str = input.nextLine();
String []str_arr = str.split(" ");
import java.util.*;
public class main{
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int numbers = input.nextInt();
for(int i=1;i<=numbers;i++) {
int x = input.nextInt();
int y = input.nextInt();
int x_add_y = x + y;
if(x_add_y % 2 != 0) {
import java.util.*;
public class main{
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int number = input.nextInt();
int count = 1;
for(int i=1;i<=number;i++) {
input.next();
input.next();
int num = input.nextInt();
import java.util.*;
public class main{
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int count = 0;
String result = "";
while(true) {
int a = input.nextInt();
int b = input.nextInt();
if(a == 0 && b == 0)
import java.util.*;
public class main{
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
long result = 0;
while(input.hasNext()) {
long v = input.nextLong();
long s = input.nextLong();
result = v * s * 2;
System.out.print(result + "\r\n");
import java.util.*;
public class main{
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int []fib_arr = new int[39];
fib_arr[0] = 1;
fib_arr[1] = 2;
for(int i=2;i<39;i++) {
fib_arr[i] = fib_arr[i-1] + fib_arr[i-2];
}
import java.util.*;
public class main{
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
while(input.hasNext()) {
int result = 0;
int N = input.nextInt();
if(N == 0)
break;
for(int i=1;i<N;i++)
import java.util.*;
public class main{
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
while(input.hasNext()) {
double s = input.nextDouble();
double a = input.nextDouble();
String deg_min = input.next();
if(deg_min.equals("min")) {
a /= 60;
import java.util.*;
public class main{
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
while(input.hasNext()) {
String str = "";
int number = input.nextInt();
int []nums = new int[number];
for(int i=0;i<number;i++) {
nums[i] = input.nextInt();