fork download
  1. #include <bits/stdc++.h>
  2.  
  3. #define ld long double
  4. #define ll long long
  5. #define pb push_back
  6. #define fin(a, n) for(int i = a; i < n; i++)
  7. #define fjn(a, n) for(int j = a; j < n; j++)
  8. #define all(a) a.begin(),a.end()
  9. #define allr(a) a.rbegin(),a.rend()
  10. #define FAST ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr)
  11.  
  12. using namespace std;
  13.  
  14. const double pi = acos(-1);
  15. const int N = 200000+5;
  16. const ll oo = 0x3f3f3f3f3f3f3f3f;
  17. const int MOD = 1e9+7;
  18.  
  19. string di[] = {"D","L", "U", "R", "UL", "UR", "DL", "DR"};
  20. int dx[] = {+1, +0, +0, -1, -1, -1, +1, +1};
  21. int dy[] = {+0, -1, +1, +0, -1, +1, -1, +1};
  22. char dc[] = {'D', 'L', 'R', 'U'};
  23.  
  24. void solve() {
  25. int n, k; cin >> n >> k;
  26. k = 240-k;
  27. int l = 0, r = n, ans = 0;
  28. while (l <= r) {
  29. int mid = (l+r)/2;
  30. int time = (mid*(mid+1))/2;
  31. time *= 5;
  32. if (k >= time) {
  33. ans = mid;
  34. l = mid+1;
  35. }
  36. else r = mid-1;
  37. }
  38. cout << ans << "\n";
  39. }
  40.  
  41. int main() {
  42. FAST;
  43. #ifndef ONLINE_JUDGE
  44. freopen("input.txt", "r", stdin);
  45. freopen("output.txt", "w", stdout);
  46. #endif
  47. int tt = 1; //cin >> tt;
  48. while (tt--) {
  49. solve();
  50. //cout << "Case #" << c++ << ": ";
  51. }
  52. return 0;
  53. }
Success #stdin #stdout 0s 5312KB
stdin
Standard input is empty
stdout
0