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 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 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.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 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.HashMap; | |
import java.util.HashSet; | |
import java.util.Map; | |
import java.util.Scanner; | |
import java.util.Set; | |
public class UVA489 { | |
public static void main(String[] args) { | |
Scanner sc = new Scanner(System.in); | |
while(sc.hasNextLine()) { |
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 UVA133 { | |
public static void main(String[] args) { | |
Scanner sc = new Scanner(System.in); | |
while(sc.hasNextInt()) { | |
int N = sc.nextInt(); | |
int k =sc.nextInt(); | |
int m = 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 UVA12149 { | |
public static void main(String[] args) { | |
Scanner sc = new Scanner(System.in); | |
while(sc.hasNextInt()) { | |
int n = sc.nextInt(); | |
if(n == 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.Collections; | |
import java.util.PriorityQueue; | |
import java.util.Scanner; | |
public class UVA12541 { | |
public static void main(String[] args) { | |
Scanner sc = new Scanner(System.in); | |
PriorityQueue<Person> minheap = new PriorityQueue<>(); | |
PriorityQueue<Person> maxheap = new PriorityQueue<>(Collections.reverseOrder()); | |
int T = Integer.parseInt(sc.nextLine()); |
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 UVA12992 { | |
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 r = (N - 1) * 2 + + 1 ; | |
System.out.println("Case #"+t+": "+r); |