[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]:
create integer N, create integer array arr with size 100001
create 3d long long array dp with size 100001 by 201 by 2
define the main function
    read N
    for i = 1 to N inclusive, read arr[i]
    for i = 1 to N inclusive
        if arr[i] is not -1
            if i is 1
                set dp[i][arr[i]][0] to 1
            else
                for j = 1 to arr[i] exclusive
                    increment dp[i][arr[i]][0] by dp[i - 1][j][0] + dp[i - 1][j][1]
                    set dp[i][arr[i]][0] to dp[i][arr[i]][0] % 998244353
                end of the block
                increment dp[i][arr[i]][1] by dp[i - 1][arr[i]][0]
                set dp[i][arr[i]][1] to dp[i][arr[i]][1] % 998244353
                for j = arr[i] to 200 inclusive
                    increment dp[i][arr[i]][1] by dp[i - 1][j][1]
                    set dp[i][arr[i]][1] to dp[i][arr[i]][1] % 998244353
                end of the block
            end of the block
        else
            if i is 1
                for j = 1 to 200 inclusive, set dp[i][j][0] to 1
            else
                create long long temp with temp = 0
                for j = 1 to 200 inclusive
                    increment dp[i][j][1] by dp[i-1][j][0]
                    set dp[i][j][1] to dp[i][j][1] % 998244353
                    increment dp[i][j][0] by temp
                    set dp[i][j][0] to dp[i][j][0] % 998244353
                    increment temp by dp[i - 1][j][0]
                    set temp to temp % 998244353
                end of the block
                set temp to 0
                for j = 200 to 1 inclusive, decrementing i
                    increment temp by dp[i - 1][j][1]
                    set temp to temp % 998244353
                    increment dp[i][j][1] by temp
                    set dp[i][j][1] to dp[i][j][1] % 998244353
                end of the block
                set temp to 0
                for j = 1 to 200 inclusive
                    increment dp[i][j][0] by temp
                    set dp[i][j][0] to dp[i][j][0] % 998244353
                    increment temp by dp[i - 1][j][1]
                    set temp to temp % 998244353
                end of the block
            end of the block
        end of the block
    end of the block
    create long long ans with ans = 0
    for i = 1 to 200 inclusive, set ans to (ans + dp[N][i][1]) % 998244353
    print ans print '\n'
    return to indicate successful execution
end of the block

[CODE]:

int N, arr[100001];
long long dp[100001][201][2];
int main() {
    cin >> N;
    for (int i = 1; i <= N; i++) cin >> arr[i];
    for (int i = 1; i <= N; i++) {
        if (arr[i] != -1) {
            if (i == 1)
                dp[i][arr[i]][0] = 1;
            else {
                for (int j = 1; j < arr[i]; j++) {
                    dp[i][arr[i]][0] += dp[i - 1][j][0] + dp[i - 1][j][1];
                    dp[i][arr[i]][0] %= 998244353;
                }
                dp[i][arr[i]][1] += dp[i - 1][arr[i]][0];
                dp[i][arr[i]][1] %= 998244353;
                for (int j = arr[i]; j <= 200; j++) {
                    dp[i][arr[i]][1] += dp[i - 1][j][1];
                    dp[i][arr[i]][1] %= 998244353;
                }
            }
        } else {
            if (i == 1) {
                for (int j = 1; j <= 200; j++) dp[i][j][0] = 1;
            } else {
                long long temp = 0;
                for (int j = 1; j <= 200; j++) {
                    dp[i][j][1] += dp[i - 1][j][0];
                    dp[i][j][1] %= 998244353;
                    dp[i][j][0] += temp;
                    dp[i][j][0] %= 998244353;
                    temp += dp[i - 1][j][0];
                    temp %= 998244353;
                }
                temp = 0;
                for (int j = 200; j >= 1; j--) {
                    temp += dp[i - 1][j][1];
                    temp %= 998244353;
                    dp[i][j][1] += temp;
                    dp[i][j][1] %= 998244353;
                }
                temp = 0;
                for (int j = 1; j <= 200; j++) {
                    dp[i][j][0] += temp;
                    dp[i][j][0] %= 998244353;
                    temp += dp[i - 1][j][1];
                    temp %= 998244353;
                }
            }
        }
    }
    long long ans = 0;
    for (int i = 1; i <= 200; i++) ans = (ans + dp[N][i][1]) % 998244353;
    cout << ans << '\n';
    return 0;
}