結果

問題 No.3744 XY Tiling
コンテスト
ユーザー ammonitenh3
提出日時 2026-09-19 17:54:54
言語 C++23(gcc16)
(gcc 16.1.0 + boost 1.92.0 + ACL)
コンパイル:
g++-16 -O2 -lm -std=c++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 1,956 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 6,411 ms
コンパイル使用メモリ 395,160 KB
実行使用メモリ 10,048 KB
最終ジャッジ日時 2026-09-19 17:55:16
合計ジャッジ時間 8,412 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge4_0
このコードへのチャレンジ
(要ログイン)
サブタスク 配点 結果
部分点 60 % AC * 9 WA * 10
満点 40 % AC * 18 WA * 42
合計 5 * 0% = 0 点
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
using mint = modint998244353;
#define all(a)  (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
template<typename T> bool chmin(T& a, T b){if(a > b){a = b; return true;} return false;}
template<typename T> bool chmax(T& a, T b){if(a < b){a = b; return true;} return false;}

const ll inf=1000000000000000000;
const ll mod=998244353;
const double pi=acos(-1);

ll root(ll x){
    ll k=(ll)sqrt(x);
    while(k*k>x) k--;
    while((k+1)*(k+1)<=x) k++;
    return k;
}

//logN
void press(vector<ll> &a){
    map<ll,ll> ord;
    for(auto x:a) ord[x]=1;
    ll j=0;
    for(auto &p:ord){
        p.second=j;
        j++;
    }
    for(auto &x:a) x=ord[x];
    return;
}

mint kaijou(ll n){
    mint a=1;
    rep(i,n){
        a*=(i+1);
    }
    return a;
}

vector<vector<mint>> matmul(vector<vector<mint>> &a,vector<vector<mint>> &b){
    vector<vector<mint>> ret(a.size(),vector<mint>(b[0].size()));
    rep(i,a.size()) rep(j,b[0].size()) rep(k,b.size()) ret[i][j]+=a[i][k]*b[k][j];
    return ret;
}

vector<vector<mint>> matpow(vector<vector<mint>> a,ll n){
    ll siz=a.size();
    vector<vector<mint>> ret(siz,vector<mint>(siz));
    while(n>0){
        if(n&1) ret=matmul(a,ret);
        rep(i,siz) ret[i][i]=1;
        a=matmul(a,a);
        n=n/2;
    }
    return ret;
}

int main () {
    ll h,w;
    cin>>h>>w;
    cout<<min(h,w)/2+1<<endl;
    if(h<=w){
        rep(i,h*w/2){
            cout<<2*(i/w)+1<<" "<<i%w+1<<" "<<(i/w)+1<<" ";
            cout<<2*(i/w)+2<<" "<<i%w+1<<" "<<(i/w)+2<<" ";
            cout<<endl;
        }
        return 0;
    }
    else {
        rep(i,h*w/2){
            cout<<i%h+1<<" "<<2*(i/h)+1<<" "<<(i/h)+1<<" ";
            cout<<i%h+1<<" "<<2*(i/h)+2<<" "<<(i/h)+2<<" ";
            cout<<endl;
        }
        return 0;
    }
}

0