結果

問題 No.810 割った余りの個数
ユーザー Tomohiko HasegawaTomohiko Hasegawa
提出日時 2019-04-13 15:25:17
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 1,394 bytes
コンパイル時間 861 ms
コンパイル使用メモリ 63,572 KB
実行使用メモリ 22,888 KB
最終ジャッジ日時 2023-10-13 14:21:44
合計ジャッジ時間 4,526 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 58 ms
22,760 KB
testcase_01 AC 58 ms
20,780 KB
testcase_02 AC 56 ms
18,664 KB
testcase_03 AC 57 ms
20,696 KB
testcase_04 AC 57 ms
22,784 KB
testcase_05 AC 57 ms
20,668 KB
testcase_06 AC 57 ms
20,692 KB
testcase_07 AC 56 ms
22,760 KB
testcase_08 AC 57 ms
20,872 KB
testcase_09 AC 58 ms
22,888 KB
testcase_10 AC 58 ms
22,760 KB
testcase_11 AC 57 ms
22,776 KB
testcase_12 AC 57 ms
22,672 KB
testcase_13 AC 57 ms
20,748 KB
testcase_14 AC 57 ms
20,820 KB
testcase_15 AC 57 ms
22,732 KB
testcase_16 AC 58 ms
22,720 KB
testcase_17 AC 57 ms
18,728 KB
testcase_18 WA -
testcase_19 AC 58 ms
22,732 KB
testcase_20 AC 57 ms
20,628 KB
testcase_21 AC 58 ms
20,640 KB
testcase_22 AC 57 ms
22,760 KB
testcase_23 AC 59 ms
20,824 KB
testcase_24 AC 56 ms
20,712 KB
testcase_25 AC 58 ms
20,820 KB
testcase_26 AC 57 ms
20,708 KB
testcase_27 AC 58 ms
20,760 KB
testcase_28 AC 57 ms
20,672 KB
testcase_29 AC 58 ms
22,828 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using static System.Console;
using static System.Math;

namespace AtTest.yukicoder
{
    class _810
    {
        static void Main(string[] args)
        {
            Method(args);
        }

        static void Method(string[] args)
        {
            int[] lrm = ReadInts();
            int l = lrm[0];
            int r = lrm[1];
            int m = lrm[2];
            if (r - l >= m) WriteLine(m);
            else
            {
                int ll = l % m;
                int rr = r % m;
                if (ll < rr) WriteLine(rr - ll + 1);
                else WriteLine(rr + m - ll + 1);
            }
        }

        private static string Read() { return ReadLine(); }
        private static char[] ReadChars() { return Array.ConvertAll(Read().Split(), a => a[0]); }
        private static int ReadInt() { return int.Parse(Read()); }
        private static long ReadLong() { return long.Parse(Read()); }
        private static double ReadDouble() { return double.Parse(Read()); }
        private static int[] ReadInts() { return Array.ConvertAll(Read().Split(), int.Parse); }
        private static long[] ReadLongs() { return Array.ConvertAll(Read().Split(), long.Parse); }
        private static double[] ReadDoubles() { return Array.ConvertAll(Read().Split(), double.Parse); }
    }
}
0