func_code_string: #include <bits/stdc++.h>   using namespace std;   const double eps = 1e-9;   const double pi = acos(-1.0);   int a[32][101111], n, m, d[32][111111], b[111111], t[400111];   pair<pair<int, int>, int> p[111111];   int bit(int mask, int i) { return (mask & (1 << i)) > 0; }   void build(int v, int tl, int tr) {     if (tl == tr)       t[v] = b[tl];     else {       int tm = (tl + tr) / 2;       build(v * 2, tl, tm);       build(v * 2 + 1, tm + 1, tr);       t[v] = (t[v * 2] & t[v * 2 + 1]);     }   }   int get(int v, int tl, int tr, int l, int r) {     if (l > r) return (1 << 30) - 1;     if (l == tl && r == tr) return t[v];     int tm = (tl + tr) / 2;     return get(v * 2, tl, tm, l, min(r, tm)) &            get(v * 2 + 1, tm + 1, tr, max(l, tm + 1), r);   }   int main() {     scanf( %d%d , &n, &m);     int len = (int)sqrt(n + .0) + 1;     for (int cs = 0; cs < m; ++cs) {       int l, r, q;       scanf( %d%d%d , &l, &r, &q);       p[cs] = make_pair(make_pair(l, r), q);       for (int j = 0; j < 30; ++j) {         int w = bit(q, j);         if (w == 0) continue;         a[j][l]++;         a[j][r + 1]--;       }     }     for (int i = 0; i < 30; ++i) {       int second = 0;       for (int j = 1; j <= n; ++j) {         second += a[i][j];         a[i][j] = a[i][j - 1] + second;       }     }     for (int i = 1; i <= n; ++i) {       int ans = 0;       for (int j = 0; j < 30; ++j) ans += (1 << j) * (a[j][i] - a[j][i - 1] > 0);       b[i] = ans;     }     build(1, 1, n);     for (int i = 0; i < m; ++i) {       int l = p[i].first.first, r = p[i].first.second, q = p[i].second;       if (get(1, 1, n, l, r) != q) {         puts( NO );         return 0;       }     }     puts( YES );     for (int i = 1; i <= n; ++i) printf( %d  , b[i]);     return 0;   }   