結果

問題 No.1398 調和の魔法陣 (構築)
ユーザー Haa
提出日時 2021-02-21 16:40:21
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 654 bytes
コンパイル時間 1,805 ms
コンパイル使用メモリ 166,224 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-19 14:42:21
合計ジャッジ時間 29,135 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 13 WA * 15
権限があれば一括ダウンロードができます

ソースコード

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