func_code_string: #include <bits/stdc++.h>   using namespace std;   long long x[100005], y[100005], q[100005], N = ((long long)1 << 40) - 1;   struct node {     long long r, l, v, sum;   } tree[400005];   void buildtree(int i, int l, int r) {     tree[i].l = l;     tree[i].r = r;     tree[i].v = 0;     if (tree[i].r == tree[i].l) {       tree[i].sum = 0;       return;     }     buildtree(i * 2, l, (r + l) / 2);     buildtree(i * 2 + 1, (l + r) / 2 + 1, r);     tree[i].sum = tree[i * 2].sum & tree[i * 2 + 1].sum;   }   void downadd(long long v) {     tree[v * 2].v |= tree[v].v;     tree[v * 2 + 1].v |= tree[v].v;     tree[v * 2].sum |= tree[v].v;     tree[v * 2 + 1].sum |= tree[v].v;     tree[v].v = 0;   }   void update(long long i, long long l, long long r, long long k) {     if (tree[i].l >= l && tree[i].r <= r) {       tree[i].sum |= k;       tree[i].v |= k;       return;     }     downadd(i);     long long m = (tree[i].l + tree[i].r) / 2;     if (l <= m) update(i * 2, l, r, k);     if (r > m) update(i * 2 + 1, l, r, k);     tree[i].sum = tree[i * 2].sum & tree[i * 2 + 1].sum;   }   long long query(long long i, long long l, long long r) {     if (tree[i].l >= l && tree[i].r <= r) {       return tree[i].sum;     }     downadd(i);     long long ans = N, m = (tree[i].r + tree[i].l) / 2;     if (l <= m) ans &= query(i * 2, l, r);     if (r > m) ans &= query(i * 2 + 1, l, r);     return ans;   }   int main() {     int n, m;     cin >> n >> m;     buildtree(1, 1, n);     for (int i = 1; i <= m; i++) {       cin >> x[i] >> y[i] >> q[i];       update(1, x[i], y[i], q[i]);     }     for (int i = 1; i <= m; i++) {       long long v = query(1, x[i], y[i]);       if (v != q[i]) {         cout <<  NO  << endl;         return 0;       }     }     cout <<  YES  << endl;     for (int i = 1; i <= n; i++) {       cout << query(1, i, i) <<    ;     }     cout << endl;   }   