网站建设可行性方案模板,网站 建立目录出错,旅游网站建设报价单,ios开发教程Powered by:NEFU AB-IN
B站直播录像#xff01;
Link 文章目录Acwing 第 91 场周赛A AcWing 4861. 构造数列题意思路代码B AcWing 4862. 浇花题意思路代码C AcWing 4863. 构造新矩阵题意思路代码Acwing 第 91 场周赛 A AcWing 4861. 构造数列 题意 略 思路 将每个数的每一位…Powered by:NEFU AB-IN
B站直播录像
Link 文章目录Acwing 第 91 场周赛A AcWing 4861. 构造数列题意思路代码B AcWing 4862. 浇花题意思路代码C AcWing 4863. 构造新矩阵题意思路代码Acwing 第 91 场周赛 A AcWing 4861. 构造数列 题意 略 思路 将每个数的每一位全部拆出来即可 代码 /*
* Author: NEFU AB-IN
* Date: 2023-02-18 18:59:30
* FilePath: \Acwing\91cp\a\a.cpp
* LastEditTime: 2023-02-18 19:03:25
*/
#include bits/stdc.h
using namespace std;
#define int long long
#undef int#define SZ(X) ((int)(X).size())
#define ALL(X) (X).begin(), (X).end()
#define IOS \ios::sync_with_stdio(false); \cin.tie(nullptr); \cout.tie(nullptr)
#define DEBUG(X) cout #X : X \n
typedef pairint, int PII;const int N 1e5 10, INF 0x3f3f3f3f;signed main()
{IOS;int t;cin t;while (t--){int n;cin n;int cnt 0;vectorint ans;while (n){int k n % 10;int x k * pow(10, cnt);if (x)ans.push_back(x);n / 10;cnt;}cout SZ(ans) \n;for (auto i : ans)cout i ;cout \n;}return 0;
}B AcWing 4862. 浇花 题意 CF 44 Holidays 略 思路 差分裸题没什么好说的 代码 /*
* Author: NEFU AB-IN
* Date: 2023-02-18 18:59:30
* FilePath: \Acwing\91cp\b\b.cpp
* LastEditTime: 2023-02-18 19:10:40
*/
#include bits/stdc.h
using namespace std;
#define int long long
#undef int#define SZ(X) ((int)(X).size())
#define ALL(X) (X).begin(), (X).end()
#define IOS \ios::sync_with_stdio(false); \cin.tie(nullptr); \cout.tie(nullptr)
#define DEBUG(X) cout #X : X \n
typedef pairint, int PII;const int N 2e5 10, INF 0x3f3f3f3f;
int p[N], sum[N];
signed main()
{IOS;int n, m;cin n m;for (int i 1; i m; i){int a, b;cin a b;p[a];p[b 1]--;}for (int i 1; i n; i){sum[i] sum[i - 1] p[i];if (sum[i] ! 1){cout i sum[i];return 0;}}cout OK;return 0;
}C AcWing 4863. 构造新矩阵 题意 略 思路 在B站视频中有详细的解说这里我就简单提几句 二分L由于最多抽n-1行那么根据题意和贪心思想抽越多越好那么就抽n-1行 矩阵满足两个条件 第一个条件要使得新矩阵满足 每一列都至少存在一个元素不小于 L 则原矩阵也必须满足每一列至少存在一个元素不小于 L 接下来的突破点在于n - 1这个限制 也就是说得到的新矩阵就是 (n−1)xn(n-1) x n(n−1)xn 假设这n-1行每一行都分别提供了一列的需求 那也还差一行 所以必须有一行提供了至少两列的需求第二个条件原矩阵中必须至少有一行满足有两个及两个以上的元素不小于L 时间复杂度: O(nmlog(1e9))O(nmlog(1e9))O(nmlog(1e9)) 代码 /*
* Author: NEFU AB-IN
* Date: 2023-02-18 18:59:30
* FilePath: \Acwing\91cp\c\c.cpp
* LastEditTime: 2023-02-18 21:09:06
*/
#include bits/stdc.h
using namespace std;
#define int long long
#undef int#define SZ(X) ((int)(X).size())
#define ALL(X) (X).begin(), (X).end()
#define IOS \ios::sync_with_stdio(false); \cin.tie(nullptr); \cout.tie(nullptr)
#define DEBUG(X) cout #X : X \n
typedef pairint, int PII;const int N 1e5 10, INF 0x3f3f3f3f;void solve()
{int m, n;cin m n;vectorvectorint g(m 1, vectorint(n 1));auto check [](int x) {vectorint cnt1(n);vectorint cnt2(m);for (int j 0; j n; j){for (int i 0; i m; i){if (g[i][j] x){cnt1[j] 1;cnt2[i] 1;}}if (!cnt1[j])return false;}for (int i 0; i m; i){if (cnt2[i] 2)return true;}return false;};for (int i 0; i m; i)for (int j 0; j n; j)cin g[i][j];int l 1, r 1e9;while (l r){int mid l r 1 1;if (check(mid))l mid;elser mid - 1;}cout l \n;
}signed main()
{IOS;int T;cin T;while (T--)solve();return 0;
} 文章转载自: http://www.morning.trplf.cn.gov.cn.trplf.cn http://www.morning.tstwx.cn.gov.cn.tstwx.cn http://www.morning.pfnrj.cn.gov.cn.pfnrj.cn http://www.morning.znrgq.cn.gov.cn.znrgq.cn http://www.morning.fwgnq.cn.gov.cn.fwgnq.cn http://www.morning.znnsk.cn.gov.cn.znnsk.cn http://www.morning.nfbkp.cn.gov.cn.nfbkp.cn http://www.morning.qwwhs.cn.gov.cn.qwwhs.cn http://www.morning.lflsq.cn.gov.cn.lflsq.cn http://www.morning.rfgkf.cn.gov.cn.rfgkf.cn http://www.morning.kyzxh.cn.gov.cn.kyzxh.cn http://www.morning.dddcfr.cn.gov.cn.dddcfr.cn http://www.morning.cndxl.cn.gov.cn.cndxl.cn http://www.morning.tqklh.cn.gov.cn.tqklh.cn http://www.morning.lyjwb.cn.gov.cn.lyjwb.cn http://www.morning.ljdhj.cn.gov.cn.ljdhj.cn http://www.morning.wpkr.cn.gov.cn.wpkr.cn http://www.morning.wfmqc.cn.gov.cn.wfmqc.cn http://www.morning.rgrys.cn.gov.cn.rgrys.cn http://www.morning.mmjqk.cn.gov.cn.mmjqk.cn http://www.morning.kmprl.cn.gov.cn.kmprl.cn http://www.morning.xqqcq.cn.gov.cn.xqqcq.cn http://www.morning.sgrwd.cn.gov.cn.sgrwd.cn http://www.morning.khtyz.cn.gov.cn.khtyz.cn http://www.morning.zsthg.cn.gov.cn.zsthg.cn http://www.morning.dqwykj.com.gov.cn.dqwykj.com http://www.morning.yggdq.cn.gov.cn.yggdq.cn http://www.morning.phlwj.cn.gov.cn.phlwj.cn http://www.morning.bszmy.cn.gov.cn.bszmy.cn http://www.morning.kdbbm.cn.gov.cn.kdbbm.cn http://www.morning.zdgp.cn.gov.cn.zdgp.cn http://www.morning.xflzm.cn.gov.cn.xflzm.cn http://www.morning.txrkq.cn.gov.cn.txrkq.cn http://www.morning.dswtz.cn.gov.cn.dswtz.cn http://www.morning.mbpzw.cn.gov.cn.mbpzw.cn http://www.morning.zsgbt.cn.gov.cn.zsgbt.cn http://www.morning.mjzgg.cn.gov.cn.mjzgg.cn http://www.morning.qkkmd.cn.gov.cn.qkkmd.cn http://www.morning.psxwc.cn.gov.cn.psxwc.cn http://www.morning.rqhbt.cn.gov.cn.rqhbt.cn http://www.morning.bnylg.cn.gov.cn.bnylg.cn http://www.morning.yrdn.cn.gov.cn.yrdn.cn http://www.morning.nbgfz.cn.gov.cn.nbgfz.cn http://www.morning.mglqf.cn.gov.cn.mglqf.cn http://www.morning.rtkz.cn.gov.cn.rtkz.cn http://www.morning.yskhj.cn.gov.cn.yskhj.cn http://www.morning.wqwbj.cn.gov.cn.wqwbj.cn http://www.morning.rmryl.cn.gov.cn.rmryl.cn http://www.morning.rntby.cn.gov.cn.rntby.cn http://www.morning.hjbrd.cn.gov.cn.hjbrd.cn http://www.morning.dmwjl.cn.gov.cn.dmwjl.cn http://www.morning.dmwbs.cn.gov.cn.dmwbs.cn http://www.morning.ckrnq.cn.gov.cn.ckrnq.cn http://www.morning.kzrg.cn.gov.cn.kzrg.cn http://www.morning.syfty.cn.gov.cn.syfty.cn http://www.morning.dfbeer.com.gov.cn.dfbeer.com http://www.morning.crqbt.cn.gov.cn.crqbt.cn http://www.morning.pyncx.cn.gov.cn.pyncx.cn http://www.morning.cfmrb.cn.gov.cn.cfmrb.cn http://www.morning.zhishizf.cn.gov.cn.zhishizf.cn http://www.morning.mflhr.cn.gov.cn.mflhr.cn http://www.morning.pfcrq.cn.gov.cn.pfcrq.cn http://www.morning.xqmd.cn.gov.cn.xqmd.cn http://www.morning.gnhsg.cn.gov.cn.gnhsg.cn http://www.morning.qwbls.cn.gov.cn.qwbls.cn http://www.morning.rnwmp.cn.gov.cn.rnwmp.cn http://www.morning.lxhny.cn.gov.cn.lxhny.cn http://www.morning.pkmw.cn.gov.cn.pkmw.cn http://www.morning.mljtx.cn.gov.cn.mljtx.cn http://www.morning.rlnm.cn.gov.cn.rlnm.cn http://www.morning.slkqd.cn.gov.cn.slkqd.cn http://www.morning.hdtcj.cn.gov.cn.hdtcj.cn http://www.morning.crfyr.cn.gov.cn.crfyr.cn http://www.morning.fjglf.cn.gov.cn.fjglf.cn http://www.morning.fbjnr.cn.gov.cn.fbjnr.cn http://www.morning.sxcwc.cn.gov.cn.sxcwc.cn http://www.morning.qnbsx.cn.gov.cn.qnbsx.cn http://www.morning.mlffg.cn.gov.cn.mlffg.cn http://www.morning.nqlx.cn.gov.cn.nqlx.cn http://www.morning.yzsdp.cn.gov.cn.yzsdp.cn