結果

問題 No.1169 Row and Column and Diagonal
ユーザー yakkiyakki
提出日時 2020-08-14 21:32:44
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 981 bytes
コンパイル時間 1,644 ms
コンパイル使用メモリ 122,644 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-18 20:55:53
合計ジャッジ時間 4,374 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 2 ms
6,820 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<string>
#include<vector>
#include<algorithm>
#include<bitset>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<deque>
#include<list>
#include<iomanip>
#include<cmath>
#include<cstring>
#include<functional>
#include<cstdio>
#include<cstdlib>
using namespace std;

#define repr(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) repr(i, 0, n)
#define INF 2e9
#define MOD 1000000007
//#define MOD 998244353
#define LINF (long long)4e18
#define jck 3.141592

const double EPS = 1e-10;

using ll = long long;
using Pi = pair<int,int>;
using Pl = pair<ll,ll>;


int main(){
    int n; cin >> n;
    vector<vector<int>> ans(n,vector<int>(n));
    vector<int> v(2*n);
    rep(i,n){
        v[i] = i+1;
        v[i+n] = v[i];
    }
    rep(i,n){
        rep(j,n){
            ans[i][j] = v[i+j];
        }
    }
    rep(i,n){
        rep(j,n){
            cout << ans[i][j] << " ";
        }
        cout << endl;
    }

}

0