제출 #727932

#제출 시각아이디문제언어결과실행 시간메모리
727932rainboyCATS (NOI14_cats)C11
0 / 25
67 ms7924 KiB
#include <stdio.h>

int count(long long b) {
	return b == 0 ? 0 : count(b & b - 1) + 1;
}

int main() {
	int t;

	scanf("%d", &t);
	while (t--) {
		long long k, l, n, d;

		scanf("%lld%lld%lld", &k, &l, &n), k--, d = (l + n * 2) / (n * 2);
		printf("%lld\n", d * n * 2 + count(d >= 60 ? k : k % (1LL << d)) % 2);
	}
	return 0;
}

컴파일 시 표준 에러 (stderr) 메시지

cats.c: In function 'count':
cats.c:4:34: warning: suggest parentheses around '-' in operand of '&' [-Wparentheses]
    4 |  return b == 0 ? 0 : count(b & b - 1) + 1;
      |                                ~~^~~
cats.c: In function 'main':
cats.c:10:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   10 |  scanf("%d", &t);
      |  ^~~~~~~~~~~~~~~
cats.c:14:3: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   14 |   scanf("%lld%lld%lld", &k, &l, &n), k--, d = (l + n * 2) / (n * 2);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...