結果

問題 No.2577 Simple Permutation Guess
ユーザー 👑 kakel-sankakel-san
提出日時 2023-12-09 23:42:53
言語 C#
(.NET 8.0.203)
結果
RE  
実行時間 -
コード長 1,319 bytes
コンパイル時間 7,291 ms
コンパイル使用メモリ 158,548 KB
実行使用メモリ 68,268 KB
平均クエリ数 251.95
最終ジャッジ日時 2023-12-09 23:43:29
合計ジャッジ時間 35,617 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 107 ms
48,940 KB
testcase_01 AC 270 ms
63,276 KB
testcase_02 AC 138 ms
51,244 KB
testcase_03 AC 102 ms
48,940 KB
testcase_04 AC 163 ms
53,164 KB
testcase_05 AC 173 ms
54,444 KB
testcase_06 AC 340 ms
68,268 KB
testcase_07 AC 340 ms
68,140 KB
testcase_08 AC 366 ms
68,140 KB
testcase_09 AC 341 ms
68,140 KB
testcase_10 AC 340 ms
68,268 KB
testcase_11 AC 103 ms
48,940 KB
testcase_12 AC 111 ms
48,940 KB
testcase_13 AC 103 ms
49,068 KB
testcase_14 AC 103 ms
49,068 KB
testcase_15 AC 101 ms
48,940 KB
testcase_16 AC 101 ms
48,940 KB
testcase_17 AC 101 ms
48,940 KB
testcase_18 AC 102 ms
48,940 KB
testcase_19 AC 101 ms
48,940 KB
testcase_20 AC 103 ms
48,940 KB
testcase_21 AC 116 ms
48,940 KB
testcase_22 AC 102 ms
48,932 KB
testcase_23 AC 101 ms
48,932 KB
testcase_24 RE -
testcase_25 AC 101 ms
48,932 KB
testcase_26 AC 103 ms
48,932 KB
testcase_27 AC 103 ms
48,932 KB
testcase_28 AC 101 ms
48,932 KB
testcase_29 AC 102 ms
48,932 KB
testcase_30 AC 101 ms
48,932 KB
testcase_31 AC 101 ms
48,940 KB
testcase_32 AC 128 ms
48,940 KB
testcase_33 AC 103 ms
48,940 KB
testcase_34 AC 102 ms
48,940 KB
testcase_35 AC 102 ms
48,940 KB
testcase_36 AC 101 ms
48,940 KB
testcase_37 AC 97 ms
48,804 KB
testcase_38 AC 102 ms
48,932 KB
testcase_39 AC 102 ms
48,932 KB
testcase_40 AC 101 ms
48,932 KB
testcase_41 AC 103 ms
48,932 KB
testcase_42 AC 101 ms
48,932 KB
testcase_43 AC 103 ms
48,932 KB
testcase_44 AC 101 ms
48,932 KB
testcase_45 AC 103 ms
48,932 KB
testcase_46 AC 102 ms
48,932 KB
testcase_47 AC 101 ms
48,932 KB
testcase_48 AC 128 ms
48,932 KB
testcase_49 AC 106 ms
48,932 KB
testcase_50 AC 102 ms
48,932 KB
testcase_51 AC 100 ms
48,932 KB
testcase_52 AC 100 ms
48,932 KB
testcase_53 AC 100 ms
48,932 KB
testcase_54 AC 101 ms
48,932 KB
testcase_55 AC 100 ms
48,932 KB
testcase_56 AC 101 ms
48,932 KB
testcase_57 AC 102 ms
48,932 KB
testcase_58 AC 101 ms
48,932 KB
testcase_59 AC 100 ms
48,932 KB
testcase_60 AC 101 ms
48,932 KB
testcase_61 AC 100 ms
48,932 KB
testcase_62 AC 100 ms
48,932 KB
testcase_63 AC 101 ms
48,932 KB
testcase_64 AC 100 ms
48,932 KB
testcase_65 AC 101 ms
48,932 KB
testcase_66 AC 108 ms
48,932 KB
testcase_67 AC 100 ms
48,932 KB
testcase_68 AC 103 ms
48,932 KB
testcase_69 AC 102 ms
48,932 KB
testcase_70 AC 104 ms
48,932 KB
testcase_71 AC 102 ms
48,932 KB
testcase_72 AC 102 ms
48,932 KB
testcase_73 AC 102 ms
48,940 KB
testcase_74 AC 104 ms
49,068 KB
testcase_75 AC 104 ms
49,068 KB
testcase_76 AC 102 ms
49,068 KB
testcase_77 AC 104 ms
49,068 KB
testcase_78 AC 102 ms
49,068 KB
testcase_79 AC 102 ms
49,068 KB
testcase_80 AC 103 ms
49,068 KB
testcase_81 AC 103 ms
49,068 KB
testcase_82 AC 114 ms
49,068 KB
testcase_83 AC 102 ms
49,068 KB
testcase_84 AC 106 ms
49,068 KB
testcase_85 AC 102 ms
49,068 KB
testcase_86 AC 105 ms
49,068 KB
testcase_87 AC 104 ms
49,068 KB
testcase_88 AC 103 ms
49,068 KB
testcase_89 AC 104 ms
49,068 KB
testcase_90 AC 121 ms
49,068 KB
testcase_91 AC 105 ms
49,068 KB
testcase_92 AC 306 ms
63,788 KB
testcase_93 AC 254 ms
61,868 KB
testcase_94 AC 247 ms
60,972 KB
testcase_95 AC 329 ms
67,116 KB
testcase_96 AC 331 ms
67,372 KB
testcase_97 AC 316 ms
65,708 KB
testcase_98 AC 341 ms
65,580 KB
testcase_99 AC 324 ms
66,604 KB
testcase_100 AC 254 ms
61,740 KB
testcase_101 AC 350 ms
65,708 KB
evil_1_rnd_1.txt AC 584 ms
72,748 KB
evil_1_rnd_2.txt AC 615 ms
72,748 KB
evil_2_big_1.txt AC 666 ms
72,876 KB
evil_2_big_2.txt AC 694 ms
72,876 KB
evil_2_big_3.txt AC 663 ms
72,876 KB
evil_3_sorted_1.txt AC 450 ms
72,748 KB
evil_4_sorted_rev_1.txt AC 361 ms
70,828 KB
evil_4_sorted_rev_2.txt AC 499 ms
72,748 KB
evil_400_sorted.txt AC 643 ms
72,876 KB
evil_400_sorted_rev.txt AC 721 ms
72,876 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (103 ms)。
MSBuild のバージョン 17.7.3+8ec440e68 (.NET)
  main -> /home/judge/data/code/bin/Release/net7.0/main.dll
  main -> /home/judge/data/code/bin/Release/net7.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 list = new List<int>(n);
        for (var i = 0; i < n; ++i) list.Add(i + 1);
        var ans = new List<int>(n);
        for (var i = 0; i + 1 < n; ++i)
        {
             var ok = 0;
             var ng = list.Count;
             while (ng - ok > 1)
             {
                var mid = (ok + ng) / 2;
                var a = Query(ans.Concat(list.Skip(mid).Take(1)).Concat(list.Take(mid)).Concat(list.Skip(mid + 1)));
                if (a < 0) return;
                if (a > 0) ok = mid;
                else ng = mid;
             }
             ans.Add(list[ok]);
             list.RemoveAt(ok);
        }
        ans.Add(list[0]);
        WriteLine("! " + string.Join(" ", ans));
    }
    static int Query(IEnumerable<int> list)
    {
        WriteLine($"? {string.Join(" ", list)}");
        return NN;
    }
}
0