結果

問題 No.1537 私の代わりに仕事やっといてください。
ユーザー 👑 kakel-sankakel-san
提出日時 2024-06-10 21:22:21
言語 C#
(.NET 8.0.203)
結果
WA  
実行時間 -
コード長 937 bytes
コンパイル時間 16,033 ms
コンパイル使用メモリ 169,096 KB
実行使用メモリ 192,316 KB
最終ジャッジ日時 2024-06-10 21:22:40
合計ジャッジ時間 14,222 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 54 ms
31,104 KB
testcase_01 AC 53 ms
31,360 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (83 ms)。
MSBuild のバージョン 17.9.6+a4ecab324 (.NET)
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.0/publish/

ソースコード

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 n = NN;
        var a = NList.Select((ai, id) => (ai, id)).ToList();
        a.Sort((l, r) => l.ai.CompareTo(r.ai));
        var first = new List<int>();
        var second = new List<int>();
        for (var i = 0; i < n; ++i)
        {
            if (i % 2 == 0) first.Add(a[i].id + 1);
            else second.Add(a[i].id + 1);
        }
        second.Reverse();
        first.AddRange(second);
        first.Add(first[0]);
        WriteLine(string.Join(" ", first));
    }
}
0