結果
問題 | No.1306 Exactly 2 Digits |
ユーザー | ransewhale |
提出日時 | 2020-12-15 09:31:41 |
言語 | C++17 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 2,061 bytes |
コンパイル時間 | 1,130 ms |
コンパイル使用メモリ | 98,576 KB |
実行使用メモリ | 25,836 KB |
平均クエリ数 | 1236.78 |
最終ジャッジ日時 | 2024-07-17 10:09:44 |
合計ジャッジ時間 | 17,084 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 24 ms
24,800 KB |
testcase_01 | WA | - |
testcase_02 | AC | 22 ms
24,952 KB |
testcase_03 | WA | - |
testcase_04 | AC | 24 ms
24,836 KB |
testcase_05 | AC | 23 ms
25,220 KB |
testcase_06 | AC | 24 ms
24,580 KB |
testcase_07 | AC | 24 ms
25,220 KB |
testcase_08 | AC | 23 ms
24,836 KB |
testcase_09 | AC | 24 ms
24,964 KB |
testcase_10 | AC | 24 ms
24,964 KB |
testcase_11 | WA | - |
testcase_12 | AC | 23 ms
24,836 KB |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | AC | 23 ms
24,556 KB |
testcase_16 | AC | 23 ms
24,940 KB |
testcase_17 | WA | - |
testcase_18 | AC | 24 ms
24,812 KB |
testcase_19 | AC | 23 ms
24,940 KB |
testcase_20 | AC | 23 ms
25,180 KB |
testcase_21 | AC | 23 ms
24,556 KB |
testcase_22 | AC | 23 ms
24,940 KB |
testcase_23 | AC | 23 ms
24,940 KB |
testcase_24 | AC | 25 ms
24,940 KB |
testcase_25 | AC | 24 ms
25,196 KB |
testcase_26 | AC | 23 ms
25,324 KB |
testcase_27 | AC | 23 ms
25,052 KB |
testcase_28 | AC | 23 ms
25,196 KB |
testcase_29 | AC | 23 ms
24,812 KB |
testcase_30 | AC | 23 ms
25,196 KB |
testcase_31 | AC | 22 ms
25,196 KB |
testcase_32 | WA | - |
testcase_33 | AC | 24 ms
25,196 KB |
testcase_34 | AC | 23 ms
24,812 KB |
testcase_35 | AC | 22 ms
24,940 KB |
testcase_36 | AC | 23 ms
24,940 KB |
testcase_37 | AC | 23 ms
25,452 KB |
testcase_38 | WA | - |
testcase_39 | WA | - |
testcase_40 | AC | 24 ms
24,812 KB |
testcase_41 | AC | 24 ms
24,940 KB |
testcase_42 | AC | 24 ms
24,812 KB |
testcase_43 | AC | 24 ms
24,796 KB |
testcase_44 | AC | 26 ms
24,812 KB |
testcase_45 | AC | 25 ms
24,812 KB |
testcase_46 | AC | 26 ms
24,556 KB |
testcase_47 | AC | 27 ms
24,940 KB |
testcase_48 | AC | 29 ms
25,196 KB |
testcase_49 | AC | 28 ms
24,556 KB |
testcase_50 | AC | 29 ms
24,812 KB |
testcase_51 | AC | 30 ms
24,812 KB |
testcase_52 | AC | 32 ms
25,196 KB |
testcase_53 | AC | 35 ms
24,940 KB |
testcase_54 | AC | 34 ms
24,940 KB |
testcase_55 | AC | 36 ms
24,812 KB |
testcase_56 | AC | 37 ms
25,452 KB |
testcase_57 | AC | 39 ms
24,556 KB |
testcase_58 | AC | 41 ms
25,196 KB |
testcase_59 | AC | 40 ms
24,868 KB |
testcase_60 | AC | 48 ms
24,556 KB |
testcase_61 | AC | 51 ms
24,812 KB |
testcase_62 | AC | 51 ms
25,196 KB |
testcase_63 | AC | 55 ms
24,940 KB |
testcase_64 | AC | 52 ms
24,812 KB |
testcase_65 | AC | 56 ms
25,452 KB |
testcase_66 | AC | 62 ms
25,184 KB |
testcase_67 | AC | 64 ms
25,196 KB |
testcase_68 | AC | 64 ms
24,556 KB |
testcase_69 | AC | 67 ms
24,940 KB |
testcase_70 | AC | 68 ms
24,556 KB |
testcase_71 | AC | 73 ms
25,196 KB |
testcase_72 | AC | 73 ms
24,544 KB |
testcase_73 | AC | 72 ms
24,812 KB |
testcase_74 | AC | 85 ms
25,196 KB |
testcase_75 | AC | 81 ms
24,812 KB |
testcase_76 | AC | 93 ms
24,556 KB |
testcase_77 | AC | 98 ms
25,196 KB |
testcase_78 | AC | 106 ms
24,556 KB |
testcase_79 | AC | 116 ms
24,940 KB |
testcase_80 | AC | 120 ms
25,196 KB |
testcase_81 | AC | 103 ms
24,940 KB |
testcase_82 | AC | 125 ms
25,196 KB |
testcase_83 | AC | 131 ms
24,812 KB |
testcase_84 | AC | 138 ms
24,812 KB |
testcase_85 | AC | 147 ms
24,940 KB |
testcase_86 | AC | 123 ms
25,580 KB |
testcase_87 | AC | 127 ms
24,812 KB |
testcase_88 | AC | 152 ms
24,556 KB |
testcase_89 | AC | 129 ms
24,940 KB |
testcase_90 | AC | 119 ms
24,556 KB |
testcase_91 | AC | 126 ms
25,148 KB |
testcase_92 | AC | 119 ms
24,928 KB |
testcase_93 | AC | 138 ms
24,940 KB |
testcase_94 | AC | 115 ms
24,556 KB |
testcase_95 | AC | 122 ms
24,892 KB |
testcase_96 | AC | 112 ms
25,196 KB |
testcase_97 | AC | 115 ms
24,940 KB |
testcase_98 | AC | 108 ms
25,196 KB |
testcase_99 | AC | 124 ms
24,940 KB |
testcase_100 | AC | 125 ms
24,940 KB |
testcase_101 | AC | 136 ms
24,556 KB |
testcase_102 | AC | 113 ms
25,196 KB |
testcase_103 | AC | 120 ms
25,196 KB |
testcase_104 | AC | 123 ms
24,812 KB |
testcase_105 | AC | 126 ms
25,324 KB |
testcase_106 | AC | 111 ms
25,196 KB |
testcase_107 | AC | 126 ms
24,812 KB |
testcase_108 | AC | 118 ms
24,556 KB |
testcase_109 | AC | 141 ms
24,812 KB |
testcase_110 | AC | 114 ms
24,812 KB |
testcase_111 | AC | 119 ms
24,812 KB |
testcase_112 | AC | 108 ms
24,556 KB |
testcase_113 | AC | 145 ms
25,196 KB |
testcase_114 | AC | 144 ms
24,940 KB |
testcase_115 | AC | 124 ms
25,196 KB |
testcase_116 | AC | 155 ms
25,196 KB |
testcase_117 | AC | 129 ms
24,940 KB |
testcase_118 | AC | 138 ms
25,196 KB |
testcase_119 | AC | 121 ms
24,800 KB |
testcase_120 | AC | 111 ms
25,196 KB |
testcase_121 | AC | 132 ms
24,556 KB |
testcase_122 | AC | 128 ms
25,168 KB |
ソースコード
#include <stdio.h> #include <iostream> #include <vector> #include <queue> #include <set> #include <map> #include <algorithm> using ll = long long int; const int INF = (1<<30); const ll INFLL = (1ll<<60); const ll MOD = (ll)(1e9+7); #define l_ength size void mul_mod(ll& a, ll b){ a *= b; a %= MOD; } void add_mod(ll& a, ll b){ a = (a<MOD)?a:(a-MOD); b = (b<MOD)?b:(b-MOD); a += b; a = (a<MOD)?a:(a-MOD); } std::map<std::vector<int>, int > dic; std::vector<int> v(100); int ans[2525],s[2525],t[2525],x,y,n; bool used[55][55]; bool check(int p, int q){ return (1<=x-p && x-p <n && 0<=y-q && y-q < n && (!used[x-p][y-q])); } int main(void){ int i,j,p,q,m,z; std::cin >> n; m = n*n-n; for(x=1; x<n; ++x){ for(y=0; y<n; ++y){ std::fill(v.begin(),v.end(),0); for(i=1; i<n; ++i){ for(j=0; j<n; ++j){ p = x-i; q = y-j; ++v[p+50]; ++v[q+50]; } } v[50] -= 2; dic[v] = x*n+y; } } std::fill(v.begin(),v.end(),0); for(i=2; i<=m; ++i){ std::cout << "? 1 " << i << std::endl; std::cin >> s[i] >> t[i]; ++v[s[i]+50]; ++v[t[i]+50]; } ans[1] = dic[v]; x = ans[1]/n; y = ans[1]%n; z = 1; used[x][y] = true; for(i=2; i<=m; ++i){ if(s[i] == std::min(x-1,y) && t[i] == std::max(x-1,y)){ z = i; } } for(i=2; i<=m; ++i){ if(s[i] == t[i]){ used[x-s[i]][y-t[i]] = true; ans[i] = (x-s[i])*n+(y-t[i]); continue; } if(!check(s[i],t[i])){ used[x-t[i]][y-s[i]] = true; ans[i] = (x-t[i])*n+(y-s[i]); continue; } if(!check(t[i],s[i])){ used[x-s[i]][y-t[i]] = true; ans[i] = (x-s[i])*n+(y-t[i]); continue; } std::cout << "? " << i << " " << z << std::endl; std::cin >> p >> q; ++p; if(s[i] == std::min(x-p,y-q) && t[i] == std::max(x-p,y-q)){ used[p][q] = true; ans[i] = p*n+q; continue; } --p; std::swap(p,q); ++p; if(s[i] == std::min(x-p,y-q) && t[i] == std::max(x-p,y-q)){ used[p][q] = true; ans[i] = p*n+q; continue; } --p; } std::cout << "!"; for(i=1; i<=m; ++i){ std::cout << " " << ans[i]; } std::cout << std::endl; return 0; }