Submission #13957783
Source Code Expand
public class Main {
static java.util.Scanner scan = new java.util.Scanner(System.in);
public static int pow(int a){
int b = 1;
for(int i = 0; i < a;i++){
b *= 10;
}
return b;
}
public static void main(String[] args) {
String[] line = line().split(" ");
String[] sliced_period = line[1].split("\\.");
Long[] vars = new Long[]{Long.parseLong(line[0]),Long.parseLong(sliced_period[0]),Long.parseLong(sliced_period[1])};
Long first = vars[0];
Long second = (vars[1] * (pow(sliced_period[1].length())))+vars[2];
Long calc = first * second;
String parse = String.valueOf(calc).split("\\.")[0];
if(parse.length() - sliced_period[1].length() <= 0){
puts("0");
return;
}
String floor = parse.substring(0,(parse.length())-sliced_period[1].length());
puts(floor);
scan.close();
}
public static String line(){
return scan.nextLine();
}
public static int[] lineInts(){
String l = line();
String[] l1 = l.split(" ");
int[] a = new int[l1.length];
for(int i = 0; i < l1.length; i++){
a[i] = Integer.parseInt(l1[i]);
}
return a;
}
public static int[] split_piriod_Ints(String[] a){
String l = line();
int[] b = new int[a.length];
for(int i = 0; i < a.length; i++){
b[i] = Integer.parseInt(a[i]);
}
return b;
}
public static long[] lineLongs(){
String l = line();
String[] l1 = l.split(" ");
long[] a = new long[l1.length];
for(int i = 0; i < l1.length; i++){
a[i] = Long.parseLong(l1[i]);
}
return a;
}
public static void puts(Object a){
System.out.println(a);
}
public static void puts(Object... a){
for(int i = 0; i<a.length;i++){
System.out.println(a[i]);
}
}
}
Submission Info
| Submission Time | |
|---|---|
| Task | C - Multiplication 3 |
| User | varbal |
| Language | Java (OpenJDK 11.0.6) |
| Score | 300 |
| Code Size | 2090 Byte |
| Status | AC |
| Exec Time | 110 ms |
| Memory | 35620 KiB |
Judge Result
| Set Name | Sample | All | after_contest | ||||||
|---|---|---|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 300 / 300 | 0 / 0 | ||||||
| Status |
|
|
|
| Set Name | Test Cases |
|---|---|
| Sample | sample_01.txt, sample_02.txt, sample_03.txt |
| All | sample_01.txt, sample_02.txt, sample_03.txt, hand_01.txt, hand_02.txt, hand_03.txt, random_01.txt, random_02.txt, random_03.txt, random_11.txt, random_12.txt, random_13.txt, random_21.txt, random_22.txt, random_23.txt, random_31.txt, random_32.txt, random_33.txt, zero_01.txt, zero_02.txt |
| after_contest | after_contest_01.txt, after_contest_02.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| after_contest_01.txt | AC | 102 ms | 35452 KiB |
| after_contest_02.txt | AC | 110 ms | 35620 KiB |
| hand_01.txt | AC | 93 ms | 35508 KiB |
| hand_02.txt | AC | 100 ms | 35488 KiB |
| hand_03.txt | AC | 98 ms | 35420 KiB |
| random_01.txt | AC | 101 ms | 35512 KiB |
| random_02.txt | AC | 99 ms | 35524 KiB |
| random_03.txt | AC | 101 ms | 35524 KiB |
| random_11.txt | AC | 94 ms | 35616 KiB |
| random_12.txt | AC | 101 ms | 35328 KiB |
| random_13.txt | AC | 101 ms | 35572 KiB |
| random_21.txt | AC | 105 ms | 35436 KiB |
| random_22.txt | AC | 96 ms | 35436 KiB |
| random_23.txt | AC | 103 ms | 35420 KiB |
| random_31.txt | AC | 100 ms | 35500 KiB |
| random_32.txt | AC | 99 ms | 35428 KiB |
| random_33.txt | AC | 103 ms | 35564 KiB |
| sample_01.txt | AC | 101 ms | 35396 KiB |
| sample_02.txt | AC | 107 ms | 35428 KiB |
| sample_03.txt | AC | 97 ms | 35476 KiB |
| zero_01.txt | AC | 101 ms | 35520 KiB |
| zero_02.txt | AC | 101 ms | 35552 KiB |