Educational Codeforces Round 72 B問題 - Zmei Gorynich

Source

Educational Codeforces Round 72 B問題
Problem description

問題概要

省略

解法

省略

cLayversion 20190914-1)のコード

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

//no-unlocked
int T, N, X, D[100], H[100];
{
  int res;
  rd(T);
  rep(T){
    rd(N,X,(D,H)(N));
    rep(i,N) if(D[i] >= X) break;
    if(i<N) wt(1), continue;

    res = int_inf;
    rep(i,N) if(D[i] > H[i]) rep(j,N){
      res <?= (X - D[j]) /+ (D[i] - H[i]) + 1;
    }
    if(res==int_inf) res = -1;
    wt(res);
  }
}

Current time: 2024年04月25日19時24分49秒
Last modified: 2019年09月15日13時18分36秒 (by laycrs)
Tags: Competitive_Programming_Incomplete Codeforces
トップページに戻る

Logged in as: unknown user (not login)

ログイン: