結果

問題 No.5020 Averaging
ユーザー 👑 p-adicp-adic
提出日時 2024-02-25 15:14:18
言語 cLay
(20240104-1)
結果
AC  
実行時間 5 ms / 1,000 ms
コード長 430 bytes
コンパイル時間 3,150 ms
コンパイル使用メモリ 184,908 KB
実行使用メモリ 7,488 KB
スコア 13,964,292
最終ジャッジ日時 2024-02-25 15:14:23
合計ジャッジ時間 4,938 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
純コード判定しない問題か言語
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 4 ms
7,488 KB
testcase_01 AC 3 ms
7,488 KB
testcase_02 AC 4 ms
7,488 KB
testcase_03 AC 3 ms
7,488 KB
testcase_04 AC 4 ms
7,488 KB
testcase_05 AC 4 ms
7,488 KB
testcase_06 AC 4 ms
7,488 KB
testcase_07 AC 4 ms
7,488 KB
testcase_08 AC 4 ms
7,488 KB
testcase_09 AC 4 ms
7,488 KB
testcase_10 AC 4 ms
7,488 KB
testcase_11 AC 3 ms
7,488 KB
testcase_12 AC 4 ms
7,488 KB
testcase_13 AC 4 ms
7,488 KB
testcase_14 AC 3 ms
7,488 KB
testcase_15 AC 4 ms
7,488 KB
testcase_16 AC 4 ms
7,488 KB
testcase_17 AC 3 ms
7,488 KB
testcase_18 AC 3 ms
7,488 KB
testcase_19 AC 3 ms
7,488 KB
testcase_20 AC 4 ms
7,488 KB
testcase_21 AC 4 ms
7,488 KB
testcase_22 AC 4 ms
7,488 KB
testcase_23 AC 4 ms
7,488 KB
testcase_24 AC 4 ms
7,488 KB
testcase_25 AC 4 ms
7,488 KB
testcase_26 AC 4 ms
7,488 KB
testcase_27 AC 4 ms
7,488 KB
testcase_28 AC 4 ms
7,488 KB
testcase_29 AC 3 ms
7,488 KB
testcase_30 AC 4 ms
7,488 KB
testcase_31 AC 4 ms
7,488 KB
testcase_32 AC 4 ms
7,488 KB
testcase_33 AC 4 ms
7,488 KB
testcase_34 AC 4 ms
7,488 KB
testcase_35 AC 3 ms
7,488 KB
testcase_36 AC 3 ms
7,488 KB
testcase_37 AC 3 ms
7,488 KB
testcase_38 AC 4 ms
7,488 KB
testcase_39 AC 5 ms
7,488 KB
testcase_40 AC 4 ms
7,488 KB
testcase_41 AC 3 ms
7,488 KB
testcase_42 AC 4 ms
7,488 KB
testcase_43 AC 4 ms
7,488 KB
testcase_44 AC 4 ms
7,488 KB
testcase_45 AC 4 ms
7,488 KB
testcase_46 AC 4 ms
7,488 KB
testcase_47 AC 4 ms
7,488 KB
testcase_48 AC 4 ms
7,488 KB
testcase_49 AC 4 ms
7,488 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:273:10: warning: structured bindings only available with ‘-std=c++17’ or ‘-std=gnu++17’
  273 |     auto&[a,b,j]=A[i];
      |          ^
main.cpp: In lambda function:
main.cpp:278:44: warning: structured bindings only available with ‘-std=c++17’ or ‘-std=gnu++17’
  278 |   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:278:62: warning: structured bindings only available with ‘-std=c++17’ or ‘-std=gnu++17’
  278 |   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,L=5e17,x,y,s,t,p,q;vector<tuple<ll,ll,int>>A(N),C;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])-L),q=abs(get<1>(C[i])-L);return max(p,q);};wt(N-1);REP(N-1){s=1e18;rep(u,N)rep(v,u+1,N){C=A;f(u,v);t=max[i,0,N](m(i));if(s>t)s=t,x=u,y=v;}s=get<2>(A[x]);t=get<2>(A[y]);wt(s,t);C=A;f(x,y);A=C;N--;}
0