CSES - KILO 2017 4/5 - Results
Submission details
Task:Sticky Situation
Sender:Viljamin opetuslapset
Submission time:2017-09-26 18:34:44 +0300
Language:Java
Status:READY
Result:
Test results
testverdicttime
#10.11 sdetails
#20.13 sdetails
#30.14 sdetails
#40.14 sdetails
#50.12 sdetails
#60.12 sdetails
#70.14 sdetails
#80.10 sdetails
#90.16 sdetails
#100.16 sdetails
#110.12 sdetails
#120.13 sdetails
#130.13 sdetails
#140.16 sdetails
#150.14 sdetails
#160.15 sdetails
#170.12 sdetails
#180.15 sdetails
#190.13 sdetails
#200.12 sdetails
#210.12 sdetails
#220.13 sdetails
#230.14 sdetails
#240.12 sdetails
#250.14 sdetails
#260.14 sdetails
#270.13 sdetails
#280.13 sdetails
#290.13 sdetails
#300.13 sdetails
#310.13 sdetails
#320.15 sdetails
#330.12 sdetails
#340.12 sdetails
#350.12 sdetails
#360.13 sdetails
#370.13 sdetails
#380.12 sdetails
#390.14 sdetails

Code

import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Deque;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Stack;

/**
 *
 * @author juliuuus
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        IO io = new IO();
        int maara = io.nextInt();
        HashMap<Integer, Integer> pituudet = new HashMap<>();
        PriorityQueue<Integer> kepit = new PriorityQueue<>(new Comparator() {
            @Override
            public int compare(Object o1, Object o2) {
                return (int) o2 - (int) o1;
            }
        });
        boolean kolmeSamaa = false;
        for (int i = 0; i < maara; i++) {
            int keppi = io.nextInt();
            kepit.add(keppi);
            if (pituudet.containsKey(keppi)) {
                int next = pituudet.get(keppi) + 1;
                pituudet.put(keppi, next);
                if (!kolmeSamaa && next >= 3) {
                    kolmeSamaa = true;
                    break;
                }
            } else {
                pituudet.put(keppi, 0);
            }
        }

        int a1 = kepit.poll();
        int a2 = kepit.poll();
        int a3 = kepit.poll();
        if ((a2 + a3) > a1 || kolmeSamaa) {
            System.out.println("possible");
        } else {
            System.out.println("impossible");
        }

        io.close();

    }

}

Test details

Test 1

Verdict:

input
44
413658328434492816 42131811934...

correct output
possible

user output
(empty)

Error:
Exception in thread "main" java.lang.RuntimeException: IO.nextInt: Invalid int.
	at IO.nextInt(IO.java:106)
	at Main.main(Main.java:35)

Test 2

Verdict:

input
506
413658328434492816 42131811934...

correct output
possible

user output
(empty)

Error:
Exception in thread "main" java.lang.RuntimeException: IO.nextInt: Invalid int.
	at IO.nextInt(IO.java:106)
	at Main.main(Main.java:35)

Test 3

Verdict:

input
349
413658328434492816 42131811934...

correct output
possible

user output
(empty)

Error:
Exception in thread "main" java.lang.RuntimeException: IO.nextInt: Invalid int.
	at IO.nextInt(IO.java:106)
	at Main.main(Main.java:35)

Test 4

Verdict:

input
555
413658328434492816 42131811934...

correct output
possible

user output
(empty)

Error:
Exception in thread "main" java.lang.RuntimeException: IO.nextInt: Invalid int.
	at IO.nextInt(IO.java:106)
	at Main.main(Main.java:35)

Test 5

Verdict:

input
210
413658328434492816 42131811934...

correct output
possible

user output
(empty)

Error:
Exception in thread "main" java.lang.RuntimeException: IO.nextInt: Invalid int.
	at IO.nextInt(IO.java:106)
	at Main.main(Main.java:35)

Test 6

Verdict:

input
757
413658328434492816 42131811934...

correct output
possible

user output
(empty)

Error:
Exception in thread "main" java.lang.RuntimeException: IO.nextInt: Invalid int.
	at IO.nextInt(IO.java:106)
	at Main.main(Main.java:35)

Test 7

Verdict:

input
503
413658328434492816 42131811934...

correct output
possible

user output
(empty)

Error:
Exception in thread "main" java.lang.RuntimeException: IO.nextInt: Invalid int.
	at IO.nextInt(IO.java:106)
	at Main.main(Main.java:35)

Test 8

Verdict:

input
419
413658328434492816 42131811934...

correct output
possible

user output
(empty)

Error:
Exception in thread "main" java.lang.RuntimeException: IO.nextInt: Invalid int.
	at IO.nextInt(IO.java:106)
	at Main.main(Main.java:35)

Test 9

Verdict:

input
19
413658328434492816 42131811934...

correct output
possible

user output
(empty)

Error:
Exception in thread "main" java.lang.RuntimeException: IO.nextInt: Invalid int.
	at IO.nextInt(IO.java:106)
	at Main.main(Main.java:35)

Test 10

Verdict:

input
515
413658328434492816 42131811934...

correct output
possible

user output
(empty)

Error:
Exception in thread "main" java.lang.RuntimeException: IO.nextInt: Invalid int.
	at IO.nextInt(IO.java:106)
	at Main.main(Main.java:35)

Test 11

Verdict:

input
718
413658328434492816 42131811934...

correct output
possible

user output
(empty)

Error:
Exception in thread "main" java.lang.RuntimeException: IO.nextInt: Invalid int.
	at IO.nextInt(IO.java:106)
	at Main.main(Main.java:35)

Test 12

Verdict:

input
204
413658328434492816 42131811934...

correct output
possible

user output
(empty)

Error:
Exception in thread "main" java.lang.RuntimeException: IO.nextInt: Invalid int.
	at IO.nextInt(IO.java:106)
	at Main.main(Main.java:35)

Test 13

Verdict:

input
330
413658328434492816 42131811934...

correct output
possible

user output
(empty)

Error:
Exception in thread "main" java.lang.RuntimeException: IO.nextInt: Invalid int.
	at IO.nextInt(IO.java:106)
	at Main.main(Main.java:35)

Test 14

Verdict:

input
862
413658328434492816 42131811934...

correct output
possible

user output
(empty)

Error:
Exception in thread "main" java.lang.RuntimeException: IO.nextInt: Invalid int.
	at IO.nextInt(IO.java:106)
	at Main.main(Main.java:35)

Test 15

Verdict:

input
982
413658328434492816 42131811934...

correct output
possible

user output
(empty)

Error:
Exception in thread "main" java.lang.RuntimeException: IO.nextInt: Invalid int.
	at IO.nextInt(IO.java:106)
	at Main.main(Main.java:35)

Test 16

Verdict:

input
494
413658328434492816 42131811934...

correct output
possible

user output
(empty)

Error:
Exception in thread "main" java.lang.RuntimeException: IO.nextInt: Invalid int.
	at IO.nextInt(IO.java:106)
	at Main.main(Main.java:35)

Test 17

Verdict:

input
4
413658328434492816 42131811934...

correct output
impossible

user output
(empty)

Error:
Exception in thread "main" java.lang.RuntimeException: IO.nextInt: Invalid int.
	at IO.nextInt(IO.java:106)
	at Main.main(Main.java:35)

Test 18

Verdict:

input
967
413658328434492816 42131811934...

correct output
possible

user output
(empty)

Error:
Exception in thread "main" java.lang.RuntimeException: IO.nextInt: Invalid int.
	at IO.nextInt(IO.java:106)
	at Main.main(Main.java:35)

Test 19

Verdict:

input
838
413658328434492816 42131811934...

correct output
possible

user output
(empty)

Error:
Exception in thread "main" java.lang.RuntimeException: IO.nextInt: Invalid int.
	at IO.nextInt(IO.java:106)
	at Main.main(Main.java:35)

Test 20

Verdict:

input
449
413658328434492816 42131811934...

correct output
possible

user output
(empty)

Error:
Exception in thread "main" java.lang.RuntimeException: IO.nextInt: Invalid int.
	at IO.nextInt(IO.java:106)
	at Main.main(Main.java:35)

Test 21

Verdict:

input
458
413658328434492816 42131811934...

correct output
possible

user output
(empty)

Error:
Exception in thread "main" java.lang.RuntimeException: IO.nextInt: Invalid int.
	at IO.nextInt(IO.java:106)
	at Main.main(Main.java:35)

Test 22

Verdict:

input
635
413658328434492816 42131811934...

correct output
possible

user output
(empty)

Error:
Exception in thread "main" java.lang.RuntimeException: IO.nextInt: Invalid int.
	at IO.nextInt(IO.java:106)
	at Main.main(Main.java:35)

Test 23

Verdict:

input
911
413658328434492816 42131811934...

correct output
possible

user output
(empty)

Error:
Exception in thread "main" java.lang.RuntimeException: IO.nextInt: Invalid int.
	at IO.nextInt(IO.java:106)
	at Main.main(Main.java:35)

Test 24

Verdict:

input
156
413658328434492816 42131811934...

correct output
possible

user output
(empty)

Error:
Exception in thread "main" java.lang.RuntimeException: IO.nextInt: Invalid int.
	at IO.nextInt(IO.java:106)
	at Main.main(Main.java:35)

Test 25

Verdict:

input
295
413658328434492816 42131811934...

correct output
possible

user output
(empty)

Error:
Exception in thread "main" java.lang.RuntimeException: IO.nextInt: Invalid int.
	at IO.nextInt(IO.java:106)
	at Main.main(Main.java:35)

Test 26

Verdict:

input
88
1 1 2 3 5 8 13 21 34 55 89 144...

correct output
impossible

user output
(empty)

Error:
Exception in thread "main" java.lang.RuntimeException: IO.nextInt: Invalid int.
	at IO.nextInt(IO.java:106)
	at Main.main(Main.java:35)

Test 27

Verdict:

input
88
21 10610209857723 1836311903 7...

correct output
impossible

user output
(empty)

Error:
Exception in thread "main" java.lang.RuntimeException: IO.nextInt: Invalid int.
	at IO.nextInt(IO.java:106)
	at Main.main(Main.java:35)

Test 28

Verdict:

input
4
688138922692403404 53826514650...

correct output
impossible

user output
(empty)

Error:
Exception in thread "main" java.lang.RuntimeException: IO.nextInt: Invalid int.
	at IO.nextInt(IO.java:106)
	at Main.main(Main.java:35)

Test 29

Verdict:

input
6
1051054321739242054 6730047734...

correct output
impossible

user output
(empty)

Error:
Exception in thread "main" java.lang.RuntimeException: IO.nextInt: Invalid int.
	at IO.nextInt(IO.java:106)
	at Main.main(Main.java:35)

Test 30

Verdict:

input
8
3450451668468094 1119558431635...

correct output
impossible

user output
(empty)

Error:
Exception in thread "main" java.lang.RuntimeException: IO.nextInt: Invalid int.
	at IO.nextInt(IO.java:106)
	at Main.main(Main.java:35)

Test 31

Verdict:

input
10
43884608503565000 302405275242...

correct output
impossible

user output
(empty)

Error:
Exception in thread "main" java.lang.RuntimeException: IO.nextInt: Invalid int.
	at IO.nextInt(IO.java:106)
	at Main.main(Main.java:35)

Test 32

Verdict:

input
12
385129830092889 35573055922474...

correct output
impossible

user output
(empty)

Error:
Exception in thread "main" java.lang.RuntimeException: IO.nextInt: Invalid int.
	at IO.nextInt(IO.java:106)
	at Main.main(Main.java:35)

Test 33

Verdict:

input
14
3525644022645 589629197579404 ...

correct output
impossible

user output
(empty)

Error:
Exception in thread "main" java.lang.RuntimeException: IO.nextInt: Invalid int.
	at IO.nextInt(IO.java:106)
	at Main.main(Main.java:35)

Test 34

Verdict:

input
16
17995284407142 114231612799405...

correct output
impossible

user output
(empty)

Error:
Exception in thread "main" java.lang.RuntimeException: IO.nextInt: Invalid int.
	at IO.nextInt(IO.java:106)
	at Main.main(Main.java:35)

Test 35

Verdict:

input
18
6170861631849362 2060967377839...

correct output
impossible

user output
(empty)

Error:
Exception in thread "main" java.lang.RuntimeException: IO.nextInt: Invalid int.
	at IO.nextInt(IO.java:106)
	at Main.main(Main.java:35)

Test 36

Verdict:

input
61
1 4398046511104 8388608 687194...

correct output
impossible

user output
(empty)

Error:
Exception in thread "main" java.lang.RuntimeException: IO.nextInt: Invalid int.
	at IO.nextInt(IO.java:106)
	at Main.main(Main.java:35)

Test 37

Verdict:

input
89
1 1 2 3 5 8 13 21 34 55 89 144...

correct output
possible

user output
(empty)

Error:
Exception in thread "main" java.lang.RuntimeException: IO.nextInt: Invalid int.
	at IO.nextInt(IO.java:106)
	at Main.main(Main.java:35)

Test 38

Verdict:

input
20000
1 1 2 3 5 8 13 21 34 55 89 144...

correct output
possible

user output
(empty)

Error:
Exception in thread "main" java.lang.RuntimeException: IO.nextInt: Invalid int.
	at IO.nextInt(IO.java:106)
	at Main.main(Main.java:35)

Test 39

Verdict:

input
200
1 1125899906842624 1 109951162...

correct output
possible

user output
(empty)

Error:
Exception in thread "main" java.lang.RuntimeException: IO.nextInt: Invalid int.
	at IO.nextInt(IO.java:106)
	at Main.main(Main.java:35)