結果
問題 | No.1399 すごろくで世界旅行 (構築) |
ユーザー |
![]() |
提出日時 | 2021-02-19 22:43:45 |
言語 | C++11 (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,115 bytes |
コンパイル時間 | 632 ms |
コンパイル使用メモリ | 81,316 KB |
実行使用メモリ | 10,384 KB |
最終ジャッジ日時 | 2024-09-16 21:12:21 |
合計ジャッジ時間 | 20,298 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 1 |
other | AC * 13 WA * 9 |
ソースコード
#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; }