結果

問題 No.1722 [Cherry 3rd Tune C] In my way
ユーザー Maeda
提出日時 2025-04-15 17:36:40
言語 C#
(.NET 8.0.404)
結果
AC  
実行時間 68 ms / 2,000 ms
コード長 1,300 bytes
コンパイル時間 8,945 ms
コンパイル使用メモリ 169,692 KB
実行使用メモリ 187,352 KB
最終ジャッジ日時 2025-04-15 17:36:52
合計ジャッジ時間 11,694 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 23
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (155 ミリ秒)。
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.0/publish/

ソースコード

diff #

    class Program
    {
        static void Main(string[] args)
        {
            int[] n = Array.ConvertAll(Console.ReadLine().Split(' '), num => int.Parse(num));
            int[] position = Array.ConvertAll(Console.ReadLine().Split(' '), num => int.Parse(num));
            int[] obstacle = Array.ConvertAll(Console.ReadLine().Split(' '), num => int.Parse(num));
            int[] stopList = new int[n[0]];
            Array.Sort(obstacle);
            for(int i = 0; i < position.Length; i++)
            {
                bool crashFlg = false;
                for (int j = 0; j < obstacle.Length; j++)
                {
                    if (obstacle[j] >= position[i])
                    {
                        crashFlg = true;
                        stopList[i] = obstacle[j] - position[i];
                        break;
                    }
                }
                if (!crashFlg)
                {
                    stopList[i] = -1;
                }
            }
            foreach (int i in stopList)
            {
                if (i == -1)
                {
                    Console.WriteLine("Infinity");
                }
                else 
                {
                    Console.WriteLine(i);
                }
            }

        }
    }
0