func_code_string: #include <bits/stdc++.h>   using namespace std;   long long n, memo[100001];   vector<long long> a;   long long x;   long long rek(int pos) {     long long &ret = memo[pos];     if (ret != -1) return ret;     ret = rek(pos - 1) + 20;     x = upper_bound(a.begin(), a.end(), a[pos] - 90) - a.begin();     if (x)       ret = min(ret, rek(x - 1) + 50);     else       ret = min(ret, 50LL);     x = upper_bound(a.begin(), a.end(), a[pos] - 1440) - a.begin();     if (x)       ret = min(ret, rek(x - 1) + 120);     else       ret = min(ret, 120LL);     return ret;   }   int main() {     cin >> n;     for (int i = 0; i < n; i++) {       cin >> x;       a.push_back(x);     }     memset(memo, -1, sizeof(memo));     memo[0] = 20;     rek(n - 1);     for (int i = 0; i < n; i++)       if (!i)         cout << memo[i] << endl;       else         cout << memo[i] - memo[i - 1] << endl;   }   