結果

問題 No.942 プレゼント配り
ユーザー suj2tosuj2to
提出日時 2023-07-17 14:24:54
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 534 bytes
コンパイル時間 1,493 ms
コンパイル使用メモリ 64,136 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-18 00:23:59
合計ジャッジ時間 3,055 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 22 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 23 ms
4,348 KB
testcase_05 AC 23 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 18 ms
4,348 KB
testcase_09 AC 20 ms
4,348 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 AC 2 ms
4,348 KB
testcase_12 AC 2 ms
4,348 KB
testcase_13 AC 2 ms
4,348 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 2 ms
4,348 KB
testcase_19 AC 2 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>

using namespace std;

int main()
{
  int nn,kk;
  
  cin >> nn >> kk;

  if (kk==1) {
    cout << "Yes" << "\n";
    for (auto i=0; i<nn; ++i) {
      cout << i+1 << " ";
    }
    cout << "\b" << "\n";
  } else if (nn/kk % 2 == 0) {
    cout << "Yes" << "\n";
    for (auto i=0; i<kk; ++i) {
      for (auto j=0; j<nn/kk/2; ++j) {
	cout << i+1+2*kk*j << " " << 2*kk*(j+1)-(i+1)+1;
	if (j+1<nn/kk/2) {
	  cout << " ";
	}
      }
      cout << "\n";
    }
  } else {
    cout << "No" << "\n";
  }
  
  return 0;
}
0