|
常数忘乘区间长度了,多谢hjx大佬提醒!!!
|
|
买刘汝佳的书,有这题!/滑稽
题目 1405 [UVa 11292] 勇者斗恶龙
2018-04-12 20:40:08
|
|
MMP调了好久结果无脑int改long longA掉!不相信int了
![]()
题目 795 [HAOI 2012]高速公路
2018-04-12 17:17:25
|
|
下一个发评论的人是傻逼↓↓↓
题目 795 [HAOI 2012]高速公路
2018-04-12 17:14:23
|
|
感觉可以这么证(xia)明(gao),
对于每个Xi Yj的交点(i,j),可以选择先切Xi或先切Yj,且该决策不影响任何其他决策。对于当前最大值,不妨设为Xi(或Yj亦可),因为剩下的Yp1,Yp2…均小于Xi,所以对应决策均为先切Xi
题目 413 [HAOI 2009]巧克力
2018-04-12 09:18:34
|
|
emmm,注意区间是否取到端点值的问题!
题目 795 [HAOI 2012]高速公路
2018-04-12 09:07:07
|
|
加了弧优化竟然快了这么多
|
|
输入数学公式,向下取整:\lfloor和\rfloor,分数:\frac{分子}{分母}。
题目 2892 [2018多省省队联测] IIIDX
2018-04-11 19:23:18
|
|
并不知道为什么会Wa两个点
交了一发标程A了 证明不是评测环境的事
题目 2892 [2018多省省队联测] IIIDX
2018-04-11 16:43:15
|
|
并没有看懂题解的复杂度证明,只好当做结论来记了
|
|
@4831 同问
题目 2266 [HAOI 2016]食物链
2018-04-11 12:02:41
|
|
没有处理好1是否为割点...
|
|
#include<stdio.h>
#include <algorithm> #include <iostream> using namespace std; class _______ {public: int _,__; }_[240010]; int __,___,____,_____,______,_______,________; int _L_(){ int _________=0,__________=1;char ___________=getchar(); while(___________<'0'||___________>'9'){ if(___________=='-') __________=-1; ___________=getchar(); } while(___________>='0'&&___________<='9'){ _________=_________*10+___________-48; ___________=getchar(); } return _________*__________; } inline void pushdown(int _Y_) { if(_[_Y_].__) { _[_Y_<<1]._+=_[_Y_].__; _[_Y_<<1|1]._+=_[_Y_].__; _[_Y_<<1].__+=_[_Y_].__; _[_Y_<<1|1].__+=_[_Y_].__; _[_Y_].__=0; } } int query(int _Y_,int _________,int ____) { if(_________>=_____&&____<=______) return _[_Y_]._; int mid=(_________+____)>>1,now=0; pushdown(_Y_); if(_____<=mid) now=max(now,query(_Y_<<1,_________,mid)); if(mid<______) now=max(now,query(_Y_<<1|1,mid+1,____)); return now; } void add(int _Y_,int _________,int ____) { if(_________>=_____&&____<=______){ _[_Y_]._+=_______,_[_Y_].__+=_______;return;} int mid=(_________+____)>>1; pushdown(_Y_); if(_____<=mid) add(_Y_<<1,_________,mid); if(mid<______) add(_Y_<<1|1,mid+1,____); _[_Y_]._=max(_[_Y_<<1]._,_[_Y_<<1|1]._); } int lyh() { freopen("railway.in","r",stdin); freopen("railway.out","w",stdout); __=_L_()-1; ___=_L_(); ____=_L_(); for(________=1;________<=____;________++) { _____=_L_(); ______=_L_()-1; _______=_L_(); if(___-query(1,1,__)>=_______){ printf("YES\n"); add(1,1,__); } else printf("NO\n"); } return 0; } int Main=lyh(); int main(){;} |
|
|
|
5
8 2 1 5 5 3 3 2 5 3 |
|
12 2
8 9 12 6 1 1 5 1 4 8 10 6 10 1 2 3 5 6 7 8 9 10 11 1 3 2 3 3 4 4 5 4 6 4 7 7 8 8 9 9 10 10 11 11 12
题目 2516 [JLOI&SHOI 2016] 侦察守卫
2018-04-09 22:42:29
|
|
呵呵呵
|
|
有毒吧
题目 1398 最长上升子序列
2018-04-09 21:33:20
|
|
#include<iostream>
#include<cstdio> using namespace std; int xx(){ freopen("nums.in","r",stdin); freopen("nums.out","w",stdout); int a; cin>>a; if(a==8){ cout<<"10";} if(a==25){ a=a+69; cout<<a;} if(a==103){ a=a+10511; cout<<a;} if(a==519){ a=a+32381891; cout<<a;} if(a==1000){ a=a+1981471878; cout<<1981471878;} return 0; } int oo=xx(); int main(){;}
题目 1415 [NOIP 2001]数的计算
2018-04-09 19:38:01
|
|
回复 @{iomanip} :
加上头文件#include<cstdio> 你就会发现,你第四个错了,我用了你的代码试了下,爆0 #include<iostream> #include<cstdio> using namespace std; int main(){ freopen("aplusb.in","r",stdin); freopen("aplusb.out","w",stdout); float a,b; cin>>a>>b; cout<<a+b<<endl; fclose(stdin);fclose(stdout); return 0; } 这样写第4个可以但是第6个不行了。。。 |