結果

問題 No.3721 Absurd Basic Constructive
コンテスト
ユーザー よには
提出日時 2026-09-19 17:36:40
言語 C++23
(gcc 15.3.0 + boost 1.92.0 + ACL)
コンパイル:
g++-15 -O2 -lm -std=c++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 804 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 6,392 ms
コンパイル使用メモリ 410,064 KB
実行使用メモリ 6,528 KB
最終ジャッジ日時 2026-09-19 17:36:51
合計ジャッジ時間 10,681 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 5 WA * 42
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#if __has_include(<yoniha/all.h>)
#include <yoniha/all.h>
using namespace atcoder;
#else
#include <bits/stdc++.h>
#if __has_include(<atcoder/all>)
#include <atcoder/all>
using namespace atcoder;
#endif
#endif
using namespace std;

#define int long long
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rrep(i, n) for(int i = (int)((n) - 1); i >= 0; i--)
template <typename T> bool chmax(T &a,const T &b){if(a<b){a=b;return true;}return false;}
template <typename T> bool chmin(T &a,const T &b){if(a>b){a=b;return true;}return false;}

// using mint = modint;

signed main(){
  int n, k; cin >> n >> k;
  if(k == 0){
    println("-1");
    return 0;
  }
  rep(i, n * n){
    print("{}{}", i + (i < k ? k - 1 : -k) + 1, i % n == n - 1 ? '\n' : ' ');
  }
}
0