From 3b702d5e933243ff2bc93b4d98a8789028b46130 Mon Sep 17 00:00:00 2001 From: Zengtudor Date: Mon, 7 Oct 2024 11:07:43 +0800 Subject: [PATCH] update --- src/20241007/matrix/matrix_1007.cpp | 70 +++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/src/20241007/matrix/matrix_1007.cpp b/src/20241007/matrix/matrix_1007.cpp index e69de29..ddac887 100644 --- a/src/20241007/matrix/matrix_1007.cpp +++ b/src/20241007/matrix/matrix_1007.cpp @@ -0,0 +1,70 @@ +/* + n行m列,Ai取第i行最小值,Bj取第j列最大值 + 想不出来递推和数学,打暴力了。。。。 +*/ + +#include +#include +#include +#include +#include + +using std::cin, std::cout; +using ull = unsigned long long; +using ui = unsigned int; + +static constexpr size_t MAX_N {(size_t)1e3+5}; +static constexpr ull MOD {998244353}; +static size_t n,m,k; +ull mtx[MAX_N][MAX_N]; +std::set> s; + +template +std::ostream&operator<<(std::ostream &os,const std::vector &v)noexcept{ + os<<"["; + for(size_t i{0};in){ + // cout<<"x:"< v; + for(size_t i=1;i<=n;i++){ + ull ai {std::numeric_limits::max()}; + for(size_t j=1;j<=m;j++){ + ai = std::min(ai,mtx[i][j]); + } + v.push_back(ai); + } + for(size_t j {1};j<=m;j++){ + ull bj {std::numeric_limits::min()}; + for(size_t i{1};i<=n;i++){ + bj = std::max(bj,mtx[i][j]); + } + v.push_back(bj); + } + // cout<m){ + dfs(x+1,1); + }else{ + dfs(x,y+1); + } + } +} + +int main(){ + cin>>n>>m>>k; + dfs(1,1); + cout<