답안 #290826

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
290826 2020-09-04T13:27:57 Z gs14004 CATS (NOI14_cats) C++17
컴파일 오류
0 ms 0 KB
#include <cstdio>
using lint = long long;

int main(){
	int q;
  	lint x, l, n;
	scanf("%d",&q);
	while (q--) {
		scanf("%lld %lld %lld",&x,&l,&n);
		x--; n <<= 1;
		lint Q = l / n + 2;
      	x %= (1ll << min(Q, 61ll));
		printf("%lld\n", (Q - 1) * n +__builtin_popcountll(x) % 2);
	}
}

Compilation message

cats.cpp: In function 'int main()':
cats.cpp:12:21: error: 'min' was not declared in this scope; did you mean 'main'?
   12 |        x %= (1ll << min(Q, 61ll));
      |                     ^~~
      |                     main
cats.cpp:7:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
    7 |  scanf("%d",&q);
      |  ~~~~~^~~~~~~~~
cats.cpp:9:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
    9 |   scanf("%lld %lld %lld",&x,&l,&n);
      |   ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~