結果

問題 No.5020 Averaging
ユーザー 👑 p-adicp-adic
提出日時 2024-02-25 16:38:51
言語 cLay
(20240104-1)
結果
AC  
実行時間 917 ms / 1,000 ms
コード長 569 bytes
コンパイル時間 4,235 ms
コンパイル使用メモリ 197,152 KB
実行使用メモリ 7,744 KB
スコア 21,314,594
最終ジャッジ日時 2024-02-25 16:39:53
合計ジャッジ時間 52,650 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
純コード判定しない問題か言語
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 890 ms
7,744 KB
testcase_01 AC 900 ms
7,744 KB
testcase_02 AC 913 ms
7,744 KB
testcase_03 AC 890 ms
7,744 KB
testcase_04 AC 886 ms
7,744 KB
testcase_05 AC 914 ms
7,744 KB
testcase_06 AC 888 ms
7,744 KB
testcase_07 AC 889 ms
7,744 KB
testcase_08 AC 888 ms
7,744 KB
testcase_09 AC 892 ms
7,744 KB
testcase_10 AC 891 ms
7,744 KB
testcase_11 AC 890 ms
7,744 KB
testcase_12 AC 912 ms
7,744 KB
testcase_13 AC 888 ms
7,744 KB
testcase_14 AC 912 ms
7,744 KB
testcase_15 AC 889 ms
7,744 KB
testcase_16 AC 890 ms
7,744 KB
testcase_17 AC 917 ms
7,744 KB
testcase_18 AC 890 ms
7,744 KB
testcase_19 AC 888 ms
7,744 KB
testcase_20 AC 886 ms
7,744 KB
testcase_21 AC 892 ms
7,744 KB
testcase_22 AC 912 ms
7,744 KB
testcase_23 AC 892 ms
7,744 KB
testcase_24 AC 889 ms
7,744 KB
testcase_25 AC 891 ms
7,744 KB
testcase_26 AC 913 ms
7,744 KB
testcase_27 AC 896 ms
7,744 KB
testcase_28 AC 913 ms
7,744 KB
testcase_29 AC 897 ms
7,744 KB
testcase_30 AC 888 ms
7,744 KB
testcase_31 AC 890 ms
7,744 KB
testcase_32 AC 912 ms
7,744 KB
testcase_33 AC 890 ms
7,744 KB
testcase_34 AC 904 ms
7,744 KB
testcase_35 AC 912 ms
7,744 KB
testcase_36 AC 911 ms
7,744 KB
testcase_37 AC 891 ms
7,744 KB
testcase_38 AC 912 ms
7,744 KB
testcase_39 AC 890 ms
7,744 KB
testcase_40 AC 912 ms
7,744 KB
testcase_41 AC 888 ms
7,744 KB
testcase_42 AC 915 ms
7,744 KB
testcase_43 AC 893 ms
7,744 KB
testcase_44 AC 911 ms
7,744 KB
testcase_45 AC 911 ms
7,744 KB
testcase_46 AC 915 ms
7,744 KB
testcase_47 AC 891 ms
7,744 KB
testcase_48 AC 893 ms
7,744 KB
testcase_49 AC 890 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-15;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*=1.7;M=N;B=A;REP(c,M-1-(n&1)){s=1e18**e*N;rep(u,M)rep(v,u+1,M){C=B;f(u,v);t=sum[i,0,M]((i==0?N-M:1)*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