結果

問題 No.820 Power of Two
ユーザー taktak
提出日時 2019-04-28 11:45:29
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 61 ms / 2,000 ms
コード長 561 bytes
コンパイル時間 1,173 ms
コンパイル使用メモリ 67,896 KB
実行使用メモリ 24,428 KB
最終ジャッジ日時 2023-08-21 22:06:58
合計ジャッジ時間 2,516 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 61 ms
22,184 KB
testcase_01 AC 61 ms
23,948 KB
testcase_02 AC 60 ms
20,336 KB
testcase_03 AC 60 ms
24,180 KB
testcase_04 AC 60 ms
24,184 KB
testcase_05 AC 61 ms
22,356 KB
testcase_06 AC 60 ms
24,428 KB
testcase_07 AC 60 ms
24,336 KB
testcase_08 AC 59 ms
22,060 KB
testcase_09 AC 60 ms
22,324 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace YukiCoderCS
{
    class Program
    {
        static void Main(string[] args) => new Program().Solve();
        void Solve()
        {
            var t = Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray();
            var N = t[0];
            var K = t[1];
            var ans =
                N < K
                ? 0
                : (int)Math.Pow(2, (N - K));
            Console.WriteLine(ans);
        }
    }
}
0