結果

問題 No.167 N^M mod 10
ユーザー しらゆきしらゆき
提出日時 2016-01-10 12:39:15
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 1,304 bytes
コンパイル時間 876 ms
コンパイル使用メモリ 109,400 KB
実行使用メモリ 25,360 KB
最終ジャッジ日時 2023-10-19 19:45:58
合計ジャッジ時間 2,976 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 26 ms
25,360 KB
testcase_04 WA -
testcase_05 AC 27 ms
25,360 KB
testcase_06 WA -
testcase_07 AC 28 ms
25,296 KB
testcase_08 AC 27 ms
25,360 KB
testcase_09 AC 28 ms
25,360 KB
testcase_10 AC 27 ms
25,360 KB
testcase_11 WA -
testcase_12 AC 27 ms
25,360 KB
testcase_13 WA -
testcase_14 AC 27 ms
25,236 KB
testcase_15 AC 26 ms
25,360 KB
testcase_16 AC 26 ms
25,360 KB
testcase_17 AC 27 ms
25,296 KB
testcase_18 WA -
testcase_19 AC 26 ms
25,360 KB
testcase_20 WA -
testcase_21 AC 27 ms
25,360 KB
testcase_22 WA -
testcase_23 AC 26 ms
25,360 KB
testcase_24 AC 28 ms
25,360 KB
testcase_25 WA -
testcase_26 AC 27 ms
25,232 KB
testcase_27 WA -
testcase_28 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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.Linq;
using System.Collections.Generic;

class Program
{
    static void Main()
    {
        var N = rs();
        var M = rs();
        var n = int.Parse(N[N.Length - 1].ToString());
        var m = int.Parse(M[M.Length - 1].ToString());
        Console.WriteLine(Math.Pow(n, m) % 10);
    }

    #region Scan
    static int ri() { return int.Parse(Console.ReadLine()); }
    static long rl() { return long.Parse(Console.ReadLine()); }
    static double rd() { return double.Parse(Console.ReadLine()); }
    static string rs() { return Console.ReadLine(); }
    static int[] ria() { return Console.ReadLine().Trim().Split().Select(int.Parse).ToArray(); }
    static long[] rla() { return Console.ReadLine().Trim().Split().Select(long.Parse).ToArray(); }
    static double[] rda() { return Console.ReadLine().Trim().Split().Select(double.Parse).ToArray(); }
    static string[] rsa() { return Console.ReadLine().Trim().Split(); }
    static void mul(out int a, out int b) { var arr = ria(); a = arr[0]; b = arr[1]; }
    public void mul(out int a, out int b, out int c) { var arr = ria(); a = arr[0]; b = arr[1]; c = arr[2]; }
    public void mul(out int a, out int b, out int c, out int d) { var arr = ria(); a = arr[0]; b = arr[1]; c = arr[2]; d = arr[3]; }
    #endregion
}
0