Codeforces Global Round 4 A問題 - Prime Minister

Source

Codeforces Global Round 4 A問題 (500pt)
Problem description

問題概要

省略

解法

省略

cLayversion 20190721-1)のコード

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

//no-unlocked
int N, A[100];

int K, C[100];
{
  int i, sum, cur;

  rd(N,A(N));
  
  C[K++] = 0;
  rep(i,1,N) if(A[0] >= 2A[i]) C[K++] = i;

  sum = sum(A(N));
  cur = 0;
  rep(i,K) cur += A[C[i]];

  if(2cur > sum){
    wt(K);
    wt(C(K)+1);
  } else {
    wt(0);
  }
}

Current time: 2024年04月19日13時26分06秒
Last modified: 2019年07月21日15時37分30秒 (by laycrs)
Tags: Competitive_Programming_Incomplete Codeforces Codeforces_Global_Round_4
トップページに戻る

Logged in as: unknown user (not login)

ログイン: