func_code_string: #include <bits/stdc++.h>   using namespace std;   const int maxn = 3000 + 12;   int p[maxn];   int Et[maxn];   int mark[maxn][maxn];   queue<pair<int, int> > act;   void input(int n) {     for (int i = 0; i < n; i++) cin >> p[i];   }   void solve(int n, int k) {     int sef = 0;     bool yek = 0;     for (int j = n - 1; j >= 0; j--) {       if (p[j] == 0) sef++;       if (p[j] == 100) yek = 1;       if (sef == n - j) Et[j] = 1;       if (yek) Et[j] = 2;     }     act.push(make_pair(0, 1));     mark[0][1] = 0;     int ans = 0;     int x = 0, y = 1;     while (act.size() && mark[x][y] <= k) {       pair<int, int> a = act.front();       x = a.first, y = a.second;       if (mark[x][y] <= k) ans++;       if (Et[y] != 1 && p[x] != 0 && y + 2 <= n + 1 &&           mark[y + 1][y + 2] > mark[x][y] + 1)         act.push(make_pair(y + 1, y + 2)), mark[y + 1][y + 2] = mark[x][y] + 1;       if (Et[y] != 2 && p[x] != 0 && y + 1 <= n &&           mark[x][y + 1] > mark[x][y] + 1)         act.push(make_pair(x, y + 1)), mark[x][y + 1] = mark[x][y] + 1;       if (Et[y] != 1 && p[x] != 100 && y + 1 <= n &&           mark[y][y + 1] > mark[x][y] + 1)         act.push(make_pair(y, y + 1)), mark[y][y + 1] = mark[x][y] + 1;       act.pop();     }     cout << ans;   }   int main() {     int n, k;     cin >> n >> k;     input(n);     memset(mark, 31, sizeof mark);     solve(n, k);     return 0;   }   