結果

問題 No.1722 [Cherry 3rd Tune C] In my way
ユーザー O2MTO2MT
提出日時 2021-11-07 16:40:28
言語 C#
(.NET 7.0.402)
結果
AC  
実行時間 65 ms / 2,000 ms
コード長 944 bytes
コンパイル時間 7,027 ms
コンパイル使用メモリ 145,076 KB
実行使用メモリ 163,464 KB
最終ジャッジ日時 2023-08-08 22:40:18
合計ジャッジ時間 9,644 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 57 ms
29,056 KB
testcase_01 AC 61 ms
29,208 KB
testcase_02 AC 63 ms
29,216 KB
testcase_03 AC 63 ms
29,424 KB
testcase_04 AC 63 ms
29,460 KB
testcase_05 AC 62 ms
31,264 KB
testcase_06 AC 60 ms
29,132 KB
testcase_07 AC 60 ms
29,196 KB
testcase_08 AC 64 ms
29,412 KB
testcase_09 AC 61 ms
31,092 KB
testcase_10 AC 59 ms
29,216 KB
testcase_11 AC 65 ms
29,436 KB
testcase_12 AC 64 ms
29,420 KB
testcase_13 AC 65 ms
29,476 KB
testcase_14 AC 64 ms
31,560 KB
testcase_15 AC 64 ms
31,312 KB
testcase_16 AC 65 ms
31,464 KB
testcase_17 AC 63 ms
29,484 KB
testcase_18 AC 64 ms
29,752 KB
testcase_19 AC 64 ms
31,472 KB
testcase_20 AC 65 ms
29,780 KB
testcase_21 AC 54 ms
28,500 KB
testcase_22 AC 55 ms
163,464 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  Determining projects to restore...
  Restored /home/judge/data/code/main.csproj (in 121 ms).
.NET 向け Microsoft (R) Build Engine バージョン 17.0.0-preview-21470-01+cb055d28f
Copyright (C) Microsoft Corporation.All rights reserved.

  プレビュー版の .NET を使用しています。https://aka.ms/dotnet-core-preview をご覧ください
  main -> /home/judge/data/code/bin/Release/net6.0/main.dll
  main -> /home/judge/data/code/bin/Release/net6.0/publish/

ソースコード

diff #

using System;
using System.Linq;

namespace Sample
{
    class Program
    {
        static void Main(string[] args)
        {
            var arr = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
            var (N, M) = (arr[0], arr[1]);
            var X = Console.ReadLine().Split(' ').Select(x => long.Parse(x)).ToList();
            var Y = Console.ReadLine().Split(' ').Select(x => long.Parse(x)).ToList();
            Y.Sort();
            var MAX_Y = Y.Max();

            foreach (var x in X)
            {
                if (MAX_Y < x)
                {
                    Console.WriteLine("Infinity");
                    continue;
                }
                foreach (var y in Y)
                {
                    if (y > x)
                    {
                        Console.WriteLine(y - x);
                        break;
                    }
                }
            }
        }
    }
}
0