fulin10
fulin10
全部文章
分类
题解(4)
归档
标签
去牛客网
登录
/
注册
fulin10的博客
全部文章
(共6篇)
题解 | #小咪买东西#
emmm直接枚举x,二分查找最大化模板,即可。 #include <algorithm> #include <string.h> using namespace std; typedef long long ll; ll t,n,k,v[100000],c[100000],g...
2023-12-19
0
208
题解 | #起床困难综合症#
呃呃还算简洁吧,前缀+二分。。。。里面写找第一个大于等于t+1的位置,这个位置(下标)就是第某个音符。 int N,Q; int sumpre[60000]; int main(void) { cin>>N>>Q; int a; for(int i=1...
前缀和
2023-12-08
0
234
题解 | #起床困难综合症#
emm借用了雨神的思路,然后就考验本苟若的代码水平了 #include <unordered_map> using namespace std; int n,m; int result; unordered_map<int,pair<string,int>>l; ...
贪心
2023-11-02
0
251
题解 | #[USACO 2007 Jan S]Protecting the Flowers#
感觉用不着前缀和 #include <algorithm> using namespace std; int n; struct ty { int ti; int fdead; }myty[100010]; long long result,count1; bool co...
2023-11-01
0
204
题解 | #大小写转换#
emmm键盘输入的 z后其实在缓冲区有2个字符,一个z一个空格。getchar()丢掉空格符号。由于enter是换行建对应10,所以如果没有getchar会输出42对应的*。 如果是xcx fc字符串,scanf会取xcx,这个时候需要getchar()丢掉空格符号
2022-10-01
0
241
题解 | #出生日期输入输出#
emmmmm取出一串数字的前几个:除得商即可 或者后几个:取%余即可。//%100,即得到后两位数。 中间的几个:先商出去后面的数,通过%得到所需要的数。// 比如578/10.余一个数8,那么该数除10商一定是57(即其他的位数,高到低)。
C
2022-10-01
0
281