結果

問題 No.1169 Row and Column and Diagonal
ユーザー kyo1
提出日時 2020-10-29 09:29:56
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 520 bytes
コンパイル時間 2,835 ms
コンパイル使用メモリ 196,692 KB
最終ジャッジ日時 2025-01-15 16:19:30
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 1
other WA * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int N;
  cin >> N;
  vector<vector<int>> X(N, vector<int>(N, 0));
  for (int i = 0; i < N; i++) {
    X[i][i] = i;
    int cur = 0;
    for (int j = 0; j < N; j++) {
      if (j == i) {
        X[i][j] = i;
      } else {
        X[i][j] = cur;
      }
      cur++;
    }
  }
  for (auto x : X) {
    for (const auto& e : x) {
      cout << e + 1 << (&e == &x.back() ? '\n' : ' ');
    }
  }
  return 0;
}
0