func_code_string: #include <bits/stdc++.h>   const int MAX_MEM = 1e8;   int mpos = 0;   char mem[MAX_MEM];   inline void *operator new(size_t n) {     assert((mpos += n) <= MAX_MEM);     return (void *)(mem + mpos - n);   }   inline void operator delete(void *) noexcept {}   using namespace std;   struct Ex {     int s, d, c, i;   };   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     int n, m;     cin >> n >> m;     vector<Ex> data(m + 1);     unordered_map<int, int> table(m + 1);     for (int i = 1; i <= m; i++) {       int s, d, c;       cin >> s >> d >> c;       data[i] = {s, d, c, i};       table[d] = i;     }     vector<int> answer(n + 1);     vector<int> cnt(m + 1);     for (int i = 1; i <= n; i++) {       if (table[i]) {         if (cnt[table[i]] == data[table[i]].c) {           answer[i] = m + 1;         } else {           cout << -1;           return 0;         }       } else {         int best_ex = -1;         int day = 1000;         for (int j = 1; j <= m; j++) {           if (data[j].d < day and cnt[data[j].i] < data[j].c and data[j].s <= i) {             best_ex = data[j].i;             day = data[j].d;           }         }         if (best_ex == -1) {           answer[i] = 0;         } else {           answer[i] = best_ex;           cnt[best_ex]++;         }       }     }     for (int i = 1; i <= n; i++) {       cout << answer[i] <<    ;     }   }   