Submission #1052556

# Submission time Handle Problem Language Result Execution time Memory
1052556 2024-08-10T16:23:09 Z Zbyszek99 Rainforest Jumps (APIO21_jumps) C++17
60 / 100
4000 ms 43752 KB
#include "jumps.h"
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define ff first
#define ss second
#define pii pair<int,int>
#define pll pair<long long, long long>
#define pb push_back
#define rep(i, b) for(int i = 0; i < (b); ++i)
#define rep2(i,a,b) for(int i = a; i <= (b); ++i)
#define rep3(i,a,b,c) for(int i = a; i <= (b); i+=c)
#define count_bits(x) __builtin_popcountll((x))
#define all(x) (x).begin(),(x).end()
#define size(x) (int)(x).size()
#define forall(it,x) for(auto& it:(x))
using namespace std;
//mt19937 mt;void random(){mt.seed(chrono::time_point_cast<chrono::milliseconds>(chrono::high_resolution_clock::now()).time_since_epoch().count());}
//ll rand(ll a, ll b) {return a + (mt() % (b-a+1));}
const int INF = 1e9+50;
const ll INF_L = 1e18+40;
const ll MOD = 1e9+7;

int next_[200001];
int prev_[200001];
int jump[200001][20];
int jump2[200001][20];
int h[200001];
int odl[200001];
bitset<200001> odw;
int n;
bool subtask1 = true;

void init(int N, vector<int> H) 
{
  n = N;
  rep(i,n) h[i] = H[i];
  vector<pii> q;
  rep(i,n)
  {
    if(i != 0)
    {
      if(h[i] < h[i-1]) subtask1 = false;
    }
    while(size(q) > 0 && h[i] > q.back().ff) q.pop_back();
    if(size(q) != 0)
    {
      prev_[i] = q.back().ss;
    } 
    else prev_[i] = i;
    q.pb({h[i],i});
  }
  q = {};
  for(int i = n-1; i >= 0; i--)
  {
    while(size(q) > 0 && h[i] > q.back().ff) q.pop_back();
    if(size(q) != 0)
    {
      next_[i] = q.back().ss;
    } 
    else next_[i] = i;
    q.pb({h[i],i});
  }
  rep(i,n)
  {
    if(h[next_[i]] < h[prev_[i]])
    {
      swap(next_[i],prev_[i]);
    }
    cerr << i << " " << next_[i] << " " << prev_[i] << " nx prv\n";
    jump[i][0] = next_[i];
    if(prev_[i] != i) jump2[i][0] = prev_[i];
    else jump2[i][0] = next_[i];
  }
  rep2(bit,1,19)
  {
    rep(i,n)
    {
      jump[i][bit] = jump[jump[i][bit-1]][bit-1];
    }
  }
  rep2(bit,1,19)
  {
    rep(i,n)
    {
      jump2[i][bit] = jump2[jump2[i][bit-1]][bit-1];
    }
  }
}

int minimum_jumps(int A, int B, int C, int D) {
  bool subtask5 = A == B && C == D;
  //subtask5 = false;
  if(!subtask1 && !subtask5)
  {
    rep(i,n) odl[i] = 1e9;
    rep(i,n) odw[i] = 0;
    rep2(i,A,B) odl[i] = 0;
    queue<int> kol; 
    rep2(i,A,B) kol.push(i);
    int wyn = 1e9;
    while(!kol.empty())
    {
      int t = kol.front();
      kol.pop();
      if(odw[t] == 1) continue;
      if(t >= C && t <= D) wyn = min(wyn,odl[t]);
      odl[next_[t]] = min(odl[next_[t]],odl[t]+1);
      odl[prev_[t]] = min(odl[prev_[t]],odl[t]+1);
      kol.push(next_[t]);
      kol.push(prev_[t]);
      odw[t] = 1;
    }
    if(wyn == 1e9) return -1;
    return wyn;
  }
  else if(subtask1)
  {
    int ans = 1e9;
    if(C-B >= 0) ans = C-B;
    if(C <= B) ans = 0;
    if(ans == 1e9) return -1;
    return ans;    
  }
  else
  {
    if(A == C) return 0;
    int pocz = 0;
    int kon = 200000;
    int new_v = A;
    int bit = 19;
    int ans = 0;
    while(bit >= 0)
    {
      if(h[jump[new_v][bit]] >= h[C])
      {
        
      }
      else 
      {
        new_v = jump[new_v][bit];
        ans += (1 << bit);
      }
      bit--;
    }
    int v = new_v;
    cerr << v << " " << ans << " v\n";
    if(prev_[v] == C || next_[v] == C) return ans+1;
    bit = 19;
    while(bit >= 0)
    {
      if(h[jump2[v][bit]] >= h[C])
      {
        
      }
      else 
      {
        v = jump2[v][bit];
        ans += (1 << bit);
      }
      bit--;
    }
    cerr << v << " " << ans << " v\n";    
    if(h[v] > h[C]) return -1;
    if(prev_[v] == C || next_[v] == C) return ans+1;
    return -1;
  }
  return 0;
}

Compilation message

jumps.cpp: In function 'int minimum_jumps(int, int, int, int)':
jumps.cpp:128:9: warning: unused variable 'pocz' [-Wunused-variable]
  128 |     int pocz = 0;
      |         ^~~~
jumps.cpp:129:9: warning: unused variable 'kon' [-Wunused-variable]
  129 |     int kon = 200000;
      |         ^~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 6488 KB Output is correct
2 Correct 1 ms 6488 KB Output is correct
3 Correct 840 ms 39092 KB Output is correct
4 Correct 1572 ms 43060 KB Output is correct
5 Correct 987 ms 27792 KB Output is correct
6 Correct 1520 ms 43072 KB Output is correct
7 Correct 1111 ms 33820 KB Output is correct
8 Correct 1517 ms 43084 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 6488 KB Output is correct
2 Correct 1 ms 6488 KB Output is correct
3 Correct 1 ms 6488 KB Output is correct
4 Correct 0 ms 6488 KB Output is correct
5 Correct 1 ms 6488 KB Output is correct
6 Correct 2 ms 6488 KB Output is correct
7 Correct 2 ms 6488 KB Output is correct
8 Correct 2 ms 6488 KB Output is correct
9 Correct 2 ms 6600 KB Output is correct
10 Correct 3 ms 6488 KB Output is correct
11 Correct 3 ms 6612 KB Output is correct
12 Correct 2 ms 6488 KB Output is correct
13 Correct 3 ms 6488 KB Output is correct
14 Correct 2 ms 6488 KB Output is correct
15 Correct 3 ms 6608 KB Output is correct
16 Correct 2 ms 6488 KB Output is correct
17 Correct 2 ms 6612 KB Output is correct
18 Correct 0 ms 6488 KB Output is correct
19 Correct 1 ms 6488 KB Output is correct
20 Correct 3 ms 6488 KB Output is correct
21 Correct 2 ms 6488 KB Output is correct
22 Correct 2 ms 6488 KB Output is correct
23 Correct 2 ms 6488 KB Output is correct
24 Correct 2 ms 6488 KB Output is correct
25 Correct 1 ms 6596 KB Output is correct
26 Correct 0 ms 6488 KB Output is correct
27 Correct 2 ms 6488 KB Output is correct
28 Correct 4 ms 6488 KB Output is correct
29 Correct 3 ms 6488 KB Output is correct
30 Correct 4 ms 6488 KB Output is correct
31 Correct 3 ms 6616 KB Output is correct
32 Correct 4 ms 6488 KB Output is correct
33 Correct 0 ms 6488 KB Output is correct
34 Correct 3 ms 6488 KB Output is correct
35 Correct 1 ms 6488 KB Output is correct
36 Correct 1 ms 6488 KB Output is correct
37 Correct 1 ms 6488 KB Output is correct
38 Correct 1 ms 6488 KB Output is correct
39 Correct 2 ms 6536 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 6488 KB Output is correct
2 Correct 1 ms 6488 KB Output is correct
3 Correct 1 ms 6488 KB Output is correct
4 Correct 0 ms 6488 KB Output is correct
5 Correct 1 ms 6488 KB Output is correct
6 Correct 2 ms 6488 KB Output is correct
7 Correct 2 ms 6488 KB Output is correct
8 Correct 2 ms 6488 KB Output is correct
9 Correct 2 ms 6600 KB Output is correct
10 Correct 3 ms 6488 KB Output is correct
11 Correct 3 ms 6612 KB Output is correct
12 Correct 2 ms 6488 KB Output is correct
13 Correct 3 ms 6488 KB Output is correct
14 Correct 2 ms 6488 KB Output is correct
15 Correct 3 ms 6608 KB Output is correct
16 Correct 2 ms 6488 KB Output is correct
17 Correct 2 ms 6612 KB Output is correct
18 Correct 0 ms 6488 KB Output is correct
19 Correct 1 ms 6488 KB Output is correct
20 Correct 3 ms 6488 KB Output is correct
21 Correct 2 ms 6488 KB Output is correct
22 Correct 2 ms 6488 KB Output is correct
23 Correct 2 ms 6488 KB Output is correct
24 Correct 2 ms 6488 KB Output is correct
25 Correct 1 ms 6596 KB Output is correct
26 Correct 0 ms 6488 KB Output is correct
27 Correct 2 ms 6488 KB Output is correct
28 Correct 4 ms 6488 KB Output is correct
29 Correct 3 ms 6488 KB Output is correct
30 Correct 4 ms 6488 KB Output is correct
31 Correct 3 ms 6616 KB Output is correct
32 Correct 4 ms 6488 KB Output is correct
33 Correct 0 ms 6488 KB Output is correct
34 Correct 3 ms 6488 KB Output is correct
35 Correct 1 ms 6488 KB Output is correct
36 Correct 1 ms 6488 KB Output is correct
37 Correct 1 ms 6488 KB Output is correct
38 Correct 1 ms 6488 KB Output is correct
39 Correct 2 ms 6536 KB Output is correct
40 Correct 1 ms 6488 KB Output is correct
41 Correct 0 ms 6488 KB Output is correct
42 Correct 0 ms 6488 KB Output is correct
43 Correct 1 ms 6488 KB Output is correct
44 Correct 2 ms 6488 KB Output is correct
45 Correct 3 ms 6488 KB Output is correct
46 Correct 2 ms 6488 KB Output is correct
47 Correct 2 ms 6488 KB Output is correct
48 Correct 2 ms 6488 KB Output is correct
49 Correct 2 ms 6488 KB Output is correct
50 Correct 2 ms 6604 KB Output is correct
51 Correct 4 ms 6488 KB Output is correct
52 Correct 3 ms 6488 KB Output is correct
53 Correct 2 ms 6488 KB Output is correct
54 Correct 3 ms 6488 KB Output is correct
55 Correct 3 ms 6488 KB Output is correct
56 Correct 2 ms 6488 KB Output is correct
57 Correct 1 ms 6488 KB Output is correct
58 Correct 25 ms 6488 KB Output is correct
59 Correct 35 ms 6488 KB Output is correct
60 Correct 10 ms 6488 KB Output is correct
61 Correct 37 ms 6684 KB Output is correct
62 Correct 11 ms 6488 KB Output is correct
63 Correct 31 ms 6628 KB Output is correct
64 Correct 16 ms 6668 KB Output is correct
65 Correct 64 ms 6488 KB Output is correct
66 Correct 40 ms 6488 KB Output is correct
67 Correct 32 ms 6484 KB Output is correct
68 Correct 41 ms 6488 KB Output is correct
69 Correct 38 ms 6488 KB Output is correct
70 Correct 41 ms 6488 KB Output is correct
71 Correct 1 ms 6488 KB Output is correct
72 Correct 1 ms 6488 KB Output is correct
73 Correct 2 ms 6488 KB Output is correct
74 Correct 3 ms 6484 KB Output is correct
75 Correct 3 ms 6488 KB Output is correct
76 Correct 2 ms 6488 KB Output is correct
77 Correct 2 ms 6488 KB Output is correct
78 Correct 0 ms 6488 KB Output is correct
79 Correct 0 ms 6488 KB Output is correct
80 Correct 2 ms 6488 KB Output is correct
81 Correct 3 ms 6604 KB Output is correct
82 Correct 4 ms 6488 KB Output is correct
83 Correct 4 ms 6488 KB Output is correct
84 Correct 3 ms 6488 KB Output is correct
85 Correct 3 ms 6488 KB Output is correct
86 Correct 0 ms 6488 KB Output is correct
87 Correct 1 ms 6488 KB Output is correct
88 Correct 2 ms 6740 KB Output is correct
89 Correct 1 ms 6488 KB Output is correct
90 Correct 2 ms 6488 KB Output is correct
91 Correct 1 ms 6488 KB Output is correct
92 Correct 2 ms 6572 KB Output is correct
93 Correct 1 ms 6600 KB Output is correct
94 Correct 4 ms 6488 KB Output is correct
95 Correct 31 ms 6488 KB Output is correct
96 Correct 40 ms 6488 KB Output is correct
97 Correct 32 ms 6652 KB Output is correct
98 Correct 40 ms 6488 KB Output is correct
99 Correct 51 ms 6488 KB Output is correct
100 Correct 2 ms 6488 KB Output is correct
101 Correct 6 ms 6488 KB Output is correct
102 Correct 34 ms 6664 KB Output is correct
103 Correct 25 ms 6488 KB Output is correct
104 Correct 32 ms 6488 KB Output is correct
105 Correct 29 ms 6488 KB Output is correct
106 Correct 30 ms 6704 KB Output is correct
107 Correct 2 ms 6488 KB Output is correct
108 Correct 5 ms 6488 KB Output is correct
109 Correct 10 ms 6628 KB Output is correct
110 Correct 10 ms 6672 KB Output is correct
111 Correct 11 ms 6488 KB Output is correct
112 Correct 11 ms 6488 KB Output is correct
113 Correct 11 ms 6488 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 6488 KB Output is correct
2 Correct 1 ms 6488 KB Output is correct
3 Correct 1 ms 6488 KB Output is correct
4 Correct 0 ms 6488 KB Output is correct
5 Correct 817 ms 37816 KB Output is correct
6 Correct 993 ms 41492 KB Output is correct
7 Correct 513 ms 26960 KB Output is correct
8 Correct 1006 ms 42560 KB Output is correct
9 Correct 170 ms 11760 KB Output is correct
10 Correct 1034 ms 41420 KB Output is correct
11 Correct 1020 ms 43136 KB Output is correct
12 Correct 1099 ms 42652 KB Output is correct
13 Correct 1046 ms 42656 KB Output is correct
14 Correct 1018 ms 41600 KB Output is correct
15 Correct 1029 ms 42436 KB Output is correct
16 Correct 1022 ms 43464 KB Output is correct
17 Correct 1008 ms 43096 KB Output is correct
18 Correct 1 ms 6488 KB Output is correct
19 Correct 1 ms 6488 KB Output is correct
20 Correct 2 ms 6488 KB Output is correct
21 Correct 1 ms 6488 KB Output is correct
22 Correct 2 ms 6488 KB Output is correct
23 Correct 2 ms 6488 KB Output is correct
24 Correct 1 ms 6488 KB Output is correct
25 Correct 2 ms 6488 KB Output is correct
26 Correct 5 ms 6488 KB Output is correct
27 Correct 10 ms 6640 KB Output is correct
28 Correct 11 ms 6488 KB Output is correct
29 Correct 10 ms 6656 KB Output is correct
30 Correct 11 ms 6488 KB Output is correct
31 Correct 11 ms 6660 KB Output is correct
32 Correct 0 ms 6488 KB Output is correct
33 Correct 1000 ms 41552 KB Output is correct
34 Correct 1057 ms 41528 KB Output is correct
35 Correct 1022 ms 42772 KB Output is correct
36 Correct 1064 ms 41612 KB Output is correct
37 Correct 1018 ms 42556 KB Output is correct
38 Correct 1012 ms 43200 KB Output is correct
39 Correct 1 ms 6488 KB Output is correct
40 Correct 583 ms 29560 KB Output is correct
41 Correct 998 ms 41460 KB Output is correct
42 Correct 1000 ms 42944 KB Output is correct
43 Correct 1022 ms 41552 KB Output is correct
44 Correct 1028 ms 42432 KB Output is correct
45 Correct 1004 ms 43100 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 6488 KB Output is correct
2 Correct 1 ms 6488 KB Output is correct
3 Correct 0 ms 6488 KB Output is correct
4 Correct 788 ms 24964 KB Output is correct
5 Correct 2360 ms 43372 KB Output is correct
6 Correct 1088 ms 13416 KB Output is correct
7 Correct 2338 ms 43136 KB Output is correct
8 Correct 1242 ms 20400 KB Output is correct
9 Correct 2326 ms 43572 KB Output is correct
10 Correct 1565 ms 43200 KB Output is correct
11 Correct 2299 ms 43660 KB Output is correct
12 Correct 2024 ms 42948 KB Output is correct
13 Correct 2342 ms 42980 KB Output is correct
14 Correct 2173 ms 43752 KB Output is correct
15 Correct 2345 ms 43456 KB Output is correct
16 Correct 2252 ms 43432 KB Output is correct
17 Correct 1 ms 6488 KB Output is correct
18 Correct 1 ms 6488 KB Output is correct
19 Correct 2 ms 6488 KB Output is correct
20 Correct 4 ms 6488 KB Output is correct
21 Correct 3 ms 6488 KB Output is correct
22 Correct 5 ms 6488 KB Output is correct
23 Correct 4 ms 6488 KB Output is correct
24 Correct 3 ms 6488 KB Output is correct
25 Correct 1 ms 6488 KB Output is correct
26 Correct 5 ms 6488 KB Output is correct
27 Correct 32 ms 6488 KB Output is correct
28 Correct 29 ms 6708 KB Output is correct
29 Correct 39 ms 6920 KB Output is correct
30 Correct 29 ms 6488 KB Output is correct
31 Correct 41 ms 6700 KB Output is correct
32 Correct 1 ms 6488 KB Output is correct
33 Correct 585 ms 29492 KB Output is correct
34 Correct 1037 ms 41476 KB Output is correct
35 Correct 1044 ms 42944 KB Output is correct
36 Correct 1093 ms 41504 KB Output is correct
37 Correct 1084 ms 42292 KB Output is correct
38 Correct 1051 ms 43204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 6488 KB Output is correct
2 Correct 1 ms 6488 KB Output is correct
3 Correct 0 ms 6488 KB Output is correct
4 Correct 788 ms 24964 KB Output is correct
5 Correct 2360 ms 43372 KB Output is correct
6 Correct 1088 ms 13416 KB Output is correct
7 Correct 2338 ms 43136 KB Output is correct
8 Correct 1242 ms 20400 KB Output is correct
9 Correct 2326 ms 43572 KB Output is correct
10 Correct 1565 ms 43200 KB Output is correct
11 Correct 2299 ms 43660 KB Output is correct
12 Correct 2024 ms 42948 KB Output is correct
13 Correct 2342 ms 42980 KB Output is correct
14 Correct 2173 ms 43752 KB Output is correct
15 Correct 2345 ms 43456 KB Output is correct
16 Correct 2252 ms 43432 KB Output is correct
17 Correct 1 ms 6488 KB Output is correct
18 Correct 1 ms 6488 KB Output is correct
19 Correct 2 ms 6488 KB Output is correct
20 Correct 4 ms 6488 KB Output is correct
21 Correct 3 ms 6488 KB Output is correct
22 Correct 5 ms 6488 KB Output is correct
23 Correct 4 ms 6488 KB Output is correct
24 Correct 3 ms 6488 KB Output is correct
25 Correct 1 ms 6488 KB Output is correct
26 Correct 5 ms 6488 KB Output is correct
27 Correct 32 ms 6488 KB Output is correct
28 Correct 29 ms 6708 KB Output is correct
29 Correct 39 ms 6920 KB Output is correct
30 Correct 29 ms 6488 KB Output is correct
31 Correct 41 ms 6700 KB Output is correct
32 Correct 1 ms 6488 KB Output is correct
33 Correct 585 ms 29492 KB Output is correct
34 Correct 1037 ms 41476 KB Output is correct
35 Correct 1044 ms 42944 KB Output is correct
36 Correct 1093 ms 41504 KB Output is correct
37 Correct 1084 ms 42292 KB Output is correct
38 Correct 1051 ms 43204 KB Output is correct
39 Correct 1 ms 6488 KB Output is correct
40 Correct 1 ms 6488 KB Output is correct
41 Correct 1 ms 6488 KB Output is correct
42 Correct 750 ms 25368 KB Output is correct
43 Correct 2312 ms 43096 KB Output is correct
44 Correct 1111 ms 13212 KB Output is correct
45 Correct 2318 ms 42980 KB Output is correct
46 Correct 1186 ms 20652 KB Output is correct
47 Correct 2400 ms 43372 KB Output is correct
48 Correct 1600 ms 43100 KB Output is correct
49 Correct 2296 ms 43528 KB Output is correct
50 Correct 2051 ms 43324 KB Output is correct
51 Correct 2271 ms 43184 KB Output is correct
52 Correct 2179 ms 42912 KB Output is correct
53 Correct 2325 ms 43208 KB Output is correct
54 Correct 2314 ms 43156 KB Output is correct
55 Correct 1 ms 6488 KB Output is correct
56 Execution timed out 4018 ms 42512 KB Time limit exceeded
57 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 6488 KB Output is correct
2 Correct 1 ms 6488 KB Output is correct
3 Correct 840 ms 39092 KB Output is correct
4 Correct 1572 ms 43060 KB Output is correct
5 Correct 987 ms 27792 KB Output is correct
6 Correct 1520 ms 43072 KB Output is correct
7 Correct 1111 ms 33820 KB Output is correct
8 Correct 1517 ms 43084 KB Output is correct
9 Correct 1 ms 6488 KB Output is correct
10 Correct 1 ms 6488 KB Output is correct
11 Correct 1 ms 6488 KB Output is correct
12 Correct 0 ms 6488 KB Output is correct
13 Correct 1 ms 6488 KB Output is correct
14 Correct 2 ms 6488 KB Output is correct
15 Correct 2 ms 6488 KB Output is correct
16 Correct 2 ms 6488 KB Output is correct
17 Correct 2 ms 6600 KB Output is correct
18 Correct 3 ms 6488 KB Output is correct
19 Correct 3 ms 6612 KB Output is correct
20 Correct 2 ms 6488 KB Output is correct
21 Correct 3 ms 6488 KB Output is correct
22 Correct 2 ms 6488 KB Output is correct
23 Correct 3 ms 6608 KB Output is correct
24 Correct 2 ms 6488 KB Output is correct
25 Correct 2 ms 6612 KB Output is correct
26 Correct 0 ms 6488 KB Output is correct
27 Correct 1 ms 6488 KB Output is correct
28 Correct 3 ms 6488 KB Output is correct
29 Correct 2 ms 6488 KB Output is correct
30 Correct 2 ms 6488 KB Output is correct
31 Correct 2 ms 6488 KB Output is correct
32 Correct 2 ms 6488 KB Output is correct
33 Correct 1 ms 6596 KB Output is correct
34 Correct 0 ms 6488 KB Output is correct
35 Correct 2 ms 6488 KB Output is correct
36 Correct 4 ms 6488 KB Output is correct
37 Correct 3 ms 6488 KB Output is correct
38 Correct 4 ms 6488 KB Output is correct
39 Correct 3 ms 6616 KB Output is correct
40 Correct 4 ms 6488 KB Output is correct
41 Correct 0 ms 6488 KB Output is correct
42 Correct 3 ms 6488 KB Output is correct
43 Correct 1 ms 6488 KB Output is correct
44 Correct 1 ms 6488 KB Output is correct
45 Correct 1 ms 6488 KB Output is correct
46 Correct 1 ms 6488 KB Output is correct
47 Correct 2 ms 6536 KB Output is correct
48 Correct 1 ms 6488 KB Output is correct
49 Correct 0 ms 6488 KB Output is correct
50 Correct 0 ms 6488 KB Output is correct
51 Correct 1 ms 6488 KB Output is correct
52 Correct 2 ms 6488 KB Output is correct
53 Correct 3 ms 6488 KB Output is correct
54 Correct 2 ms 6488 KB Output is correct
55 Correct 2 ms 6488 KB Output is correct
56 Correct 2 ms 6488 KB Output is correct
57 Correct 2 ms 6488 KB Output is correct
58 Correct 2 ms 6604 KB Output is correct
59 Correct 4 ms 6488 KB Output is correct
60 Correct 3 ms 6488 KB Output is correct
61 Correct 2 ms 6488 KB Output is correct
62 Correct 3 ms 6488 KB Output is correct
63 Correct 3 ms 6488 KB Output is correct
64 Correct 2 ms 6488 KB Output is correct
65 Correct 1 ms 6488 KB Output is correct
66 Correct 25 ms 6488 KB Output is correct
67 Correct 35 ms 6488 KB Output is correct
68 Correct 10 ms 6488 KB Output is correct
69 Correct 37 ms 6684 KB Output is correct
70 Correct 11 ms 6488 KB Output is correct
71 Correct 31 ms 6628 KB Output is correct
72 Correct 16 ms 6668 KB Output is correct
73 Correct 64 ms 6488 KB Output is correct
74 Correct 40 ms 6488 KB Output is correct
75 Correct 32 ms 6484 KB Output is correct
76 Correct 41 ms 6488 KB Output is correct
77 Correct 38 ms 6488 KB Output is correct
78 Correct 41 ms 6488 KB Output is correct
79 Correct 1 ms 6488 KB Output is correct
80 Correct 1 ms 6488 KB Output is correct
81 Correct 2 ms 6488 KB Output is correct
82 Correct 3 ms 6484 KB Output is correct
83 Correct 3 ms 6488 KB Output is correct
84 Correct 2 ms 6488 KB Output is correct
85 Correct 2 ms 6488 KB Output is correct
86 Correct 0 ms 6488 KB Output is correct
87 Correct 0 ms 6488 KB Output is correct
88 Correct 2 ms 6488 KB Output is correct
89 Correct 3 ms 6604 KB Output is correct
90 Correct 4 ms 6488 KB Output is correct
91 Correct 4 ms 6488 KB Output is correct
92 Correct 3 ms 6488 KB Output is correct
93 Correct 3 ms 6488 KB Output is correct
94 Correct 0 ms 6488 KB Output is correct
95 Correct 1 ms 6488 KB Output is correct
96 Correct 2 ms 6740 KB Output is correct
97 Correct 1 ms 6488 KB Output is correct
98 Correct 2 ms 6488 KB Output is correct
99 Correct 1 ms 6488 KB Output is correct
100 Correct 2 ms 6572 KB Output is correct
101 Correct 1 ms 6600 KB Output is correct
102 Correct 4 ms 6488 KB Output is correct
103 Correct 31 ms 6488 KB Output is correct
104 Correct 40 ms 6488 KB Output is correct
105 Correct 32 ms 6652 KB Output is correct
106 Correct 40 ms 6488 KB Output is correct
107 Correct 51 ms 6488 KB Output is correct
108 Correct 2 ms 6488 KB Output is correct
109 Correct 6 ms 6488 KB Output is correct
110 Correct 34 ms 6664 KB Output is correct
111 Correct 25 ms 6488 KB Output is correct
112 Correct 32 ms 6488 KB Output is correct
113 Correct 29 ms 6488 KB Output is correct
114 Correct 30 ms 6704 KB Output is correct
115 Correct 2 ms 6488 KB Output is correct
116 Correct 5 ms 6488 KB Output is correct
117 Correct 10 ms 6628 KB Output is correct
118 Correct 10 ms 6672 KB Output is correct
119 Correct 11 ms 6488 KB Output is correct
120 Correct 11 ms 6488 KB Output is correct
121 Correct 11 ms 6488 KB Output is correct
122 Correct 1 ms 6488 KB Output is correct
123 Correct 1 ms 6488 KB Output is correct
124 Correct 1 ms 6488 KB Output is correct
125 Correct 0 ms 6488 KB Output is correct
126 Correct 817 ms 37816 KB Output is correct
127 Correct 993 ms 41492 KB Output is correct
128 Correct 513 ms 26960 KB Output is correct
129 Correct 1006 ms 42560 KB Output is correct
130 Correct 170 ms 11760 KB Output is correct
131 Correct 1034 ms 41420 KB Output is correct
132 Correct 1020 ms 43136 KB Output is correct
133 Correct 1099 ms 42652 KB Output is correct
134 Correct 1046 ms 42656 KB Output is correct
135 Correct 1018 ms 41600 KB Output is correct
136 Correct 1029 ms 42436 KB Output is correct
137 Correct 1022 ms 43464 KB Output is correct
138 Correct 1008 ms 43096 KB Output is correct
139 Correct 1 ms 6488 KB Output is correct
140 Correct 1 ms 6488 KB Output is correct
141 Correct 2 ms 6488 KB Output is correct
142 Correct 1 ms 6488 KB Output is correct
143 Correct 2 ms 6488 KB Output is correct
144 Correct 2 ms 6488 KB Output is correct
145 Correct 1 ms 6488 KB Output is correct
146 Correct 2 ms 6488 KB Output is correct
147 Correct 5 ms 6488 KB Output is correct
148 Correct 10 ms 6640 KB Output is correct
149 Correct 11 ms 6488 KB Output is correct
150 Correct 10 ms 6656 KB Output is correct
151 Correct 11 ms 6488 KB Output is correct
152 Correct 11 ms 6660 KB Output is correct
153 Correct 0 ms 6488 KB Output is correct
154 Correct 1000 ms 41552 KB Output is correct
155 Correct 1057 ms 41528 KB Output is correct
156 Correct 1022 ms 42772 KB Output is correct
157 Correct 1064 ms 41612 KB Output is correct
158 Correct 1018 ms 42556 KB Output is correct
159 Correct 1012 ms 43200 KB Output is correct
160 Correct 1 ms 6488 KB Output is correct
161 Correct 583 ms 29560 KB Output is correct
162 Correct 998 ms 41460 KB Output is correct
163 Correct 1000 ms 42944 KB Output is correct
164 Correct 1022 ms 41552 KB Output is correct
165 Correct 1028 ms 42432 KB Output is correct
166 Correct 1004 ms 43100 KB Output is correct
167 Correct 1 ms 6488 KB Output is correct
168 Correct 1 ms 6488 KB Output is correct
169 Correct 0 ms 6488 KB Output is correct
170 Correct 788 ms 24964 KB Output is correct
171 Correct 2360 ms 43372 KB Output is correct
172 Correct 1088 ms 13416 KB Output is correct
173 Correct 2338 ms 43136 KB Output is correct
174 Correct 1242 ms 20400 KB Output is correct
175 Correct 2326 ms 43572 KB Output is correct
176 Correct 1565 ms 43200 KB Output is correct
177 Correct 2299 ms 43660 KB Output is correct
178 Correct 2024 ms 42948 KB Output is correct
179 Correct 2342 ms 42980 KB Output is correct
180 Correct 2173 ms 43752 KB Output is correct
181 Correct 2345 ms 43456 KB Output is correct
182 Correct 2252 ms 43432 KB Output is correct
183 Correct 1 ms 6488 KB Output is correct
184 Correct 1 ms 6488 KB Output is correct
185 Correct 2 ms 6488 KB Output is correct
186 Correct 4 ms 6488 KB Output is correct
187 Correct 3 ms 6488 KB Output is correct
188 Correct 5 ms 6488 KB Output is correct
189 Correct 4 ms 6488 KB Output is correct
190 Correct 3 ms 6488 KB Output is correct
191 Correct 1 ms 6488 KB Output is correct
192 Correct 5 ms 6488 KB Output is correct
193 Correct 32 ms 6488 KB Output is correct
194 Correct 29 ms 6708 KB Output is correct
195 Correct 39 ms 6920 KB Output is correct
196 Correct 29 ms 6488 KB Output is correct
197 Correct 41 ms 6700 KB Output is correct
198 Correct 1 ms 6488 KB Output is correct
199 Correct 585 ms 29492 KB Output is correct
200 Correct 1037 ms 41476 KB Output is correct
201 Correct 1044 ms 42944 KB Output is correct
202 Correct 1093 ms 41504 KB Output is correct
203 Correct 1084 ms 42292 KB Output is correct
204 Correct 1051 ms 43204 KB Output is correct
205 Correct 1 ms 6488 KB Output is correct
206 Correct 1 ms 6488 KB Output is correct
207 Correct 1 ms 6488 KB Output is correct
208 Correct 750 ms 25368 KB Output is correct
209 Correct 2312 ms 43096 KB Output is correct
210 Correct 1111 ms 13212 KB Output is correct
211 Correct 2318 ms 42980 KB Output is correct
212 Correct 1186 ms 20652 KB Output is correct
213 Correct 2400 ms 43372 KB Output is correct
214 Correct 1600 ms 43100 KB Output is correct
215 Correct 2296 ms 43528 KB Output is correct
216 Correct 2051 ms 43324 KB Output is correct
217 Correct 2271 ms 43184 KB Output is correct
218 Correct 2179 ms 42912 KB Output is correct
219 Correct 2325 ms 43208 KB Output is correct
220 Correct 2314 ms 43156 KB Output is correct
221 Correct 1 ms 6488 KB Output is correct
222 Execution timed out 4018 ms 42512 KB Time limit exceeded
223 Halted 0 ms 0 KB -