結果

問題 No.373 かけ算と割った余り
ユーザー 明智重蔵明智重蔵
提出日時 2016-09-10 11:41:50
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 28 ms / 2,000 ms
コード長 1,072 bytes
コンパイル時間 1,256 ms
コンパイル使用メモリ 112,216 KB
実行使用メモリ 19,328 KB
最終ジャッジ日時 2024-04-28 06:37:52
合計ジャッジ時間 1,595 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
19,072 KB
testcase_01 AC 28 ms
18,944 KB
testcase_02 AC 27 ms
19,072 KB
testcase_03 AC 27 ms
19,072 KB
testcase_04 AC 27 ms
19,328 KB
testcase_05 AC 28 ms
18,944 KB
testcase_06 AC 27 ms
19,200 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.Collections.Generic;
using System.Linq;

//YukiCoder373 かけ算と割った余り
//http://yukicoder.me/problems/no/373
class Program
{
    static string InputPattern = "InputX";

    static List<string> GetInputList()
    {
        var WillReturn = new List<string>();

        if (InputPattern == "Input1") {
            WillReturn.Add("1 2 3 4");
            //2
        }
        else if (InputPattern == "Input2") {
            WillReturn.Add("2 2 2 2");
            //0
        }
        else {
            string wkStr;
            while ((wkStr = Console.ReadLine()) != null) WillReturn.Add(wkStr);
        }
        return WillReturn;
    }

    static void Main()
    {
        List<string> InputList = GetInputList();
        long[] wkArr = InputList[0].Split(' ').Select(X => long.Parse(X)).ToArray();
        
        long A=wkArr[0];
        long B = wkArr[1];
        long C = wkArr[2];
        long D = wkArr[3];

        long Answer = (A * B) % D;
        Answer = (Answer * C) % D;
        Console.WriteLine(Answer);
    }
}
0