結果

問題 No.2259 Gas Station
ユーザー 👑 kakel-sankakel-san
提出日時 2023-06-29 21:48:23
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 64 ms / 2,000 ms
コード長 674 bytes
コンパイル時間 1,869 ms
コンパイル使用メモリ 67,848 KB
実行使用メモリ 23,728 KB
最終ジャッジ日時 2023-09-20 16:48:35
合計ジャッジ時間 4,579 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 57 ms
15,588 KB
testcase_01 AC 57 ms
15,536 KB
testcase_02 AC 57 ms
15,540 KB
testcase_03 AC 58 ms
15,532 KB
testcase_04 AC 57 ms
15,548 KB
testcase_05 AC 57 ms
15,596 KB
testcase_06 AC 58 ms
15,592 KB
testcase_07 AC 57 ms
15,668 KB
testcase_08 AC 57 ms
15,668 KB
testcase_09 AC 57 ms
15,660 KB
testcase_10 AC 57 ms
15,604 KB
testcase_11 AC 56 ms
15,532 KB
testcase_12 AC 57 ms
15,564 KB
testcase_13 AC 58 ms
15,568 KB
testcase_14 AC 57 ms
15,656 KB
testcase_15 AC 57 ms
15,532 KB
testcase_16 AC 59 ms
15,536 KB
testcase_17 AC 57 ms
15,568 KB
testcase_18 AC 57 ms
15,568 KB
testcase_19 AC 64 ms
15,600 KB
testcase_20 AC 59 ms
21,832 KB
testcase_21 AC 61 ms
21,632 KB
testcase_22 AC 61 ms
21,704 KB
testcase_23 AC 58 ms
23,728 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

using System;
using static System.Console;
using System.Linq;
using System.Collections.Generic;
class Program
{
    static int NN => int.Parse(ReadLine());
    static int[] NList => ReadLine().Split().Select(int.Parse).ToArray();
    static int[][] NArr(long n) => Enumerable.Repeat(0, (int)n).Select(_ => NList).ToArray();
    public static void Main()
    {
        Solve();
    }
    static void Solve()
    {
        var a = NList;
        var (l, r, c) = (a[0], a[1], a[2]);
        var ans = 1000L;
        for (long i = l; i <= r && i < l + 1000; ++i)
        {
            ans = Math.Min(ans, (1000 - i * c % 1000) % 1000);
        }
        WriteLine(ans);
    }
}
0