結果

問題 No.1399 すごろくで世界旅行 (構築)
ユーザー leaf_1415leaf_1415
提出日時 2021-02-19 22:43:45
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,115 bytes
コンパイル時間 3,595 ms
コンパイル使用メモリ 80,976 KB
実行使用メモリ 9,948 KB
最終ジャッジ日時 2023-10-15 03:40:38
合計ジャッジ時間 22,670 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 1 ms
4,352 KB
testcase_02 AC 1 ms
4,352 KB
testcase_03 AC 1 ms
4,352 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 WA -
testcase_06 AC 2 ms
4,352 KB
testcase_07 AC 1 ms
4,348 KB
testcase_08 AC 2 ms
4,480 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 2 ms
4,348 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 44 ms
9,424 KB
testcase_18 AC 42 ms
9,368 KB
testcase_19 AC 44 ms
9,632 KB
testcase_20 AC 41 ms
9,496 KB
testcase_21 AC 44 ms
9,440 KB
testcase_22 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstdlib>
#include <cassert>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <string>
#include <algorithm>
#include <utility>
#include <complex>
#define rep(x, s, t) for(llint (x) = (s); (x) <= (t); (x)++)
#define reps(x, s) for(llint (x) = 0; (x) < (llint)(s).size(); (x)++)
#define chmin(x, y) (x) = min((x), (y))
#define chmax(x, y) (x) = max((x), (y))
#define all(x) (x).begin(),(x).end()
#define outl(x) cout << x << endl
#define SP << " " << 
#define inf 1e18

using namespace std;

typedef long long llint;
typedef long long ll;
typedef pair<llint, llint> P;

ll n, d;
ll ans[1005][1005];

int main(void)
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	cin >> n >> d;
	
	ans[1][1] = 1;
	rep(i, 2, n) ans[i-1][i] = ans[i][i-1] = 1;
	
	rep(i, 1, n){
		ll p = n+1 - d*i;
		if(p <= 1) break;
		ans[p-1][p] = ans[p][p-1] = 0;
		ans[1][p] = ans[p][1] = 1;
	}
	
	rep(i, 1, n){
		rep(j, 1, n) cout << ans[i][j];
		cout << endl;
	}
	
	return 0;
}
0