結果
問題 | No.1306 Exactly 2 Digits |
ユーザー | hotman78 |
提出日時 | 2020-12-03 08:53:38 |
言語 | C++17 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 6,402 bytes |
コンパイル時間 | 4,317 ms |
コンパイル使用メモリ | 264,784 KB |
実行使用メモリ | 25,836 KB |
平均クエリ数 | 1019.20 |
最終ジャッジ日時 | 2024-07-17 08:34:58 |
合計ジャッジ時間 | 64,510 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 24 ms
24,556 KB |
testcase_01 | WA | - |
testcase_02 | AC | 22 ms
24,964 KB |
testcase_03 | RE | - |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | AC | 22 ms
24,836 KB |
testcase_07 | AC | 21 ms
24,580 KB |
testcase_08 | AC | 23 ms
24,964 KB |
testcase_09 | RE | - |
testcase_10 | RE | - |
testcase_11 | RE | - |
testcase_12 | WA | - |
testcase_13 | RE | - |
testcase_14 | RE | - |
testcase_15 | RE | - |
testcase_16 | RE | - |
testcase_17 | RE | - |
testcase_18 | RE | - |
testcase_19 | RE | - |
testcase_20 | RE | - |
testcase_21 | RE | - |
testcase_22 | RE | - |
testcase_23 | RE | - |
testcase_24 | RE | - |
testcase_25 | RE | - |
testcase_26 | RE | - |
testcase_27 | RE | - |
testcase_28 | RE | - |
testcase_29 | RE | - |
testcase_30 | RE | - |
testcase_31 | RE | - |
testcase_32 | RE | - |
testcase_33 | RE | - |
testcase_34 | RE | - |
testcase_35 | RE | - |
testcase_36 | RE | - |
testcase_37 | RE | - |
testcase_38 | RE | - |
testcase_39 | RE | - |
testcase_40 | RE | - |
testcase_41 | RE | - |
testcase_42 | RE | - |
testcase_43 | RE | - |
testcase_44 | RE | - |
testcase_45 | RE | - |
testcase_46 | RE | - |
testcase_47 | RE | - |
testcase_48 | RE | - |
testcase_49 | RE | - |
testcase_50 | RE | - |
testcase_51 | RE | - |
testcase_52 | RE | - |
testcase_53 | RE | - |
testcase_54 | RE | - |
testcase_55 | RE | - |
testcase_56 | RE | - |
testcase_57 | RE | - |
testcase_58 | RE | - |
testcase_59 | RE | - |
testcase_60 | RE | - |
testcase_61 | RE | - |
testcase_62 | RE | - |
testcase_63 | RE | - |
testcase_64 | RE | - |
testcase_65 | RE | - |
testcase_66 | RE | - |
testcase_67 | RE | - |
testcase_68 | RE | - |
testcase_69 | RE | - |
testcase_70 | RE | - |
testcase_71 | RE | - |
testcase_72 | RE | - |
testcase_73 | RE | - |
testcase_74 | RE | - |
testcase_75 | RE | - |
testcase_76 | RE | - |
testcase_77 | RE | - |
testcase_78 | RE | - |
testcase_79 | RE | - |
testcase_80 | RE | - |
testcase_81 | RE | - |
testcase_82 | RE | - |
testcase_83 | RE | - |
testcase_84 | RE | - |
testcase_85 | RE | - |
testcase_86 | RE | - |
testcase_87 | RE | - |
testcase_88 | RE | - |
testcase_89 | RE | - |
testcase_90 | RE | - |
testcase_91 | RE | - |
testcase_92 | RE | - |
testcase_93 | RE | - |
testcase_94 | RE | - |
testcase_95 | RE | - |
testcase_96 | RE | - |
testcase_97 | RE | - |
testcase_98 | RE | - |
testcase_99 | RE | - |
testcase_100 | RE | - |
testcase_101 | RE | - |
testcase_102 | RE | - |
testcase_103 | RE | - |
testcase_104 | RE | - |
testcase_105 | RE | - |
testcase_106 | RE | - |
testcase_107 | RE | - |
testcase_108 | RE | - |
testcase_109 | RE | - |
testcase_110 | RE | - |
testcase_111 | RE | - |
testcase_112 | RE | - |
testcase_113 | RE | - |
testcase_114 | RE | - |
testcase_115 | RE | - |
testcase_116 | RE | - |
testcase_117 | RE | - |
testcase_118 | RE | - |
testcase_119 | RE | - |
testcase_120 | RE | - |
testcase_121 | RE | - |
testcase_122 | RE | - |
ソースコード
#line 2 "cpplib/util/template.hpp" #pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") #pragma GCC target("avx2") #include<bits/stdc++.h> using namespace std; struct __INIT__{__INIT__(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}}__INIT__; typedef long long lint; #define INF (1LL<<60) #define IINF (1<<30) #define EPS (1e-10) #define endl ('\n') typedef vector<lint> vec; typedef vector<vector<lint>> mat; typedef vector<vector<vector<lint>>> mat3; typedef vector<string> svec; typedef vector<vector<string>> smat; template<typename T>using V=vector<T>; template<typename T>using VV=V<V<T>>; template<typename T>inline void output(T t){bool f=0;for(auto i:t){cout<<(f?" ":"")<<i;f=1;}cout<<endl;} template<typename T>inline void output2(T t){for(auto i:t)output(i);} template<typename T>inline void debug(T t){bool f=0;for(auto i:t){cerr<<(f?" ":"")<<i;f=1;}cerr<<endl;} template<typename T>inline void debug2(T t){for(auto i:t)output(i);} #define loop(n) for(long long _=0;_<(long long)(n);++_) #define rep(i,...) for(auto i:range(__VA_ARGS__)) #define rrep(i,...) for(auto i:reversed(range(__VA_ARGS__))) #define repi(i,a,b) for(lint i=lint(a);i<(lint)(b);++i) #define rrepi(i,a,b) for(lint i=lint(b)-1;i>=lint(a);--i) #define irep(i) for(lint i=0;;++i) inline vector<long long> range(long long n){if(n<=0)return vector<long long>();vector<long long>v(n);iota(v.begin(),v.end(),0LL);return v;} inline vector<long long> range(long long a,long long b){if(b<=a)return vector<long long>();vector<long long>v(b-a);iota(v.begin(),v.end(),a);return v;} inline vector<long long> range(long long a,long long b,long long c){if((b-a+c-1)/c<=0)return vector<long long>();vector<long long>v((b-a+c-1)/c);for(int i=0;i<(int)v.size();++i)v[i]=i?v[i-1]+c:a;return v;} template<typename T>inline T reversed(T v){reverse(v.begin(),v.end());return v;} #define all(n) begin(n),end(n) template<typename T,typename E>bool chmin(T& s,const E& t){bool res=s>t;s=min<T>(s,t);return res;} template<typename T,typename E>bool chmax(T& s,const E& t){bool res=s<t;s=max<T>(s,t);return res;} const vector<lint> dx={1,0,-1,0,1,1,-1,-1}; const vector<lint> dy={0,1,0,-1,1,-1,1,-1}; #define SUM(v) accumulate(all(v),0LL) template<typename T,typename ...Args>auto make_vector(T x,int arg,Args ...args){if constexpr(sizeof...(args)==0)return vector<T>(arg,x);else return vector(arg,make_vector<T>(x,args...));} #define extrep(v,...) for(auto v:__MAKE_MAT__({__VA_ARGS__})) vector<vector<long long>> __MAKE_MAT__(vector<long long> v){if(v.empty())return vector<vector<long long>>(1,vector<long long>());long long n=v.back();v.pop_back();vector<vector<long long>> ret;vector<vector<long long>> tmp=__MAKE_MAT__(v);for(auto e:tmp)for(long long i=0;i<n;++i){ret.push_back(e);ret.back().push_back(i);}return ret;} //#include "../graph_tree/graph_template.hpp" template<typename T,typename E>ostream& operator<<(ostream& out,pair<T,E>v){out<<"("<<v.first<<","<<v.second<<")";return out;} #line 2 "code.cpp" // template<typename T> // struct poly{ // valarray<T> v; // using P=poly<T>; // poly(int sz=0,T x=T()){ // v.resize(sz,x); // } // int size()const{return v.size();} // P& operator+=(const P& x){v.resize(max(size(),x.size()));v+=x.v;return *this;} // P& operator-=(const P& x){v.resize(max(size(),x.size()));v-=x.v;return *this;} // P& operator*=(const P& x){v.resize(max(size(),x.size()));v*=x.v;return *this;} // P& operator/=(const P& x){v.resize(max(size(),x.size()));v/=x.v;return *this;} // P& operator%=(const P& x){v.resize(max(size(),x.size()));v%=x.v;return *this;} // P& operator^=(const P& x){v.resize(max(size(),x.size()));v^=x.v;return *this;} // P& operator&=(const P& x){v.resize(max(size(),x.size()));v&=x.v;return *this;} // P& operator|=(const P& x){v.resize(max(size(),x.size()));v|=x.v;return *this;} // T& operator[](int x){return v[x];} // T operator[](int x)const{return v[x];} // friend P min(const P& s,const P& t){ // if(s.size()>t.size()){ // P res=s; // for(int i=0;i<t.size();++i)res[i]=min(res[i],t[i]); // return res; // }else{ // P res=t; // for(int i=0;i<s.size();++i)res[i]=min(res[i],s[i]); // return res; // } // } // friend P max(const P& s,const P& t){ // if(s.size()>t.size()){ // P res=s; // for(int i=0;i<t.size();++i)res[i]=max(res[i],t[i]); // return res; // }else{ // P res=t; // for(int i=0;i<s.size();++i)res[i]=max(res[i],s[i]); // return res; // } // } // P& shift(int x){v.shift(x);return *this;} // template<typename F>P& apply(F f){for(auto& e:v)f(e);return *this;} // iterator begin(){return begin(v);} // iterator end(){return end(v);} // }; int main(){ lint n; cin>>n; map<int,map<int,vector<int>>>m; map<int,map<int,vector<int>>>m2; map<int,vector<pair<int,int>>>tmp; rep(i,n*n-n){ cout<<"?"<<" "<<(i+1)<<" "<<1<<endl<<flush; lint p,q; cin>>p>>q; m[p][q].emplace_back(i); tmp[p+q].emplace_back(p,q); } lint s=0; rep(i,n,n*n){ map<int,vector<pair<int,int>>>m2; rep(j,n,n*n){ lint p=j/n-i/n; lint q=j%n-i%n; if(p>q)swap(p,q); m2[p+q].emplace_back(p,q); } if(tmp==m2){ s=i; } } rep(i,n,n*n){ lint p=i/n-s/n; lint q=i%n-s%n; if(p>q)swap(p,q); m2[p][q].emplace_back(i); } lint n2=0; { lint p=(n-1)-s/n; lint q=0-s%n; if(p>q)swap(p,q); n2=m[p][q][0]; } vector<int>ans(n*n-n); for(auto [p,e]:m)for(auto [q,d]:e){ if(d.size()==1){ ans[d[0]]=m2[p][q][0]; }else{ cout<<"? "<<d[0]<<" "<<n2<<endl<<flush; lint s,t; cin>>s>>t; lint k=m2[p][q][0]; lint p2=k/n-(n-1),q2=k%n; if(p2>q2)swap(p2,q2); if(p2==p&&q2==q){ ans[d[0]]=m2[p][q][0]; ans[d[1]]=m2[p][q][1]; }else{ ans[d[0]]=m2[p][q][1]; ans[d[1]]=m2[p][q][0]; } } } cout<<"! "; output(ans); cout<<flush; }