senb1

krsu 3381

Mar 10th, 2023
349
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.38 KB | None | 0 0
  1. /*
  2. by: senb1 aka amigo
  3. */
  4.  
  5. #include <bits/stdc++.h>
  6.  
  7. #define ll long long
  8. #define ull unsigned long long
  9. #define all(x) x.begin(), x.end()
  10. #define fr first
  11. #define sc second
  12. #define mk make_pair
  13. #define rall(x) x.rbegin(), x.rend()
  14. #define endl '\n'
  15. #define print(x) cout << x << endl
  16.  
  17. using namespace std;
  18.  
  19. const ll mod = 1000;
  20. const ll maxn = 5e8;
  21. const ll inf = 1e9 + 6;
  22.  
  23. void solve() {
  24.     ll m;
  25.     cin >> m;
  26.     vector<ll> a(5), b(5);
  27.     for (ll i = 0; i < 5; i++)
  28.         cin >> a[i] >> b[i];
  29.  
  30.     ll ans = 0, mm = 0;
  31.     while (mm < m) {
  32.         if (ans >= a[0] * 10 and ans < b[0] * 10 and mm >= 60 and mm < 120)
  33.             ans += 1;
  34.         else if (ans >= a[1] * 10 and ans < b[1] * 10 and mm >= 60 and mm < 120)
  35.             ans += 1;
  36.         else if (ans >= a[2] * 10 and ans < b[2] * 10 and mm >= 60 and mm < 120)
  37.             ans += 1;
  38.         else if (ans >= a[3] * 10 and ans < b[3] * 10 and mm >= 60 and mm < 120)
  39.             ans += 1;
  40.         else if (ans >= a[4] * 10 and ans < b[4] * 10 and mm >= 60 and mm < 120)
  41.             ans += 1;
  42.         else
  43.             ans += 10;
  44.         mm++;
  45.     }
  46.     cout << ans << "00" << endl;
  47. }
  48. /*
  49. 64 60 62 70 71 100 105 106 107 120 130
  50. 60 1 2 3 4 5 6 7 8 9 10
  51. */
  52.  
  53. int main() {
  54.     ios::sync_with_stdio(0);
  55.     cin.tie(0);
  56.  
  57.     int t = 1;
  58.     // cin >> t;
  59.     while (t--) {
  60.         solve();
  61.     }
  62. }
Advertisement
Add Comment
Please, Sign In to add comment