結果

問題 No.942 プレゼント配り
ユーザー Iván Soto
提出日時 2021-05-10 14:42:38
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 483 bytes
コンパイル時間 1,957 ms
コンパイル使用メモリ 192,324 KB
最終ジャッジ日時 2025-01-21 09:51:11
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 8 WA * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

/**
 *  author: ivanzuki   
 *  created: Sun May 09 2021
**/
#include <bits/stdc++.h>

using namespace std;

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  if (n % (2 * k) == 0) {
    cout << "Yes" << '\n';
    for (int i = 0; i < k; i++) {
      for (int j = 0; j < n / 2 / k; j++) {
        cout << j + i * k + 1 << ' ' << n - j - i * k << ' ';
      }
      cout << '\n';
    }
  } else {
    cout << "No" << '\n';
  }
  return 0;
}
0