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 UVA12955 { | |
public static void main(String[] args) { | |
int [] fact =new int[12]; | |
fact[0] = fact[1] = 1; | |
for(int i=2;i<=10;i++) { | |
fact[i] = i*fact[i-1]; | |
} | |
Scanner sc = new Scanner(System.in); |
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.Arrays; | |
import java.util.Scanner; | |
public class UVA10474 { | |
public static void main(String[] args) { | |
Scanner sc = new Scanner(System.in); | |
int t = 1; | |
while(sc.hasNextInt()) { | |
int N = sc.nextInt(); | |
int Q = sc.nextInt(); |
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 UVA12908 { | |
public static void main(String[] args) { | |
Scanner sc =new Scanner(System.in); | |
while(sc.hasNextInt()) { | |
int S = sc.nextInt(); | |
if(S == 0) { | |
break; |
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 UVA12917 { | |
public static void main(String[] args) { | |
Scanner sc = new Scanner(System.in); | |
while(sc.hasNextInt()) { | |
int P = sc.nextInt(); | |
int H = sc.nextInt(); | |
int O = sc.nextInt(); | |
int moreO = (O - P); |
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 UVA12952 { | |
public static void main(String[] args) { | |
Scanner sc = new Scanner(System.in); | |
while(sc.hasNextInt()) { | |
int A = sc.nextInt(); | |
int B = sc.nextInt(); | |
if(A == B) { | |
System.out.println(A); |
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 UVA12996 { | |
public static void main(String[] args) { | |
Scanner sc = new Scanner(System.in); | |
int T = sc.nextInt(); | |
for(int t =1;t<=T;t++) { | |
int N = sc.nextInt(); | |
int L = sc.nextInt(); | |
int [] M = new int[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.util.Scanner; | |
public class UVA12918 { | |
public static void main(String[] args) { | |
Scanner sc = new Scanner(System.in); | |
int T = sc.nextInt(); | |
while(T-->0) { | |
int n = sc.nextInt(); | |
int m = sc.nextInt(); | |
int extra = m - 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.util.Scanner; | |
public class UVA11608 { | |
public static void main(String[] args) { | |
Scanner sc = new Scanner(System.in); | |
int c = 1; | |
while(sc.hasNextInt()) { | |
int p = sc.nextInt(); | |
if( p == -1) { | |
break; |
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 sc = new Scanner(System.in); | |
int T = sc.nextInt(); | |
for(int t = 1; t <= T; t++) { | |
int N = sc.nextInt(); | |
int [] A = new int[N]; | |
int [] B = new int[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.util.ArrayList; | |
import java.util.Collections; | |
import java.util.List; | |
import java.util.PriorityQueue; | |
import java.util.Scanner; | |
public class UVA11804 { | |
public static void main(String[] args) { | |
Scanner sc = new Scanner(System.in); | |
int T = Integer.parseInt(sc.nextLine()); |