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

2021年05月08日09時56分09秒

Codeforces Round #720 DIV2 E問題 - Nastia and a Beautiful Matrix

Source

Codeforces Round #720 DIV2 E問題 (2750pt)
Problem description

問題概要

省略

解法

省略

cLayversion 20210405-1)のコード

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

//no-unlocked
int M, K, A[2d5];
int sz, arr[], ind[];
int n, res[1000][1000];
{
  REP(rd_int()){
    rd(M,K,A(K));

    rep(i,K) ind[i] = i+1;
    sortA(K, A, ind);

    sz = n = 0;
    rep(i,K) rep(A[i]) arr[sz++] = ind[i];

    while( (n/+2) * n + (n/2) * (n/+2) < M ) n++;
    while( (n/+2) * n < A[K-1] ) n++;

    rep(i,n) rep(j,n) res[i][j] = 0;
    rep(i,0,n,2) rep(j,1,n,2) if(sz > 0) res[i][j] = arr[--sz];
    rep(i,0,n,2) rep(j,0,n,2) if(sz > 0) res[i][j] = arr[--sz];
    rep(i,1,n,2) rep(j,0,n,2) if(sz > 0) res[i][j] = arr[--sz];

    wt(n);
    wt(res(n,n));
  }
}

Current time: 2024年03月29日03時11分13秒
Last modified: 2021年05月08日09時56分09秒 (by laycrs)
Tags: Competitive_Programming_Incomplete Codeforces CF720 CF_DIV2_E
トップページに戻る

Logged in as: unknown user (not login)

ログイン: