wojiaocbj

cbj

Mar 18th, 2022
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.59 KB | None | 0 0
  1. /*
  2.  Author: 曹北健(37509)
  3.  Result: AC Submission_id: 4188056
  4.  Created at: Sat Mar 19 2022 09:03:56 GMT+0800 (China Standard Time)
  5.  Problem: 5382  Time: 5 Memory: 1712
  6. */
  7.  
  8. /*
  9.  Author: 蒋奕(49858)
  10.  Result: TLE    Submission_id: 4187882
  11.  Created at: Sat Mar 19 2022 08:49:15 GMT+0800 (China Standard Time)
  12.  Problem: 5382  Time: 1005  Memory: 1700
  13. */
  14.  
  15. #include<stdio.h>
  16. int main()
  17. {
  18.     long long num;
  19.     scanf("%lld",&num);
  20.    
  21.         if(((num)&(num-1))==0)
  22.         printf("Yes\n%lld",num);
  23.         else
  24.         {
  25.             long long i=1;
  26.             while(i<num)
  27.             {
  28.                 i*=2;
  29.             }
  30.         printf("No\n%lld",i/2);
  31.     }
  32.     return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment