保存されている過去のバージョンの一覧

2020年11月15日09時37分31秒

Codeforces Round #679 (based on Technocup 2021 Elimination Round 1) DIV1 A問題/DIV2 C問題/Round1 C問題 - Perform Easily

Source

Codeforces Round #679 (based on Technocup 2021 Elimination Round 1) DIV1 A問題 (500pt)
Codeforces Round #679 (based on Technocup 2021 Elimination Round 1) DIV2 C問題 (1500pt)
Technocup 2021 - Elimination Round 1 C問題 (1500pt)
Problem description

問題概要

省略

解法

省略

cLayversion 20201115-1)のコード

C++に変換後のコードはこちら

//no-unlocked
int A[6], N, B[1d5];
int arr[1d5];
{
  ll res, mx, mn;
  LHeap<int> hp;
  rd(A(6), N, B(N));
  sortA(6, A);
  sortA(N, B);
  rep(i,N) arr[i] = 5;

  hp.walloc(N, 1);
  rep(i,N) hp.change(i, B[i] - A[arr[i]]);
  mx = B[N-1] - A[5];
  mn = B[0] - A[5];
  res = mx - mn;

  for(;;){
    i = hp.pop();
    if(arr[i]==0) break;
    arr[i]--;
    hp.change(i, B[i] - A[arr[i]]);
    mx >?= B[i] - A[arr[i]];
    mn = hp.val[hp.hp[0]];
    res <?= mx - mn;
  }
  wt(res);
}

Current time: 2024年04月20日03時30分57秒
Last modified: 2020年11月15日09時37分31秒 (by laycrs)
Tags: Competitive_Programming_Incomplete Codeforces CF679 CF_DIV1_A CF_DIV2_C
トップページに戻る

Logged in as: unknown user (not login)

ログイン: