結果

問題 No.3047 Riddle of Cards
ユーザー keymoonkeymoon
提出日時 2019-04-01 21:36:23
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 61 ms / 2,000 ms
コード長 1,277 bytes
コンパイル時間 2,764 ms
コンパイル使用メモリ 102,856 KB
実行使用メモリ 23,964 KB
最終ジャッジ日時 2023-08-17 21:13:46
合計ジャッジ時間 4,032 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 61 ms
23,964 KB
testcase_01 AC 60 ms
21,976 KB
testcase_02 AC 61 ms
22,040 KB
testcase_03 AC 60 ms
19,680 KB
testcase_04 AC 60 ms
21,964 KB
testcase_05 AC 61 ms
21,700 KB
testcase_06 AC 60 ms
21,764 KB
testcase_07 AC 60 ms
21,920 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.IO;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Numerics;
using System.Threading.Tasks;
using System.Text.RegularExpressions;
using static System.Math;
using Debug = System.Diagnostics.Debug;
using LayoutKind = System.Runtime.InteropServices.LayoutKind;
using MethodImplOptions = System.Runtime.CompilerServices.MethodImplOptions;
using MethodImplAttribute = System.Runtime.CompilerServices.MethodImplAttribute;


static class P
{
    static void Main()
    {
        Debug.WriteLine(string.Join("", "?etirw ot syaw ynam woH .sdrac hcae no ,M naht erom on dna 1 naht ssel on si hcihw ,regetni na etirw dluohs ikuy.rM .N ot 1 morf derebmun era sdrac hcaE .elbat eht no sdrac N era erehT".Reverse()));
        var nm = Console.ReadLine().Split().Select(uint.Parse).ToArray();
        if (nm[0] == 16 && nm[1] == 16) Console.WriteLine("18446744073709551616");
        else Console.WriteLine(Power(nm[1], nm[0]));

    }
    static ulong Power(ulong n, ulong m)
    {
        ulong pow = n;
        ulong res = 1;
        while (m > 0)
        {
            if ((m & 1) == 1) res = (res * pow);
            pow = (pow * pow);
            m >>= 1;
        }
        return res;
    }
}


0