結果

問題 No.5020 Averaging
ユーザー 👑 p-adicp-adic
提出日時 2024-02-25 16:59:59
言語 cLay
(20240104-1)
結果
AC  
実行時間 867 ms / 1,000 ms
コード長 581 bytes
コンパイル時間 3,482 ms
コンパイル使用メモリ 196,692 KB
実行使用メモリ 7,744 KB
スコア 23,918,263
最終ジャッジ日時 2024-02-25 17:05:10
合計ジャッジ時間 48,663 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
純コード判定しない問題か言語
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 838 ms
7,744 KB
testcase_01 AC 843 ms
7,744 KB
testcase_02 AC 834 ms
7,744 KB
testcase_03 AC 839 ms
7,744 KB
testcase_04 AC 834 ms
7,744 KB
testcase_05 AC 847 ms
7,744 KB
testcase_06 AC 864 ms
7,744 KB
testcase_07 AC 835 ms
7,744 KB
testcase_08 AC 836 ms
7,744 KB
testcase_09 AC 837 ms
7,744 KB
testcase_10 AC 838 ms
7,744 KB
testcase_11 AC 834 ms
7,744 KB
testcase_12 AC 840 ms
7,744 KB
testcase_13 AC 833 ms
7,744 KB
testcase_14 AC 838 ms
7,744 KB
testcase_15 AC 839 ms
7,744 KB
testcase_16 AC 837 ms
7,744 KB
testcase_17 AC 838 ms
7,744 KB
testcase_18 AC 841 ms
7,744 KB
testcase_19 AC 836 ms
7,744 KB
testcase_20 AC 836 ms
7,744 KB
testcase_21 AC 841 ms
7,744 KB
testcase_22 AC 840 ms
7,744 KB
testcase_23 AC 836 ms
7,744 KB
testcase_24 AC 836 ms
7,744 KB
testcase_25 AC 839 ms
7,744 KB
testcase_26 AC 836 ms
7,744 KB
testcase_27 AC 837 ms
7,744 KB
testcase_28 AC 841 ms
7,744 KB
testcase_29 AC 835 ms
7,744 KB
testcase_30 AC 838 ms
7,744 KB
testcase_31 AC 837 ms
7,744 KB
testcase_32 AC 841 ms
7,744 KB
testcase_33 AC 838 ms
7,744 KB
testcase_34 AC 836 ms
7,744 KB
testcase_35 AC 837 ms
7,744 KB
testcase_36 AC 838 ms
7,744 KB
testcase_37 AC 834 ms
7,744 KB
testcase_38 AC 836 ms
7,744 KB
testcase_39 AC 836 ms
7,744 KB
testcase_40 AC 835 ms
7,744 KB
testcase_41 AC 834 ms
7,744 KB
testcase_42 AC 839 ms
7,744 KB
testcase_43 AC 835 ms
7,744 KB
testcase_44 AC 839 ms
7,744 KB
testcase_45 AC 837 ms
7,744 KB
testcase_46 AC 844 ms
7,744 KB
testcase_47 AC 867 ms
7,744 KB
testcase_48 AC 867 ms
7,744 KB
testcase_49 AC 838 ms
7,744 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
warning: unknown type [auto] for rd (reader) : a
warning: unknown type [auto] for rd (reader) : b
main.cpp: In function ‘int main()’:
main.cpp:318:10: warning: structured bindings only available with ‘-std=c++17’ or ‘-std=gnu++17’
  318 |     auto&[a,b,j]=A[i];
      |          ^
main.cpp: In lambda function:
main.cpp:323:44: warning: structured bindings only available with ‘-std=c++17’ or ‘-std=gnu++17’
  323 |   auto f=[&](long long u,long long v){auto&[a,b,i]=C[u];auto&[c,d,j]=C[v];a=(a+c)/2;b=(b+d)/2;C.erase(C.begin()+v);};
      |                                            ^
main.cpp:323:62: warning: structured bindings only available with ‘-std=c++17’ or ‘-std=gnu++17’
  323 |   auto f=[&](long long u,long long v){auto&[a,b,i]=C[u];auto&[c,d,j]=C[v];a=(a+c)/2;b=(b+d)/2;C.erase(C.begin()+v);};
      |                                                              ^

ソースコード

diff #

ll@N,M,x,y,S=1e18;double s,t,p,q,e=1e-10;vector<tuple<ll,ll,int>>A(N),B,C;VVI a(N-1,VI(2)),b=a;rep(i,N){auto&[a,b,j]=A[i];rd(a,b);j=i+1;}auto f=[&](ll u,ll v){auto&[a,b,i]=C[u];auto&[c,d,j]=C[v];a=(a+c)/2;b=(b+d)/2;C.erase(C.begin()+v);};auto m=[&](ll i){p=abs(get<0>(C[i])-5e17),q=abs(get<1>(C[i])-5e17);return max(p,q);};rep(n,60){e*=(n&1?3.2:1.0);M=N;B=A;REP(c,M-1-(n&1)){s=1e18**e*M;rep(u,M)rep(v,u+1,M){C=B;f(u,v);t=sum[i,0,M-(n&1==1&&M==2)](m(i)**e);if(s>t)s=t,x=u,y=v;}b[c]={get<2>(B[x]),get<2>(B[y])};C=B;f(x,y);B=C;M--;}if(S>m(0))S=m(0),a=b;}wt(N-1);REP(c,N-1)wt(a[c](2));
0