結果

問題 No.3334 I hate Image Convolution
コンテスト
ユーザー iris2617
提出日時 2025-11-18 20:45:12
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 744 bytes
コンパイル時間 1,964 ms
コンパイル使用メモリ 204,820 KB
実行使用メモリ 11,076 KB
最終ジャッジ日時 2025-11-18 20:45:35
合計ジャッジ時間 22,668 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 11 WA * 45
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include<bits/stdc++.h>
#define int long long
#define matsuri pair<int,int>
//const int iris = 1e9+7;
const int iris = 998244353;
using namespace std;

void solve()
{
	int n;
	cin>>n;
	vector<vector<int> > arr(n+1, vector<int>(n+1, 1e9));
	vector<int> owo((n-1)*(n-1));
	for(int &x:owo)
		cin>>x;
	sort(owo.begin(), owo.end());
	for(int i=1;i<n;i++)
		for(int j=1;j<n;j++)
			arr[i][j]=owo[(i-1)*(n-1)+j-1];
	for(int i=0;i<n;i++)
		for(int j=0;j<n;j++)
		{
			int a=1e9;
			for(int x:{0,1})for(int y:{0,1})
				a=min(a, arr[i+x][j+y]);
			for(int x:{0,1})for(int y:{0,1})
				arr[i+x][j+y]-=a;
			
			cout<<a<<" \n"[j==n-1];
		}
}

signed main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);

	int T=1;
	cin>>T;
	while(T--)
		solve();

	return 0;
}
0