結果

問題 No.1169 Row and Column and Diagonal
ユーザー WarToksWarToks
提出日時 2020-08-14 21:28:22
言語 C++17(clang)
(17.0.6 + boost 1.83.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 748 bytes
コンパイル時間 1,089 ms
コンパイル使用メモリ 128,148 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-23 14:29:00
合計ジャッジ時間 3,586 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <iomanip>
#include <algorithm>
#include <array>
#include <cassert>
#include <utility>
#include <vector>


int main(void){
    std::cin.tie(nullptr); std::ios_base::sync_with_stdio(false); 
    std::cout << std::fixed << std::setprecision(16);
    
    constexpr int N = 500;
    std::array<std::array<int, N>, N> Arr;
    int n; std::cin >> n;
    for(int i = 1; i <= n; ++i){
        for(int x = 0, y = i - 1; x < n; ++x, ++y){
            if(y >= n) y -= n;
            Arr[x][y] = i;
        }
    }
    for(int i = 0; i < n; ++i){
        for(int j = 0; j < n; ++j){
            std::cout << Arr[i][j];
            if(j + 1 == n) std::cout << '\n';
            else std::cout << ' ';
        }
    }
    return 0;
}
0