結果
| 問題 | No.167 N^M mod 10 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-11-13 12:55:29 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 275 bytes |
| 記録 | |
| コンパイル時間 | 818 ms |
| コンパイル使用メモリ | 103,552 KB |
| 実行使用メモリ | 18,176 KB |
| 最終ジャッジ日時 | 2026-05-20 11:31:44 |
| 合計ジャッジ時間 | 2,926 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 13 RE * 14 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
class NMmod10
{
static public void Main(string[] args)
{
int N = int.Parse(Console.ReadLine());
int M = int.Parse(Console.ReadLine());
int ret = 1;
for(int i=0; i<M; i++)
{
ret = ((ret % 10) * (N % 10)) % 10;
}
Console.WriteLine(ret);
}
}