結果
| 問題 |
No.1851 Regular Tiling
|
| コンテスト | |
| ユーザー |
srjywrdnprkt
|
| 提出日時 | 2023-05-21 22:16:40 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 90 ms / 2,000 ms |
| コード長 | 1,038 bytes |
| コンパイル時間 | 925 ms |
| コンパイル使用メモリ | 105,656 KB |
| 最終ジャッジ日時 | 2025-02-13 04:04:33 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 14 |
ソースコード
#include <iostream>
#include <vector>
#include <cmath>
#include <map>
#include <set>
#include <iomanip>
#include <queue>
#include <algorithm>
#include <numeric>
#include <deque>
#include <complex>
#include <cassert>
using namespace std;
using ll = long long;
int G[102][102];
void solve(){
int H, W;
cin >> H >> W;
int a=0, b=H/3*3, c=0, d=W/3*3;
if (H % 3 == 1) b++;
if (H % 3 == 2){
a+=1;
b+=3;
}
if (W % 3 == 1) d++;
if (W % 3 == 2){
c+=1;
d+=3;
}
for (int i=a; i<b; i++){
for (int j=c; j<d; j++) cout << G[i][j] << " ";
cout << endl;
}
}
int main(){
for (int i=0; i<34; i++){
for (int j=0; j<34; j++){
G[i*3][j*3] = 0; G[i*3][j*3+1] = 1; G[i*3][j*3+2] = 1;
G[i*3+1][j*3] = 1; G[i*3+1][j*3+1] = 2; G[i*3+1][j*3+2] = 2;
G[i*3+2][j*3] = 1; G[i*3+2][j*3+1] = 2; G[i*3+2][j*3+2] = 2;
}
}
int T;
cin >> T;
while(T){
T--;
solve();
}
return 0;
}
srjywrdnprkt