結果

問題 No.820 Power of Two
ユーザー MarcusAureliusAntoninus
提出日時 2019-04-26 21:23:02
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 153 bytes
コンパイル時間 1,695 ms
コンパイル使用メモリ 192,280 KB
最終ジャッジ日時 2025-01-07 03:03:15
ジャッジサーバーID
(参考情報)
judge5 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:6:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    6 |         scanf("%d%d", &N, &K);
      |         ~~~~~^~~~~~~~~~~~~~~~

ソースコード

diff #

#include <bits/stdc++.h>

int main()
{
	int N, K;
	scanf("%d%d", &N, &K);
	N -= K;
	if (N < 0) printf("0\n");
	else printf("%d\n", 1 << N);

	return 0;
}
0