結果
問題 | No.2577 Simple Permutation Guess |
ユーザー | fiblonaria |
提出日時 | 2023-12-09 09:30:39 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 1,923 ms / 2,000 ms |
コード長 | 767 bytes |
コンパイル時間 | 228 ms |
コンパイル使用メモリ | 82,048 KB |
実行使用メモリ | 99,168 KB |
平均クエリ数 | 248.84 |
最終ジャッジ日時 | 2024-09-27 03:32:45 |
合計ジャッジ時間 | 67,448 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 65 ms
68,704 KB |
testcase_01 | AC | 1,325 ms
96,512 KB |
testcase_02 | AC | 223 ms
93,024 KB |
testcase_03 | AC | 64 ms
68,960 KB |
testcase_04 | AC | 365 ms
93,280 KB |
testcase_05 | AC | 466 ms
93,280 KB |
testcase_06 | AC | 1,923 ms
98,924 KB |
testcase_07 | AC | 1,910 ms
96,912 KB |
testcase_08 | AC | 1,901 ms
97,652 KB |
testcase_09 | AC | 1,912 ms
97,684 KB |
testcase_10 | AC | 1,910 ms
99,168 KB |
testcase_11 | AC | 71 ms
76,128 KB |
testcase_12 | AC | 62 ms
68,320 KB |
testcase_13 | AC | 92 ms
83,168 KB |
testcase_14 | AC | 79 ms
78,688 KB |
testcase_15 | AC | 64 ms
69,088 KB |
testcase_16 | AC | 63 ms
69,096 KB |
testcase_17 | AC | 61 ms
68,320 KB |
testcase_18 | AC | 62 ms
68,192 KB |
testcase_19 | AC | 62 ms
68,960 KB |
testcase_20 | AC | 62 ms
68,064 KB |
testcase_21 | AC | 62 ms
68,192 KB |
testcase_22 | AC | 62 ms
68,856 KB |
testcase_23 | AC | 64 ms
68,432 KB |
testcase_24 | AC | 64 ms
68,696 KB |
testcase_25 | AC | 64 ms
68,696 KB |
testcase_26 | AC | 64 ms
68,576 KB |
testcase_27 | AC | 63 ms
68,824 KB |
testcase_28 | AC | 63 ms
68,568 KB |
testcase_29 | AC | 63 ms
68,312 KB |
testcase_30 | AC | 63 ms
68,440 KB |
testcase_31 | AC | 64 ms
68,704 KB |
testcase_32 | AC | 64 ms
68,696 KB |
testcase_33 | AC | 64 ms
69,088 KB |
testcase_34 | AC | 63 ms
68,192 KB |
testcase_35 | AC | 63 ms
68,192 KB |
testcase_36 | AC | 64 ms
68,704 KB |
testcase_37 | AC | 62 ms
68,192 KB |
testcase_38 | AC | 63 ms
68,432 KB |
testcase_39 | AC | 62 ms
68,440 KB |
testcase_40 | AC | 63 ms
68,448 KB |
testcase_41 | AC | 63 ms
68,704 KB |
testcase_42 | AC | 62 ms
67,936 KB |
testcase_43 | AC | 62 ms
68,192 KB |
testcase_44 | AC | 62 ms
68,704 KB |
testcase_45 | AC | 62 ms
68,448 KB |
testcase_46 | AC | 61 ms
68,704 KB |
testcase_47 | AC | 63 ms
68,192 KB |
testcase_48 | AC | 63 ms
68,576 KB |
testcase_49 | AC | 63 ms
68,568 KB |
testcase_50 | AC | 64 ms
68,312 KB |
testcase_51 | AC | 62 ms
69,080 KB |
testcase_52 | AC | 64 ms
68,440 KB |
testcase_53 | AC | 63 ms
68,952 KB |
testcase_54 | AC | 62 ms
68,688 KB |
testcase_55 | AC | 62 ms
68,824 KB |
testcase_56 | AC | 63 ms
68,696 KB |
testcase_57 | AC | 63 ms
68,312 KB |
testcase_58 | AC | 61 ms
68,512 KB |
testcase_59 | AC | 63 ms
68,056 KB |
testcase_60 | AC | 62 ms
68,568 KB |
testcase_61 | AC | 62 ms
68,056 KB |
testcase_62 | AC | 63 ms
68,576 KB |
testcase_63 | AC | 62 ms
68,312 KB |
testcase_64 | AC | 61 ms
67,928 KB |
testcase_65 | AC | 63 ms
68,568 KB |
testcase_66 | AC | 64 ms
68,312 KB |
testcase_67 | AC | 62 ms
68,696 KB |
testcase_68 | AC | 62 ms
68,312 KB |
testcase_69 | AC | 64 ms
68,440 KB |
testcase_70 | AC | 63 ms
68,824 KB |
testcase_71 | AC | 63 ms
68,552 KB |
testcase_72 | AC | 62 ms
68,696 KB |
testcase_73 | AC | 62 ms
68,448 KB |
testcase_74 | AC | 87 ms
81,120 KB |
testcase_75 | AC | 87 ms
80,864 KB |
testcase_76 | AC | 87 ms
81,120 KB |
testcase_77 | AC | 87 ms
81,120 KB |
testcase_78 | AC | 86 ms
80,736 KB |
testcase_79 | AC | 88 ms
80,736 KB |
testcase_80 | AC | 93 ms
82,784 KB |
testcase_81 | AC | 93 ms
82,272 KB |
testcase_82 | AC | 95 ms
83,680 KB |
testcase_83 | AC | 93 ms
82,912 KB |
testcase_84 | AC | 94 ms
83,552 KB |
testcase_85 | AC | 92 ms
82,912 KB |
testcase_86 | AC | 95 ms
83,808 KB |
testcase_87 | AC | 95 ms
83,528 KB |
testcase_88 | AC | 96 ms
83,784 KB |
testcase_89 | AC | 96 ms
84,168 KB |
testcase_90 | AC | 96 ms
84,264 KB |
testcase_91 | AC | 96 ms
83,528 KB |
testcase_92 | AC | 1,375 ms
95,048 KB |
testcase_93 | AC | 1,197 ms
95,560 KB |
testcase_94 | AC | 1,078 ms
95,296 KB |
testcase_95 | AC | 1,765 ms
96,468 KB |
testcase_96 | AC | 1,785 ms
98,504 KB |
testcase_97 | AC | 1,621 ms
97,296 KB |
testcase_98 | AC | 1,575 ms
96,900 KB |
testcase_99 | AC | 1,685 ms
96,356 KB |
testcase_100 | AC | 1,153 ms
95,560 KB |
testcase_101 | AC | 1,588 ms
96,520 KB |
evil_1_rnd_1.txt | TLE | - |
evil_1_rnd_2.txt | TLE | - |
evil_2_big_1.txt | TLE | - |
evil_2_big_2.txt | TLE | - |
evil_2_big_3.txt | TLE | - |
evil_3_sorted_1.txt | TLE | - |
evil_4_sorted_rev_1.txt | TLE | - |
evil_4_sorted_rev_2.txt | TLE | - |
evil_400_sorted.txt | TLE | - |
evil_400_sorted_rev.txt | TLE | - |
ソースコード
import sys def perm(N, ord, fac): L = [None for i in range(N)] for i in range(N): L[i] = ord // fac[N - i - 1] ord %= fac[N - i - 1] ans = [None for i in range(N)] used = [1 for i in range(N)] for i in range(N): temp = 0 for j in range(N): temp += used[j] if temp == L[i] + 1: ans[i] = j + 1 used[j] = 0 break return ans N = int(input()) fac = [1 for i in range(N)] for i in range(1, N): fac[i] = fac[i - 1] * i m = [0, fac[N - 1] * N] while m[1] - m[0] > 1: mid = (m[0] + m[1]) // 2 perm_mid = perm(N, mid, fac) print('?', *perm_mid) sys.stdout.flush() m[1 - int(input())] = mid print('!', *perm(N, m[0], fac))