結果
| 問題 | No.3724 Domination |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-09-19 17:10:10 |
| 言語 | C++23(gcc16) (gcc 16.1.0 + boost 1.92.0 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 1,185 bytes |
| 記録 | |
| コンパイル時間 | 5,031 ms |
| コンパイル使用メモリ | 389,444 KB |
| 実行使用メモリ | 10,068 KB |
| 最終ジャッジ日時 | 2026-09-19 17:10:30 |
| 合計ジャッジ時間 | 12,502 ms |
|
ジャッジサーバーID (参考情報) |
judge5_1 / judge3_0 |
(要ログイン)
| サブタスク | 配点 | 結果 |
|---|---|---|
| 部分点 | 20 % | AC * 7 WA * 1 |
| 満点 | 80 % | AC * 7 WA * 45 |
| 合計 | 2.5 * 0% = 0 点 |
ソースコード
#include<bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
#define all(x) x.begin(), x.end()
#define rep(i, limit) for (int i = 0; i < (int)limit; i++)
constexpr char nl = '\n';
constexpr int INF = 1'000'000'000;
constexpr ll LINF = 2'000'000'000'000'000'000LL;
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;}
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
int Q;cin >> Q;
for(;Q--;){
int N;cin >> N;
if(N == 2){
cout << -1 << nl;
continue;
}
vector<int>C(N),R(N);
rep(i,N)cin >> R[i];
rep(i,N)cin >> C[i];
vector<vector<int>>ans(N+1,vector<int>(N+1));
for(int i = 0; i < N; i++)for(int j = 0; j < N; j++){
if(min(C[j],R[i]) == 1 && max(C[j],R[i]) == N)ans[i][j] = N;
else ans[i][j] = min(C[j],R[i]);
}
rep(i,N){
rep(j,N){
cout << ans[i][j] << " ";
}
cout << nl;
}
}
}