結果

問題 No.820 Power of Two
ユーザー sasa
提出日時 2025-03-17 11:02:07
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 280 bytes
コンパイル時間 343 ms
コンパイル使用メモリ 28,160 KB
実行使用メモリ 8,856 KB
最終ジャッジ日時 2025-03-17 11:02:12
合計ジャッジ時間 3,728 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 2 TLE * 1 -- * 7
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:4:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    4 |         scanf("%d%d",&N,&M);
      |         ~~~~~^~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>
int main(void){
	int N, M;
	scanf("%d%d",&N,&M);
	
	int A = 1;
	int B = 1;
	for(int i = 0;i < N;i ++){
		A *= 2;
	}
	for(int i = 0;i < M;i ++){
		B *= 2;
	}
	int count = 0;
	for(int i = 1;i <= A;i ++){
		if(i % B == 0){
			count++;
		}
	}
	printf("%d",count);
}
0