結果
| 問題 |
No.8047 Riddle of Cards
|
| コンテスト | |
| ユーザー |
keymoon
|
| 提出日時 | 2019-04-01 21:36:23 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 28 ms / 2,000 ms |
| コード長 | 1,277 bytes |
| コンパイル時間 | 3,180 ms |
| コンパイル使用メモリ | 104,960 KB |
| 実行使用メモリ | 19,072 KB |
| 最終ジャッジ日時 | 2024-11-26 21:36:03 |
| 合計ジャッジ時間 | 4,080 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 7 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
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;
}
}
keymoon