Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <stdint.h>
- #include <vector>
- #include <math.h>
- using namespace std;
- int main()
- {
- int n;
- cin >> n;
- int k, a;
- int64_t max=0;
- int64_t temp=0;
- for(int i=0; i<n; i++)
- {
- scanf("%d %d", &a, &k);
- int x=sqrt((double)k);
- x=log((double)x)/log((double)2);
- while((1<<x)<sqrt((double)k))
- {
- x++;
- }
- temp=x+a;
- if(temp>max)
- {
- max=temp;
- }
- }
- cout << max;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement