文章分类 -  OI题目

上一页 1 ··· 6 7 8 9 10 11 12 下一页
摘要:只需要O(n)就可以完成 单点查询+区间修改 #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #include<bits/stdc++.h> #define ll long long #define 阅读全文
posted @ 2023-07-29 09:37 JMXZ
摘要:》》》结构 -》 tarjan 》》》度 ——》 max,min #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #include<bits/stdc++.h> #define ll long lon 阅读全文
posted @ 2023-07-29 09:21 JMXZ
摘要:树状数组 开的是相同大小的 空间 标号都是一样的 只是 存储的是 前缀和 query(i) 原数组 a[i] 及以前的前缀和 add(i,val) 单点 a[i] 修改 我们发现,如果数列的后缀是递增的,那么是可以不用处理的. 由此引申出一种思路:把整个序列分成两个部分,前一个部分是还未排好序的,后 阅读全文
posted @ 2023-07-28 15:11 JMXZ
摘要:>>>每次有连通块 就一次性删除 +下落+下落后再删除 #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #include<bits/stdc++.h> #define ll long long #de 阅读全文
posted @ 2023-07-28 14:23 JMXZ
摘要:想清楚过程 在coding if(a[i].r<=last) continue; -> a[i-1].r>a[i].r ->有反例 #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #include<b 阅读全文
posted @ 2023-07-28 13:33 JMXZ
摘要:#include<bits/stdc++.h> using namespace std; int c[4],m[4]; int main() { for(int x=1;x<=3;x++)cin>>c[x]>>m[x]; for(int x=1;x<=100;x++){ int f=(x-1)%3+ 阅读全文
posted @ 2023-07-28 10:18 JMXZ
摘要:1.卖牛奶先卖给出价高的商铺; 2.把奶牛租给出价高的邻居。 3.牛奶,租牛价格 等价-> 贪心 >>>若` cow的前缀和 ->重复的过程循环_->动态记录 ans >>>商铺只 购买 QI 加仑 /* 175 295 355 385 400 725 495 495 495 495 495 495 阅读全文
posted @ 2023-07-28 01:23 JMXZ
摘要:>>>find lian 的模板熟练 >>>找祖宗时要彻底 》》》每次q *n 超时 -》 单调性 -》 #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #include<bits/stdc++.h> 阅读全文
posted @ 2023-07-27 23:02 JMXZ
摘要:》》》dfs 先定义 再 写 》(dfs遇到叶节点,会自动返回) 》双向线路 会指向fa 》》》输入·时 反复检查 因为从叶节点dfs 会重复dfs节点 #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> 阅读全文
posted @ 2023-07-27 17:29 JMXZ
摘要:#include<cstdio> #include<iostream> int const maxn=111; int f[maxn][maxn],n,m,ans; int min(int x,int y,int z) { return std::min(std::min(x,y),z); } in 阅读全文
posted @ 2023-07-27 09:25 JMXZ
摘要:不可以 val-pos cuase not 1234.... 计算的是左移,右移 一轮 就可以实现 -》..... /* 10 7 7 7 7 7 6 6 6 6 6 6 */ #include<cstdio> #include<cstring> #include<iostream> #includ 阅读全文
posted @ 2023-07-25 13:52 JMXZ
摘要:因为 FJ恒速 所以DT 相同 -》贪心-》c越大 min -》max 走到max max-》min 刚追上就可以 走 #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #include<bits/st 阅读全文
posted @ 2023-07-25 11:23 JMXZ
摘要:>>>a[11] b[11] 有可能已经有值了 #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #include<bits/stdc++.h> #define ll long long #define 阅读全文
posted @ 2023-07-25 08:57 JMXZ
摘要:>>>迭代时,不要初始化 》》》想清楚再coding /* #include<bits/stdc++.h> using namespace std; const int X[]={1,0,-1,0}; const int Y[]={0,1,0,-1}; int n,m,a[1005][1005],f 阅读全文
posted @ 2023-07-25 08:09 JMXZ
摘要:坍塌只与 上面的有关 》》》数组多开+循环时检查 》》》运行时 闪退 基本就是 segment ERROR #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #include<bits/stdc++.h 阅读全文
posted @ 2023-07-24 23:00 JMXZ
摘要:答案具有“最大等待时间的最小值。” 单调性 二分-》 单调性 >>>模拟时1~n #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #include<bits/stdc++.h> #define ll 阅读全文
posted @ 2023-07-24 14:28 JMXZ
摘要:#include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #include<bits/stdc++.h> #define ll long long #define ddd printf(" debug\n"); 阅读全文
posted @ 2023-07-24 10:09 JMXZ
摘要:做法的结构大致是这样的:首先枚举其行的排列情况(类似全排列,只是元素个数确定)。然后,对于每一种行的排列情况,DP出它列的最优情况(DP等会儿再讲),然后取所有行的排列情况的最优情况的最小值。这样,就只需要一维的枚举了,比暴力快了不少。有的人可能还会问,这样会不会也超时?我们来算一下。这样的结构时间 阅读全文
posted @ 2023-07-24 08:12 JMXZ
摘要:先想一想再做 ,用自己的话说一遍 //对 vector 不熟 g[][] #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #include<bits/stdc++.h> #define ll long 阅读全文
posted @ 2023-07-23 18:27 JMXZ
摘要:#include<bits/stdc++.h> using namespace std; typedef long long ll; void tc(){ ll n; cin>>n; for(ll i=0;i<n;i++){ ll x; cin>>x; cout<<n+1-x<<' '; } cou 阅读全文
posted @ 2023-07-21 14:17 JMXZ

上一页 1 ··· 6 7 8 9 10 11 12 下一页