func_code_string: #include <bits/stdc++.h>   using namespace std;   const int base = 998244353;   int sum(int a, int b) {     int c = a + b;     if (c >= base) return c - base;     return c;   }   int diff(int a, int b) {     int c = a - b;     if (c < 0) return c + base;     return c;   }   int mul(int a, int b) { return (int)(a * (long long)b % base); }   int pow(int a, int b) {     if (!b) return 1;     if (b == 1) return a;     int d = pow(mul(a, a), b / 2);     if (b % 2) return mul(d, a);     return d;   }   int divis(int a, int b) { return mul(a, pow(b, base - 2)); }   struct segment_tree {    public:     segment_tree() : ts(0) {}     explicit segment_tree(vector<int> &p) : ts(1) {       size_t n = p.size();       while (ts < n) {         ts <<= 1u;       }       st.resize(2 * ts);       for (int i = ts; i < ts + n; ++i) {         st[i] = p[i - ts];       }       for (int i = (int)ts - 1; i; --i) {         st[i] = mul(st[i * 2], st[2 * i + 1]);       }     }     int get_mul(int l, int r) {       l += ts;       r += (int)ts - 1;       int res = 1;       while (l <= r) {         if (l % 2) {           res = mul(res, st[l++]);         }         if (r % 2 == 0) {           res = mul(res, st[r--]);         }         l /= 2;         r /= 2;       }       return res;     }       private:     size_t ts;     vector<int> st;   };   int main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     int n, q;     cin >> n >> q;     vector<int> p(n);     for (auto &x : p) {       cin >> x;     }     segment_tree st(p);     vector<int> deg100(n + 1), pref(n + 1);     deg100[0] = pref[0] = 1;     for (int i = 1; i <= n; ++i) {       deg100[i] = mul(100, deg100[i - 1]);     }     for (int i = 1; i <= n; ++i) {       pref[i] = mul(pref[i - 1], p[i - 1]);     }     vector<int> dot_product(n);     dot_product[0] = 100;     for (int i = 1; i < n; ++i) {       dot_product[i] = mul(100, sum(dot_product[i - 1], pref[i]));     }     int ans = divis(dot_product.back(), pref[n]);     set<pair<int, int>> ind = {{0, ans}, {n, 0}};     function<int(int, int)> func = [&](int l, int r) {       if (r - l == 1) {         return 100;       }       int res = dot_product[r - 1];       int a = 0;       if (l) {         a = mul(deg100[r - l], dot_product[l - 1]);       }       res = diff(res, a);       return divis(res, pref[l]);     };     while (q--) {       int i;       cin >> i;       --i;       auto v = ind.lower_bound({i, 0});       if (v->first != i) {         int r = v->first;         --v;         int l = v->first;         ans = diff(ans, v->second);         int fst = divis(func(l, i), st.get_mul(l, i));         int snd = divis(func(i, r), st.get_mul(i, r));         ind.insert({v->first, fst});         ind.erase(v);         ind.insert({i, snd});         ans = sum(ans, fst);         ans = sum(ans, snd);       } else {         auto u = prev(v);         ans = diff(ans, v->second);         ans = diff(ans, u->second);         ind.erase(v);         int l = u->first, r = next(u)->first;         int val = divis(func(l, r), st.get_mul(l, r));         ans = sum(ans, val);         ind.insert({u->first, val});         ind.erase(u);       }       cout << ans <<   n ;     }     return 0;   }   