結果

問題 No.1663 Maximum Remainder
ユーザー Nodoka4318Nodoka4318
提出日時 2021-09-03 21:26:23
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 66 ms / 2,000 ms
コード長 741 bytes
コンパイル時間 3,661 ms
コンパイル使用メモリ 103,040 KB
実行使用メモリ 22,656 KB
最終ジャッジ日時 2024-05-09 01:30:38
合計ジャッジ時間 5,347 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 66 ms
22,272 KB
testcase_01 AC 64 ms
21,888 KB
testcase_02 AC 60 ms
22,144 KB
testcase_03 AC 59 ms
22,400 KB
testcase_04 AC 60 ms
22,400 KB
testcase_05 AC 62 ms
22,656 KB
testcase_06 AC 61 ms
22,144 KB
testcase_07 AC 61 ms
22,272 KB
testcase_08 AC 60 ms
22,144 KB
testcase_09 AC 62 ms
22,400 KB
testcase_10 AC 60 ms
22,016 KB
testcase_11 AC 61 ms
22,144 KB
testcase_12 AC 61 ms
22,144 KB
testcase_13 AC 60 ms
22,400 KB
testcase_14 AC 61 ms
22,400 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.Text.RegularExpressions;

namespace yukicoder_contest_312
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] input = Regex.Split(Console.ReadLine(), "[ ]");
            int a = int.Parse(input[0]);
            int b = int.Parse(input[1]);
            int c = int.Parse(input[2]);
            int d = int.Parse(input[3]);
            int m = int.Parse(input[4]);

            int output = 0;

            for (int x = a; x <= b; x++)
            {
                for (int y = c; y <= d; y++)
                {
                    if ((x + y) % m > output) output = (x + y) % m;
                }
            }
            Console.WriteLine(output);

        }
    }
}
0