CSES - Datatähti 2023 alku - Results
Submission details
Task:Lehmät
Sender:Roope_Ankka
Submission time:2022-11-01 20:48:34 +0200
Language:Java
Status:READY
Result:0
Feedback
groupverdictscore
#10
#20
Test results
testverdicttimegroup
#10.13 s1, 2details
#20.13 s1, 2details
#30.13 s1, 2details
#40.13 s1, 2details
#50.13 s1, 2details
#60.13 s2details
#70.13 s2details
#80.13 s2details
#90.12 s2details

Code

import java.util.Arrays;
import java.util.Scanner;
import java.math.BigInteger;

public class main{

    public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);
        int x0 = scan.nextInt();
        int x1 = scan.nextInt();
        int x2 = scan.nextInt();
        int x3 = scan.nextInt();
        int x4 = scan.nextInt();
        int x5 = scan.nextInt();
        int x6 = scan.nextInt();
        int x7 = scan.nextInt();
        int x8 = scan.nextInt();
        int x9 = scan.nextInt();


        int[] x = {x0,x1,x2,x3,x4,x5,x6,x7,x8,x9};
        int inputmäärä = 0;
        for(int i = 0; i < 10; i++){
            inputmäärä += x[i]; 
        }


        BigInteger summa = new BigInteger("1");
        int output = 0;

        for(int i = 1; i <= 10000; i++){
            summa = summa.multiply(BigInteger.valueOf(i));
            BigInteger temp = summa;

            int[] y = {0,0,0,0,0,0,0,0,0,0}; 
            
            int length = temp.toString().length();
            
            if(inputmäärä == length){ 
                while (temp.bitCount() != 0){
                    int digits = temp.mod(BigInteger.valueOf(10)).intValue();
                    switch(digits){
                        case 0:
                        y[0] += 1;
                        break;
                        
                        case 1:
                        y[1] += 1;
                        break;

                        case 2:
                        y[2] += 1;
                        break;

                        case 3:
                        y[3] += 1;
                        break;

                        case 4:
                        y[4] += 1;
                        break;

                        case 5:
                        y[5] += 1;
                        break;

                        case 6:
                        y[6] += 1;
                        break;

                        case 7:
                        y[7] += 1;
                        break;

                        case 8:
                        y[8] += 1;
                        break;
                        
                        case 9:
                        y[9] += 1;
                        break;
                    }
                    temp = temp.divide(BigInteger.valueOf(10));
                }
                if(Arrays.equals(y, x)){
                    output = i;
                    break;
                }

            }
            
        }
        System.out.println(output); 
    }

}

Test details

Test 1

Group: 1, 2

Verdict:

input
3 3
***
*.*
***

correct output
0

user output
(empty)

Error:
Exception in thread "main" java.util.InputMismatchException
	at java.base/java.util.Scanne...

Test 2

Group: 1, 2

Verdict:

input
3 3
***
*@*
***

correct output
1

user output
(empty)

Error:
Exception in thread "main" java.util.InputMismatchException
	at java.base/java.util.Scanne...

Test 3

Group: 1, 2

Verdict:

input
5 10
...@......
..******..
@.*@@@@*.@
..******..
...

correct output
4

user output
(empty)

Error:
Exception in thread "main" java.util.InputMismatchException
	at java.base/java.util.Scanne...

Test 4

Group: 1, 2

Verdict:

input
10 10
@@...@.@@@
..@@.@@..@
@.*******@
..*@....*.
...

correct output
11

user output
(empty)

Error:
Exception in thread "main" java.util.InputMismatchException
	at java.base/java.util.Scanne...

Test 5

Group: 1, 2

Verdict:

input
10 10
**********
*@@@@@@@@*
*@@@@@@@@*
*@@@@@@@@*
...

correct output
64

user output
(empty)

Error:
Exception in thread "main" java.util.InputMismatchException
	at java.base/java.util.Scanne...

Test 6

Group: 2

Verdict:

input
100 100
.........................@.......

correct output
60

user output
(empty)

Error:
Exception in thread "main" java.util.InputMismatchException
	at java.base/java.util.Scanne...

Test 7

Group: 2

Verdict:

input
100 100
..@@..........@......@....@@.....

correct output
1507

user output
(empty)

Error:
Exception in thread "main" java.util.InputMismatchException
	at java.base/java.util.Scanne...

Test 8

Group: 2

Verdict:

input
100 100
.@..@@..@@.@..@..@..@@..@..@.....

correct output
3348

user output
(empty)

Error:
Exception in thread "main" java.util.InputMismatchException
	at java.base/java.util.Scanne...

Test 9

Group: 2

Verdict:

input
100 100
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@...

correct output
7225

user output
(empty)

Error:
Exception in thread "main" java.util.InputMismatchException
	at java.base/java.util.Scanne...