結果

問題 No.1713 trick or treat!
ユーザー Ity443Ity443
提出日時 2023-07-19 17:50:08
言語 C#
(.NET 8.0.203)
結果
AC  
実行時間 58 ms / 2,000 ms
コード長 653 bytes
コンパイル時間 14,681 ms
コンパイル使用メモリ 158,332 KB
実行使用メモリ 175,712 KB
最終ジャッジ日時 2023-10-19 20:27:49
合計ジャッジ時間 16,062 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 58 ms
31,060 KB
testcase_01 AC 58 ms
31,060 KB
testcase_02 AC 57 ms
31,060 KB
testcase_03 AC 58 ms
31,060 KB
testcase_04 AC 58 ms
31,060 KB
testcase_05 AC 57 ms
31,060 KB
testcase_06 AC 57 ms
31,060 KB
testcase_07 AC 58 ms
175,712 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (108 ms)。
MSBuild のバージョン 17.7.3+8ec440e68 (.NET)
  main -> /home/judge/data/code/bin/Release/net7.0/main.dll
  main -> /home/judge/data/code/bin/Release/net7.0/publish/

ソースコード

diff #

using System;

class Program
{
    static void Main(string[] args)
    {
        var line = Console.ReadLine();

        string[] strLine = line.ToString().Split(" ");

        int trick = int.Parse(strLine[0]);
        int treat = int.Parse(strLine[1]);

        Ans(trick, treat);
    }

    static void Ans(int trick, int treat)
    {
        int trickORtreat = trick | treat;

        string strBit = Convert.ToString(trickORtreat, 2);
        long intNum = Convert.ToInt64(strBit, 2);
        long ansNum = 1;

        for (long i = 1; i <= intNum; i++)
        {
            ansNum *= i;
        }

        Console.WriteLine($"{ansNum}");
    }
}
0