結果
| 問題 |
No.839 Keep Distance and Nobody Explodes
|
| コンテスト | |
| ユーザー |
KawattaTaido
|
| 提出日時 | 2020-05-20 23:01:38 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 622 bytes |
| コンパイル時間 | 1,861 ms |
| コンパイル使用メモリ | 197,712 KB |
| 最終ジャッジ日時 | 2025-01-10 13:27:02 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 1 WA * 29 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
int offset = (n/2 + 1)/2 - 1;
int sh = n/2;
vector<vector<int>> ans(n,vector<int>(n));
rep(i,n*n/4){
int h = i%sh;
int w = i/sh;
ans[h][w] = 4*i + 1;
ans[(h+offset)%sh][w+sh] = 4*i+2;
ans[sh+h][w] = 4*i+3;
ans[sh+(h+offset)%sh][sh+w] = 4*i+4;
}
rep(i,n){
rep(j,n){
cout << ans[i][j] << " \n"[j==n-1];
}
}
return 0;
}
KawattaTaido