Code Submission Evaluation System Login

HIIT Open 2017

Start:2017-05-27 11:00:00
End:2017-05-27 16:00:00
 

Tasks | Messages | Scoreboard | Statistics


CSES - HIIT Open 2017 - Results
History
2017-05-27 15:59:15
2017-05-27 15:58:14
2017-05-27 15:57:12
2017-05-27 15:56:33
2017-05-27 15:33:08
2017-05-27 15:27:49
2017-05-27 15:09:19
2017-05-27 15:00:10
2017-05-27 13:46:46
Task:Contest
Sender:Proudly div 2
Submission time:2017-05-27 15:00:10
Language:Scala
Status:READY
Result:TIME LIMIT EXCEEDED

Test results

testverdicttime (s)
#1ACCEPTED0.49 / 1.00details
#2ACCEPTED0.46 / 1.00details
#3ACCEPTED0.50 / 1.00details
#4ACCEPTED0.48 / 1.00details
#5ACCEPTED0.47 / 1.00details
#6ACCEPTED0.47 / 1.00details
#7ACCEPTED0.49 / 1.00details
#8ACCEPTED0.46 / 1.00details
#9ACCEPTED0.47 / 1.00details
#10ACCEPTED0.46 / 1.00details
#11ACCEPTED0.48 / 1.00details
#12ACCEPTED0.44 / 1.00details
#13TIME LIMIT EXCEEDED-- / 1.00details
#14ACCEPTED0.43 / 1.00details
#15ACCEPTED0.48 / 1.00details
#16ACCEPTED0.48 / 1.00details
#17ACCEPTED0.44 / 1.00details
#18ACCEPTED0.52 / 1.00details
#19ACCEPTED0.48 / 1.00details
#20ACCEPTED0.42 / 1.00details
#21ACCEPTED0.46 / 1.00details
#22ACCEPTED0.44 / 1.00details
#23ACCEPTED0.45 / 1.00details
#24ACCEPTED0.49 / 1.00details
#25ACCEPTED0.45 / 1.00details
#26ACCEPTED0.46 / 1.00details
#27ACCEPTED0.53 / 1.00details
#28TIME LIMIT EXCEEDED-- / 1.00details
#29ACCEPTED0.48 / 1.00details
#30ACCEPTED0.47 / 1.00details
#31TIME LIMIT EXCEEDED-- / 1.00details
#32ACCEPTED0.56 / 1.00details
#33ACCEPTED0.54 / 1.00details
#34ACCEPTED0.47 / 1.00details
#35ACCEPTED0.47 / 1.00details
#36ACCEPTED0.51 / 1.00details
#37WRONG ANSWER0.49 / 1.00details
#38ACCEPTED0.51 / 1.00details
#39ACCEPTED0.53 / 1.00details
#40WRONG ANSWER0.53 / 1.00details
#41ACCEPTED0.48 / 1.00details
#42ACCEPTED0.50 / 1.00details
#43WRONG ANSWER0.54 / 1.00details
#44ACCEPTED0.49 / 1.00details
#45ACCEPTED0.51 / 1.00details
#46WRONG ANSWER0.51 / 1.00details

Code

import scala.io.StdIn.readLine
/**
 * @author hiit10
 */
object c extends App {
  val in = readLine().split(" ")
  val n = in(0).toInt
  val k = in(1).toInt
  val pariton = k % 2 == 1
  var (a1, l1) = (1, n)
  var (a2, l2) = (1, n)
  if(k < n){
    l1 = k
    l2 = k
  }
  def solve(){
    println("1 " + a1)
    var max1 = readLine().toInt
    println("2 " + a2)
    var max2 = readLine().toInt
    println("1 " + l1)
    var min1 = readLine().toInt
    println("2 " + l2)
    var min2 = readLine().toInt
    
    //checks
    if(min1 >= max2){
      if(n >= k){
        println("1 " + k)
        val ret = readLine().toInt
        println("3 "+ ret)
        return
      }else{
        println("2 " + (k - n))
        val ret = readLine().toInt
        println("3 " + ret)
        return
      }
    }else if(min2 >= max1){
      if(n >= k){
        println("2 " + k)
        val ret = readLine().toInt
        println("3 "+ ret)
        return
      }else{
        println("1 " + (k - n))
        val ret = readLine().toInt
        println("3 " + ret)
        return
      }
    }
    var ind1 = (a1 + l1) / 2
    var ind2 = (a2 + l2) / 2
    println("1 " + ind1)
    var cand1 = readLine().toInt
    println("2 " + ind2)
    var cand2 = readLine().toInt
    if(cand1 == cand2){
      println("3 " + cand1)
      return
    }else if(cand1 > cand2){
      a1 = ind1
      l2 = ind2
    }else{
      a2 = ind2
      l1 = ind1
    }
    while(true){
      if(l1 - a1 < 6 && l2 - a2 < 6){
        val values = scala.collection.mutable.ArrayBuffer[Int]()
        for(i <- a1 to l1){
          println("1 " + i)
          values += readLine().toInt
        }
        for(i <- a2 to l2){
          println("2 " + i)
          values += readLine().toInt
        }
        val sort = values.distinct.sorted.reverse
        println("3 " + sort(k - a1 - a2 + 1))
        return
      }
      ind1 = (a1 + l2)/2
      ind2 = (a2 + l2)/2
      println("1 " + ind1)
      cand1 = readLine().toInt
      println("2 " + ind2)
      cand2 = readLine().toInt
      if(cand1 == cand2){
        println("3 " + cand1)
        return
      }else if(cand1 > cand2){
        a1 = ind1
        l2 = ind2
      }else{
        a2 = ind2
        l1 = ind1
      }
    }
  }
  solve()
}

Test details

Test 1

Verdict: ACCEPTED

input
1 1
33
18
view   save

correct output
(no output)
view   save

user output
1 1
1 1
33
2 1
18
1 1
33
2 1
18
1 1
33
3 33
view   save

Test 2

Verdict: ACCEPTED

input
1 1
37
55
view   save

correct output
(no output)
view   save

user output
1 1
1 1
37
2 1
55
1 1
37
2 1
55
2 1
55
3 55
view   save

Test 3

Verdict: ACCEPTED

input
1 2
80
38
view   save

correct output
(no output)
view   save

user output
1 2
1 1
80
2 1
38
1 1
80
2 1
38
2 1
38
3 38
view   save

Test 4

Verdict: ACCEPTED

input
1 2
29
48
view   save

correct output
(no output)
view   save

user output
1 2
1 1
29
2 1
48
1 1
29
2 1
48
1 1
29
3 29
view   save

Test 5

Verdict: ACCEPTED

input
2 1
98 91
83 14
view   save

correct output
(no output)
view   save

user output
2 1
1 1
98
2 1
83
1 1
98
2 1
83
1 1
98
3 98
view   save

Test 6

Verdict: ACCEPTED

input
2 1
25 23
39 31
view   save

correct output
(no output)
view   save

user output
2 1
1 1
25
2 1
39
1 1
25
2 1
39
2 1
39
3 39
view   save

Test 7

Verdict: ACCEPTED

input
2 1
73 57
77 32
view   save

correct output
(no output)
view   save

user output
2 1
1 1
73
2 1
77
1 1
73
2 1
77
2 1
77
3 77
view   save

Test 8

Verdict: ACCEPTED

input
2 2
77 64
63 2
view   save

correct output
(no output)
view   save

user output
2 2
1 1
77
2 1
63
1 2
64
2 2
2
1 2
64
3 64
view   save

Test 9

Verdict: ACCEPTED

input
2 2
61 28
97 90
view   save

correct output
(no output)
view   save

user output
2 2
1 1
61
2 1
97
1 2
28
2 2
90
2 2
90
3 90
view   save

Test 10

Verdict: ACCEPTED

input
2 2
87 66
75 38
view   save

correct output
(no output)
view   save

user output
2 2
1 1
87
2 1
75
1 2
66
2 2
38
1 1
87
2 1
75
1 1
87
1 2
66
2 1
75
3 75
...
view   save

Test 11

Verdict: ACCEPTED

input
2 4
70 39
33 12
view   save

correct output
(no output)
view   save

user output
2 4
1 1
70
2 1
33
1 2
39
2 2
12
2 2
12
3 12
view   save

Test 12

Verdict: ACCEPTED

input
2 4
47 20
67 52
view   save

correct output
(no output)
view   save

user output
2 4
1 1
47
2 1
67
1 2
20
2 2
52
1 2
20
3 20
view   save

Test 13

Verdict: TIME LIMIT EXCEEDED

input
2 4
54 20
90 1
view   save

correct output
(no output)
view   save

user output
(no output)
view   save

Test 14

Verdict: ACCEPTED

input
2 4
68 66
64 61
view   save

correct output
(no output)
view   save

user output
2 4
1 1
68
2 1
64
1 2
66
2 2
61
2 2
61
3 61
view   save

Test 15

Verdict: ACCEPTED

input
2 4
35 27
68 66
view   save

correct output
(no output)
view   save

user output
2 4
1 1
35
2 1
68
1 2
27
2 2
66
1 2
27
3 27
view   save

Test 16

Verdict: ACCEPTED

input
2 4
51 32
25 18
view   save

correct output
(no output)
view   save

user output
2 4
1 1
51
2 1
25
1 2
32
2 2
18
2 2
18
3 18
view   save

Test 17

Verdict: ACCEPTED

input
10 1
100 78 74 72 71 70 64 57 43 39
29 26 22 21 15 13 11 9 4 3
view   save

correct output
(no output)
view   save

user output
10 1
1 1
100
2 1
29
1 1
100
2 1
29
1 1
100
3 100
view   save

Test 18

Verdict: ACCEPTED

input
10 1
56 52 49 48 17 14 13 12 9 3
99 98 84 80 78 75 69 67 66 62
view   save

correct output
(no output)
view   save

user output
10 1
1 1
56
2 1
99
1 1
56
2 1
99
2 1
99
3 99
view   save

Test 19

Verdict: ACCEPTED

input
10 1
91 86 73 65 53 42 28 14 13 6
100 77 70 58 52 41 35 33 17 9
view   save

correct output
(no output)
view   save

user output
10 1
1 1
91
2 1
100
1 1
91
2 1
100
2 1
100
3 100
view   save

Test 20

Verdict: ACCEPTED

input
10 2
88 87 69 68 64 63 57 55 54 51
50 36 35 31 27 22 15 14 8 1
view   save

correct output
(no output)
view   save

user output
10 2
1 1
88
2 1
50
1 2
87
2 2
36
1 2
87
3 87
view   save

Test 21

Verdict: ACCEPTED

input
10 2
31 28 26 16 13 9 8 6 5 2
95 87 80 78 76 65 59 53 41 40
view   save

correct output
(no output)
view   save

user output
10 2
1 1
31
2 1
95
1 2
28
2 2
87
2 2
87
3 87
view   save

Test 22

Verdict: ACCEPTED

input
10 2
98 93 89 68 61 41 32 30 23 4
96 86 76 75 73 58 35 29 26 7
view   save

correct output
(no output)
view   save

user output
10 2
1 1
98
2 1
96
1 2
93
2 2
86
1 1
98
2 1
96
1 1
98
1 2
93
2 1
96
3 96
...
view   save

Test 23

Verdict: ACCEPTED

input
10 10
99 86 85 84 82 81 77 74 71 69
45 27 26 24 21 18 15 13 11 4
view   save

correct output
(no output)
view   save

user output
10 10
1 1
99
2 1
45
1 10
69
2 10
4
1 10
69
3 69
view   save

Test 24

Verdict: ACCEPTED

input
10 10
46 41 40 28 24 23 18 14 8 4
100 94 90 85 78 77 75 68 59 54
view   save

correct output
(no output)
view   save

user output
10 10
1 1
46
2 1
100
1 10
4
2 10
54
2 10
54
3 54
view   save

Test 25

Verdict: ACCEPTED

input
10 10
91 80 68 39 38 37 31 30 7 1
100 95 87 71 67 41 33 18 17 11
view   save

correct output
(no output)
view   save

user output
10 10
1 1
91
2 1
100
1 10
1
2 10
11
1 5
38
2 5
67
1 1
91
1 2
80
1 3
68
1 4
...
view   save

Test 26

Verdict: ACCEPTED

input
10 18
87 86 85 80 79 74 64 60 59 47
43 39 37 34 29 27 26 16 6 5
view   save

correct output
(no output)
view   save

user output
10 18
1 1
87
2 1
43
1 10
47
2 10
5
2 8
16
3 16
view   save

Test 27

Verdict: ACCEPTED

input
10 18
54 48 42 38 28 27 22 19 15 5
100 96 91 84 79 73 72 64 63 60
view   save

correct output
(no output)
view   save

user output
10 18
1 1
54
2 1
100
1 10
5
2 10
60
1 8
19
3 19
view   save

Test 28

Verdict: TIME LIMIT EXCEEDED

input
10 18
98 87 84 71 62 59 45 38 34 10
89 86 77 73 69 67 46 32 31 6
view   save

correct output
(no output)
view   save

user output
(no output)
view   save

Test 29

Verdict: ACCEPTED

input
10 20
91 90 86 79 73 71 67 65 61 56
46 44 36 25 18 11 6 5 3 1
view   save

correct output
(no output)
view   save

user output
10 20
1 1
91
2 1
46
1 10
56
2 10
1
2 10
1
3 1
view   save

Test 30

Verdict: ACCEPTED

input
10 20
56 48 47 46 35 28 26 18 10 3
95 90 89 85 79 77 67 66 62 59
view   save

correct output
(no output)
view   save

user output
10 20
1 1
56
2 1
95
1 10
3
2 10
59
1 10
3
3 3
view   save

Test 31

Verdict: TIME LIMIT EXCEEDED

input
10 20
81 80 79 76 71 63 57 34 29 24
96 70 61 59 52 36 22 5 4 2
view   save

correct output
(no output)
view   save

user output
(no output)
view   save

Test 32

Verdict: ACCEPTED

input
100000 1
999998453 999997813 999980598 ...
view   save

correct output
(no output)
view   save

user output
100000 1
1 1
999998453
2 1
501385639
1 1
999998453
2 1
501385639
1 1
999998453
3 999998453
view   save

Test 33

Verdict: ACCEPTED

input
100000 1
498482877 498480230 498478078 ...
view   save

correct output
(no output)
view   save

user output
100000 1
1 1
498482877
2 1
999998503
1 1
498482877
2 1
999998503
2 1
999998503
3 999998503
view   save

Test 34

Verdict: ACCEPTED

input
100000 1
999986977 999979153 999972315 ...
view   save

correct output
(no output)
view   save

user output
100000 1
1 1
999986977
2 1
999999598
1 1
999986977
2 1
999999598
2 1
999999598
3 999999598
view   save

Test 35

Verdict: ACCEPTED

input
100000 20000
999990977 999974610 999971985 ...
view   save

correct output
(no output)
view   save

user output
100000 20000
1 1
999990977
2 1
500136081
1 20000
900880763
2 20000
400283803
1 20000
900880763
3 900880763
view   save

Test 36

Verdict: ACCEPTED

input
100000 20000
501434689 501431546 501422578 ...
view   save

correct output
(no output)
view   save

user output
100000 20000
1 1
501434689
2 1
999986337
1 20000
401582216
2 20000
899458087
2 20000
899458087
3 899458087
view   save

Test 37

Verdict: WRONG ANSWER

input
100000 20000
999995686 999994228 999993000 ...
view   save

correct output
(no output)
view   save

user output
100000 20000
1 1
999995686
2 1
999994430
1 20000
800916803
2 20000
801041131
1 10000
900678332
2 10000
899674635
1 10000
900678332
2 5000
949740756
1 10000
900678332
2 7500
...
view   save

Test 38

Verdict: ACCEPTED

input
100000 100000
999992342 999991618 999988963 ...
view   save

correct output
(no output)
view   save

user output
100000 100000
1 1
999992342
2 1
500660526
1 100000
500661425
2 100000
660
1 100000
500661425
3 500661425
view   save

Test 39

Verdict: ACCEPTED

input
100000 100000
500754694 500749114 500734428 ...
view   save

correct output
(no output)
view   save

user output
100000 100000
1 1
500754694
2 1
999995766
1 100000
2295
2 100000
500755304
2 100000
500755304
3 500755304
view   save

Test 40

Verdict: WRONG ANSWER

input
100000 100000
999988713 999962210 999939592 ...
view   save

correct output
(no output)
view   save

user output
100000 100000
1 1
999988713
2 1
999995889
1 100000
18575
2 100000
2894
1 50000
499530532
2 50000
499176370
1 50000
499530532
2 25000
748266089
1 50000
499530532
2 37500
...
view   save

Test 41

Verdict: ACCEPTED

input
100000 180000
999994001 999991970 999991811 ...
view   save

correct output
(no output)
view   save

user output
100000 180000
1 1
999994001
2 1
500169086
1 100000
500171192
2 100000
2530
2 80000
100336489
3 100336489
view   save

Test 42

Verdict: ACCEPTED

input
100000 180000
499560736 499555703 499549265 ...
view   save

correct output
(no output)
view   save

user output
100000 180000
1 1
499560736
2 1
999984233
1 100000
1400
2 100000
499563731
1 80000
98122269
3 98122269
view   save

Test 43

Verdict: WRONG ANSWER

input
100000 180000
999996507 999993660 999990414 ...
view   save

correct output
(no output)
view   save

user output
100000 180000
1 1
999996507
2 1
999994276
1 100000
27118
2 100000
4551
1 50000
498880008
2 50000
497789131
1 50000
498880008
2 25000
747194658
1 50000
498880008
2 37500
...
view   save

Test 44

Verdict: ACCEPTED

input
100000 200000
999987384 999983480 999981446 ...
view   save

correct output
(no output)
view   save

user output
100000 200000
1 1
999987384
2 1
499634848
1 100000
499647604
2 100000
16029
2 100000
16029
3 16029
view   save

Test 45

Verdict: ACCEPTED

input
100000 200000
500801844 500800718 500792295 ...
view   save

correct output
(no output)
view   save

user output
100000 200000
1 1
500801844
2 1
999998035
1 100000
8183
2 100000
500805123
1 100000
8183
3 8183
view   save

Test 46

Verdict: WRONG ANSWER

input
100000 200000
999984710 999974756 999965175 ...
view   save

correct output
(no output)
view   save

user output
100000 200000
1 1
999984710
2 1
999989873
1 100000
13769
2 100000
2005
1 50000
499227280
2 50000
501418021
1 50000
499227280
2 75000
250015635
1 62500
374058821
2 62500
...
view   save