[TASK]:
You will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.

[INSTRUCTION]:
The following libraries are already included in the code.
```cpp
#include <cstdio>
#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <cstring>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <fstream>
#include <climits>
#include <cassert>
#include <iomanip>
#include <sstream>
#include <bitset>
using namespace std;
```
Do not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.

[PSEUDOCODE]:
MAXN = a constant set to 100005
MOD = and constant set to 998244353
a = an array of integers with a length of MAXN
dp = a 2 dimentional array of integers with a length of 201
newdp = a 2 dimentional array of integers with a length of 201
define the main function
    n = integer
    read n
    for i = 0 to n exclusive, read index i of a
    for i = 0 to n exclusive
        if i = 0
            if index i of a = -1
                for x = 1 to 200 inclusive, set newdp[x][0] = 1
            else
                newdp[a[i]][0] = 1
            end of the block
        else
            if index i of a = -1
                flag0 = integer set to 0
                flag1 = integer set to 0
                for y = 1 to 200 inclusive
                    add dp[y][1] to flag1
                    modulo flag1 by MOD
                end of the block
                for x = 1 to 200 inclusive
                    subtract dp[x - 1][1] from flag1
                    add MOD to flag1
                    modulo flag1 by MOD
                    subtract dp[x - 1][0] from flag1
                    add MOD to flag1
                    modulo flag1 by MOD
                    add dp[x - 1][1] to flag0
                    modulo flag0 by MOD
                    add dp[x - 1][0] to flag0
                    modulo flag0 by MOD
                    add dp[x][0] to flag1
                    modulo flag1 by MOD
                    set newdp[x][0] to flag0
                    set newdp[x][1] to flag1
                end of the block
            else
                x = integer set to index i of a
                for y = 1 to 200 inclusive
                    flag = integer set to 1 if x <= y or 0
                    add dp[y][1] to newdp[x][flag]
                    modulo newdp[x][flag] by MOD
                    if y <= x
                        add dp[y][0] to newdp[x][flag]
                        modulo newdp[x][flag] by MOD
                    end of the block
                end of the block
            end of the block
        end of the block
        run memcpy with dp, newdp and 201 * 2 * 4 as arguments
        run memset with newdp, 0, and 201 * 2 * 4 as arguments
    end of the block
    ans = integer set to 0
    for x = 1 to 200 inclusive
        add dp[x][1] to ans
        modulo ans by MOD
    end of the block
    read ans
    return to indicate successful execution
end of the block

[CODE]:

const int MAXN = 100005;
const int MOD = 998244353;
int a[MAXN];
int dp[201][2];
int newdp[201][2];
int main() {
    int n;
    cin >> n;
    for (int i = 0; i < n; ++i) { cin >> a[i]; }
    for (int i = 0; i < n; ++i) {
        if (i == 0) {
            if (a[i] == -1) {
                for (int x = 1; x <= 200; ++x) { newdp[x][0] = 1; }
            } else {
                newdp[a[i]][0] = 1;
            }
        } else {
            if (a[i] == -1) {
                int flag0 = 0;
                int flag1 = 0;
                for (int y = 1; y <= 200; ++y) {
                    flag1 += dp[y][1];
                    flag1 %= MOD;
                }
                for (int x = 1; x <= 200; ++x) {
                    flag1 -= dp[x - 1][1];
                    flag1 += MOD;
                    flag1 %= MOD;
                    flag1 -= dp[x - 1][0];
                    flag1 += MOD;
                    flag1 %= MOD;
                    flag0 += dp[x - 1][1];
                    flag0 %= MOD;
                    flag0 += dp[x - 1][0];
                    flag0 %= MOD;
                    flag1 += dp[x][0];
                    flag1 %= MOD;
                    newdp[x][0] = flag0;
                    newdp[x][1] = flag1;
                }
            } else {
                int x = a[i];
                for (int y = 1; y <= 200; ++y) {
                    int flag = x <= y ? 1 : 0;
                    newdp[x][flag] += dp[y][1];
                    newdp[x][flag] %= MOD;
                    if (y <= x) {
                        newdp[x][flag] += dp[y][0];
                        newdp[x][flag] %= MOD;
                    }
                }
            }
        }
        memcpy(dp, newdp, 201 * 2 * 4);
        memset(newdp, 0, 201 * 2 * 4);
    }
    int ans = 0;
    for (int x = 1; x <= 200; ++x) {
        ans += dp[x][1];
        ans %= MOD;
    }
    cout << ans << endl;
    return 0;
}