func_code_string: #include <bits/stdc++.h>   using namespace std;   int segtree[400001];   int val[100001];   int inf = (1 << 30) - 1;   void build(int l, int r, int pos) {     if (l == r) {       segtree[pos] = val[r];       return;     }     int mid = (l + r) / 2;     build(l, mid, 2 * pos + 1);     build(mid + 1, r, 2 * pos + 2);     segtree[pos] = (segtree[2 * pos + 1] & segtree[2 * pos + 2]);   }   int query(int lq, int rq, int l, int r, int pos) {     if (rq < l || lq > r) return inf;     if (lq <= l && r <= rq) return segtree[pos];     int mid = (l + r) / 2;     return query(lq, rq, l, mid, 2 * pos + 1) &            query(lq, rq, mid + 1, r, 2 * pos + 2);   }   int main() {     int n;     cin >> n;     int m;     cin >> m;     int flag[n + 1][30];     memset(flag, 0, sizeof flag);     int l[m], r[m], v[m];     for (int i = 0; i < m; i++) {       cin >> l[i] >> r[i] >> v[i];       l[i]--;       r[i]--;       for (int j = 0; j < 30; j++) {         if (v[i] & (1 << j)) {           flag[l[i]][j] += 1;           flag[r[i] + 1][j] -= 1;         }       }     }     for (int j = 0; j < 30; j++) {       for (int i = 1; i < n; i++) {         flag[i][j] += flag[i - 1][j];       }     }     for (int i = 0; i < n; i++) {       val[i] = 0;       for (int j = 0; j < 30; j++) {         if (flag[i][j]) val[i] += (1 << j);       }     }     build(0, n - 1, 0);     for (int i = 0; i < m; i++) {       if (query(l[i], r[i], 0, n - 1, 0) != v[i]) {         cout <<  NO ;         return 0;       }     }     cout <<  YES n ;     for (int j = 0; j < n; j++) cout << val[j] <<    ;   }   