結果

問題 No.1169 Row and Column and Diagonal
ユーザー mmn15277198mmn15277198
提出日時 2020-11-03 22:46:34
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 796 bytes
コンパイル時間 781 ms
コンパイル使用メモリ 95,176 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-29 15:03:29
合計ジャッジ時間 3,973 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,376 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<stdio.h>
#include<stdlib.h>
#include<algorithm>
#include<vector>
#include<string.h>
#include<math.h>
#include<map>
#include<iomanip>
#include<queue>
#include<set>

#define rep(i,n) for(int (i) = 0; i < (n); i++)

using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;

//const ll mod = 1e9 + 7;
const ll mod = 998244353;
const int inf = 123456;

int main(){ 
	int n;
	cin >> n;
	vector<int> a;
	for(int i = 1; i <= n; i+=2){
		a.push_back(i);
	}
	for(int i = 2; i <= n; i+=2){
		a.push_back(i);
	}
	
	vector<int> b = a;
	for(int i = 0; i < a.size(); i++){
		int j = a[i] - 1;
		int cnt = 0;
		while(cnt < n){
			cout << b[j] << " ";
			cnt++;
			j++;
			if(j >= n){
				j = 0;
			}
		}
		cout << endl;
	}
	
	return 0;    
}
0