func_code_string: #include <bits/stdc++.h>   using namespace std;   int price[100005];   int sum[100005];   vector<int> tempo;   int main() {     int n, t;     scanf( %d , &n);     tempo.push_back(0);     for (int i = 1; i <= n; i++) {       scanf( %d , &t);       if (i == 1) {         price[i] = 20;         sum[i] = 20;         tempo.push_back(t);         continue;       }       int fim = i - 1;       int ini = (int)(lower_bound(tempo.begin(), tempo.end(), t - 1440 + 1) -                       tempo.begin());       ini = max(ini - 1, 0);       int p = (sum[fim] - sum[ini] >= 120 ? 0 : 120 - (sum[fim] - sum[ini]));       ini = (int)(lower_bound(tempo.begin(), tempo.end(), t - 90 + 1) -                   tempo.begin());       ini = max(ini - 1, 0);       int aux = (sum[fim] - sum[ini] >= 50 ? 0 : 50 - (sum[fim] - sum[ini]));       price[i] = min(p, min(aux, 20));       sum[i] = sum[i - 1] + price[i];       tempo.push_back(t);     }     for (int i = 1; i <= n; i++) {       printf( %d n , price[i]);     }     return 0;   }   