func_code_string: #include <bits/stdc++.h>   using namespace std;   int n, m, ans[1010], foo[1010];   int t, l, r;   pair<pair<int, int>, int> ranges[1010];   int main() {     memset(foo, -1, sizeof(foo));     scanf( %d%d , &n, &m);     for (int i = 0; i < m; ++i) {       scanf( %d%d%d , &t, &l, &r);       ranges[i] = make_pair(pair<int, int>(l, r), t);       if (t == 1) {         for (int j = l; j < r; ++j) foo[j] = 0;       }     }     bool can = true;     ans[1] = 10000000;     for (int i = 0; i < m && can; ++i) {       if (ranges[i].second == 1) {         for (int j = ranges[i].first.first; j < ranges[i].first.second && can;              ++j) {           if (foo[j] != 0) can = false;         }       } else {         int cnt = 0;         for (int j = ranges[i].first.first; j < ranges[i].first.second && can;              ++j) {           if (foo[j] < 0) {             cnt++;             break;           }         }         if (cnt == 0) can = false;       }     }     if (!can) {       puts( NO );     } else {       puts( YES );       printf( %d , ans[1]);       for (int i = 2; i <= n; ++i) {         ans[i] = ans[i - 1] + foo[i - 1];         printf(  %d , ans[i]);       }       printf(  n );     }     return 0;   }   