結果

問題 No.1399 すごろくで世界旅行 (構築)
ユーザー seiyu_kyoproseiyu_kyopro
提出日時 2021-02-20 00:05:32
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 2,015 bytes
コンパイル時間 1,653 ms
コンパイル使用メモリ 172,004 KB
実行使用メモリ 7,260 KB
最終ジャッジ日時 2023-10-17 01:58:19
合計ジャッジ時間 21,484 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 2 ms
4,348 KB
testcase_02 WA -
testcase_03 AC 2 ms
4,348 KB
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 -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#define rep(i,N) for(int i=0;i<(N);i++)
#define rrep(i, n) for (int i = (int)n-1; i >= 0; --i)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
using namespace std;
const long long MOD = 1e9 + 7;
const long long INF = 1e12;
const int inf = 1e9;
const int mod = 1e9+7;
typedef long long ll;
typedef pair<ll,int> P;
typedef set<int> S;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

__attribute__ ((constructor))
void fastio() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(10);
}

int main(){
    int v, d;
    cin >> v >> d;

    vector<vector<int>> ans(v, vector<int>(v, 0));

    if(d == 1){
        rep(i, v) rep(j, v) ans[i][j] = 1;
    }else if(d% 2 != 0){
        ans[0][0] = 1;
        rep(i,v){
            rep(j,v){
                if (i == 0 || j == 0) ans[i][j] = 1;
            }
        }
    }else{
        rep(i,v){
            rep(j,v){
                if ((i == 0 || j == 0) && !(i == 0 && j == 0)) ans[i][j] = 1;
            }
        }
    }

    // if(d >= 3 && d%2 != 0){
    //     rep(i,v){
    //         rep(j,v){
    //             if (i == 0 || j == 0) ans[i][j] = 1;
    //         }
    //     }
    // }

    // if(d%2 == 0){
    //     ans[0][0] = 1;
    //     rep(i,v){
    //         rep(j,v){
    //             if ((i == 0 || j == 0) && !(i == 0 && j == 0)) ans[i][j] = 1;
    //         }
    //     }
    //     // FOR(i,1,v){
    //     //     if(i%2 != 1){
    //     //         if(i + 1 < v){
    //     //             ans[i][i + 1] = 1;
    //     //             ans[i + 1][i] = 1;
    //     //         }else if(v >= 2){
    //     //             ans[i][1] = 1;
    //     //             ans[1][i] = 1;
    //     //         }
    //     //     }
    //     // }
    // }
    rep(i, v) { rep(j, v) cout << ans[i][j] << (j == v - 1 ? "\n" : " "); }
    return 0;
}
0