- 博客(13)
- 收藏
- 关注
原创 斗恶龙(经典二分)
#include <bits/stdc++.h>using namespace std;typedef long long ll;const int N = 100010;int n,m;ll a[N],sum[N];bool find(ll mid){ int k=0; for(int i=n;i>0;i--) { if(mid<=a[i]) //说明这个装备可以满足装备mid个士兵 { ...
2022-05-30 21:21:00
169
原创 福建农林大学校赛(同步赛) D E
/* 思路: 1.先二分a数组有多少个数比当前数小,比他开始早说明都有可能看得到 2.再二分b数组,判断有多少个数比他小,比他小的,说明等他赏花时,已经凋零了看不到了 3.只需要将可能看到的数量减去已经凋零的数量,就是能看到的数量*/#include <bits/stdc++.h>using namespace std;typedef long long ll;const int......
2022-05-30 21:15:40
250
原创 Educational Codeforces Round 128 (Rated for Div. 2) A~B
A~Minimums and Maximums#include <bits/stdc++.h>using namespace std;typedef long long ll;const int N = 201000;int t; int main(){ cin>>t; while(t--) { int l1,r1,l2,r2; cin>>l1>>r1>>l2>>r
2022-05-14 04:15:00
372
2
原创 Codeforces Round #790 (Div. 4) C~E 题解
#include <bits/stdc++.h>using namespace std;typedef long long ll;const int N = 201;int t; int main(){ cin>>t; while(t--) { int n,m,min1=1e6; string s[N]; cin>>n>>m; for(int i=0;i&l...
2022-05-11 00:53:22
234
原创 第20届上海大学程序设计联赛春季赛 A题:如何才能穿过传送门
#include <bits/stdc++.h>using namespace std;typedef long long ll;const int N = 201000;int n,m,q,a[N]; int main(){ cin>>n>>m>>q; for(int i=1;i<=n;i++) a[i]=i;//图的基本预处理 for(int i=1;i<=m;i++)//传送...
2022-05-10 15:31:14
148
原创 Codeforces Round #789 (Div. 2) A~B
#include <bits/stdc++.h>using namespace std;typedef long long ll;const int N = 201000;int t; int main(){ cin>>t; while(t--) { int n,a[N]={0},b[N]={0},ans=0,res=0,ok=1; cin>>n; for(int i=1;i<=...
2022-05-09 01:18:38
92
原创 A Perfectly Balanced String? (Codeforces Round #785 (Div. 2))
A Perfectly Balanced String? (Codeforces Round #785 (Div. 2))
2022-05-02 14:27:41
511
原创 Trie 经典例题 (思维巧妙)
/*STARTfrom fiwohello difhmars riwosfearth fnnvklike fiiwjENDSTARTdifh, i'm fiwo riwosf.i fiiwj fnnvk!ENDhello, i'm from mars.i like earth!*/#include <iostream>#include <string>#include <istream>using namespace ...
2022-04-18 22:02:45
273
原创 二分+优先队列(堆)(第十九届浙大城市学院程序设计竞赛)L题
#include <bits/stdc++.h>using namespace std;typedef long long ll;const int N = 1001000;ll t,n,a[N],ans,k;ll check(ll mid)// x就是mid{ ll i; //下面定个小根堆q priority_queue<int, vector<int>, greater<int>> q; ...
2022-04-13 23:02:44
540
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人