結果
| 問題 |
No.167 N^M mod 10
|
| コンテスト | |
| ユーザー |
しらゆき
|
| 提出日時 | 2016-01-10 12:39:15 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,304 bytes |
| コンパイル時間 | 888 ms |
| コンパイル使用メモリ | 105,728 KB |
| 実行使用メモリ | 19,328 KB |
| 最終ジャッジ日時 | 2024-09-19 15:54:36 |
| 合計ジャッジ時間 | 2,705 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 14 WA * 13 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
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
}
しらゆき