結果

問題 No.1398 調和の魔法陣 (構築)
ユーザー HaaHaa
提出日時 2021-02-21 16:40:21
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 654 bytes
コンパイル時間 6,151 ms
コンパイル使用メモリ 165,668 KB
実行使用メモリ 5,092 KB
最終ジャッジ日時 2023-10-19 18:22:19
合計ジャッジ時間 32,107 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,368 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 2 ms
4,368 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 2 ms
4,368 KB
testcase_11 WA -
testcase_12 AC 2 ms
4,368 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 2 ms
4,368 KB
testcase_16 AC 22 ms
4,368 KB
testcase_17 AC 22 ms
4,368 KB
testcase_18 AC 22 ms
4,368 KB
testcase_19 AC 23 ms
4,368 KB
testcase_20 AC 2 ms
4,368 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 2 ms
4,348 KB
testcase_24 WA -
testcase_25 AC 2 ms
4,348 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 2 ms
4,348 KB
testcase_29 WA -
testcase_30 AC 2 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll,ll> P;
typedef vector<ll> VI;
typedef vector<VI> VVI;
#define REP(i,n) for(ll i=0;i<(n);i++)
#define ALL(v) v.begin(),v.end()
constexpr ll MOD=1000000007;
constexpr ll INF=1e18;

int main(){
    int w, h, x; cin >> w >> h >> x;
    if(x>36||w%3!=2||h%3!=2){
        cout << -1 << endl;
    }
    else{
        int a[3][3]={0};
        REP(i,2)REP(j,2){
            a[i][j]=min(9,x);
            x-=min(9,x);
        }
        REP(i,h){
            REP(j,w){
                cout << a[i%3][j%3];
            }
            cout << endl;
        }
    }
    return 0;
}
0