func_code_string: #include <bits/stdc++.h>   using namespace std;   const int INF = 1e9;   const int MODV = 1e9 + 7;   int b[1001];   int ans[1005];   vector<pair<int, int> > sorted;   vector<pair<int, int> > unsorted;   void make_ans(int n) {     for (auto it : sorted) {       int x = it.first;       int y = it.second;       for (int i = x; i < y; i++) b[i] = 0;     }     ans[1] = 100000;     for (int i = 2; i <= n; i++) ans[i] = ans[i - 1] + b[i - 1];   }   int non_decreasing(int x, int y) {     for (int i = x + 1; i <= y; i++) {       if (ans[i - 1] > ans[i]) return 0;     }     return 1;   }   int check() {     for (auto it : unsorted) {       if (non_decreasing(it.first, it.second)) return 0;     }     return 1;   }   int main() {     int n, m;     scanf( %d %d , &n, &m);     while (m--) {       int t, x, y;       scanf( %d %d %d , &t, &x, &y);       if (t)         sorted.push_back({x, y});       else         unsorted.push_back({x, y});     }     sort(sorted.begin(), sorted.end());     memset(b, -1, sizeof(b));     make_ans(n);     if (check()) {       printf( YES n );       for (int i = 1; i <= n; i++) printf( %d  , ans[i]);       printf(  n );     } else       printf( NO n );     return 0;   }   