This file contains hidden or 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 Squats | |
{ | |
public static void main(String[] args) | |
{ | |
Scanner z=new Scanner(System.in); | |
short n=z.nextShort(); | |
String x=z.next(); | |
int a=Math.max(x.replaceAll("X", "").length(), x.replaceAll("x", "").length())-n/2; | |
System.out.println(a); |
This file contains hidden or 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.Scanner; | |
public class PrimeNumbers | |
{ | |
public static void main(String[] args) | |
{ | |
Scanner z=new Scanner(System.in); | |
int n=z.nextInt(); | |
ArrayList al=new ArrayList(); | |
for(int i=2;i<=3000;i++){ |
This file contains hidden or 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 Lever | |
{ | |
public static void main(String[] args) | |
{ | |
Scanner z=new Scanner(System.in); | |
String[] xx=z.next().split("\\^"); | |
StringBuilder sb=new StringBuilder(xx[0]); | |
xx[0]= sb.reverse().toString(); |
This file contains hidden or 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 Presents | |
{ | |
public static void main(String[] args) | |
{ | |
Scanner z=new Scanner(System.in); | |
int n=z.nextInt(); | |
int[] a=new int[n+1]; | |
for(int i=1;i<n+1;i++) | |
a[i]=z.nextInt(); |
This file contains hidden or 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.Scanner; | |
public class VasyaAndSocks | |
{//same as NewYearCandles | |
ArrayList<Integer> r = new ArrayList<Integer>(); | |
int x = 0; | |
int socks(int a , int b) | |
{ | |
int counter = 0; | |
while(a/b != 0){ |
This file contains hidden or 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.Scanner; | |
public class VasyaAndSocks | |
{//same as NewYearCandles | |
ArrayList<Integer> r = new ArrayList<Integer>(); | |
int x = 0; | |
int socks(int a , int b) | |
{ | |
int counter = 0; | |
while(a/b != 0){ |
This file contains hidden or 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 ValeraAndX | |
{ | |
public static void main(String[] args) | |
{ | |
Scanner z=new Scanner(System.in); | |
int n=z.nextInt(); | |
String x[]=new String[n]; | |
StringBuilder sb=new StringBuilder(); |
This file contains hidden or 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 LittlePonyandCrystalMine | |
{ | |
public static void main(String[] args) | |
{ | |
Scanner z=new Scanner(System.in); | |
int n=z.nextInt(); | |
StringBuilder sb=new StringBuilder(); | |
String x[]=new String[n]; |
This file contains hidden or 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 BeautifulMatrix | |
{ | |
public static void main(String args[]) | |
{ | |
Scanner z = new Scanner(System.in); | |
int[][] a=new int[6][6]; | |
for(int i=1;i<=5;i++) | |
{ | |
for(int j=1;j<=5;j++) |
This file contains hidden or 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 LuckyDivision | |
{ | |
public static void main(String[] args) | |
{ | |
Scanner z=new Scanner(System.in); | |
int a=z.nextInt(); | |
int[] l={4,7,44,47,74,77,444,447,474,477,744,747,774,777}; | |
int ctr=0; | |
for(int ll:l) |