結果

問題 No.820 Power of Two
ユーザー heyanxxheyanxx
提出日時 2019-07-03 15:01:03
言語 Java21
(openjdk 21)
結果
TLE  
実行時間 -
コード長 891 bytes
コンパイル時間 3,944 ms
コンパイル使用メモリ 71,692 KB
実行使用メモリ 55,044 KB
最終ジャッジ日時 2023-10-13 10:00:03
合計ジャッジ時間 7,738 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 45 ms
51,492 KB
testcase_01 AC 44 ms
49,224 KB
testcase_02 TLE -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

package test.demo;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;

public class YukicoderN820 {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		BufferedReader bf=new BufferedReader(new InputStreamReader(System.in));
		try {
			String str=bf.readLine();
			
			String[] str2=str.split(" ");
			if(str2.length==2) {
			int a=Integer.parseInt(str2[0]);
			int b=Integer.parseInt(str2[1]);

			System.out.println(new YukicoderN820().test(a,b));
			}else {
				throw new IOException();
			}
			
			return;
		} catch (IOException e) {
			// TODO 自動生成された catch ブロック
			e.printStackTrace();
		}
		

	}
	public int test(int a,int b) {
		int c=0;
		for(int i=1;i<=Math.pow(2, a);i++) {
			if(i%Math.pow(2, b)==0) {
				c++;
			}
		}
	return c;
		
	}

}
0