Codeforces Round #640 DIV4 B問題 - Same Parity Summands

Source

Codeforces Round #640 DIV4 B問題
Problem description

問題概要

省略

解法

省略

cLayversion 20200509-1)のコード

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

//no-unlocked
int N, K;
int res[100];
{
  REP(rd_int()){
    rd(N,K);
    if(N%2 == K%2){
      if(N < K) wt("NO"), continue;
      rep(i,K) res[i] = 1;
      res[K-1] = N - (K - 1);
    } else {
      if(N%2) wt("NO"), continue;
      if(N < 2*K) wt("NO"), continue;
      rep(i,K) res[i] = 2;
      res[K-1] = N - 2 * (K - 1);
    }
    wt("YES");
    wt(res(K));
  }
}

Current time: 2024年04月18日15時15分24秒
Last modified: 2020年05月11日06時18分01秒 (by laycrs)
Tags: Competitive_Programming_Incomplete Codeforces CF640 CF_Div4_B
トップページに戻る

Logged in as: unknown user (not login)

ログイン: