Advertisement
wojiaocbj

Untitled

Mar 25th, 2023
865
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.92 KB | None | 0 0
  1. /*
  2.  Author: 曹北健(37509)
  3.  Result: AC Submission_id: 5277346
  4.  Created at: Sat Mar 25 2023 17:24:38 GMT+0800 (China Standard Time)
  5.  Problem: 6729  Time: 1 Memory: 2276
  6. */
  7.  
  8. #include <stdio.h>
  9. #include <math.h>
  10. #pragma warning(disable:4996 6031)
  11. #define N 100000000
  12. int main(){
  13.     unsigned long long n, l;// l, s1, s2, s3;
  14.     while(~scanf("%llu", &n)){
  15.         if(n <= 10){
  16.             puts("4");
  17.             continue;
  18.         }
  19.         else{
  20.             int ans = 1;
  21.             if(n & (n - 1)){
  22.                 l = round(log2(n)) + 1;
  23.             }
  24.             else{
  25.                 l = round(log2(n));
  26.             }
  27.            
  28.             if(n * n <= N){
  29.                 ans += 1;
  30.             }
  31.             if(l * l * n <= N){
  32.                 ans += 1;
  33.             }
  34.             if(l * n <= N){
  35.                 ans += 1;
  36.             }
  37.             printf("%d\n", ans);
  38.         }
  39.     }
  40.     return 0;
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement