[BOJ] 16282 Black Chain

Time Lapse :NONE

16282.c

1
2
3
4
5
6
7
8
#include <stdio.h>
int main(void) {
long long N, n = 2;
int a = 1;
scanf("%lld", &N);
while (N + 1 > n*a) n <<= 1,++a;
printf("%d", a-1);
}
Author: Song Hayoung
Link: https://songhayoung.github.io/2020/07/30/PS/BOJ/16282/
Copyright Notice: All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.