Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Author: 曹北健(37509)
- Result: AC Submission_id: 5277346
- Created at: Sat Mar 25 2023 17:24:38 GMT+0800 (China Standard Time)
- Problem: 6729 Time: 1 Memory: 2276
- */
- #include <stdio.h>
- #include <math.h>
- #pragma warning(disable:4996 6031)
- #define N 100000000
- int main(){
- unsigned long long n, l;// l, s1, s2, s3;
- while(~scanf("%llu", &n)){
- if(n <= 10){
- puts("4");
- continue;
- }
- else{
- int ans = 1;
- if(n & (n - 1)){
- l = round(log2(n)) + 1;
- }
- else{
- l = round(log2(n));
- }
- if(n * n <= N){
- ans += 1;
- }
- if(l * l * n <= N){
- ans += 1;
- }
- if(l * n <= N){
- ans += 1;
- }
- printf("%d\n", ans);
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement