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
System.out.println(1 + ((n - 1) / 100)); |
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
System.out.println(s.substring(1) + String.valueOf(s.charAt(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
static long solve(long n){ | |
if(n < 1000){ | |
return 0; | |
} | |
long ans = 0; | |
if(n >= 1_000_000_000_000_000l){ | |
ans += 5; | |
} | |
if(n >= 1_000_000_000_000l){ | |
ans += (Math.min(1_000_000_000_000_000l - 1, n) - (1_000_000_000_000l - 1)) * 4; |
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
static int solve(int a, int b){ | |
if(a + b >= 15 && b >= 8){ | |
return 1; | |
} else if(a + b >= 10 && b >= 3){ | |
return 2; | |
} else if(a + b >= 3){ | |
return 3; | |
} else { | |
return 4; | |
} |
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
System.out.println((a - b) * 100.0 / 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
System.out.println(((x + 100) / 100 * 100) - x); |