#include#define lyh(i,a,b) for(int i=a;i>n; int mx=0,mi=0; lyh(i,0,n) { int tmp; cin>>tmp; if(tmp!=lst){ mi+=tmp; lst=tmp; } mx+=tmp; } cout< 2.只有70分,暴力模拟的
#includeusing namespace std; #define INF 0x3f3f3f3f int n; int a[500001]; int b[500001]; void st(int x){ for(int i=0;i
模拟题记得:
认真读题,先按照自己的思路观察一下样例,然后再上手敲
结构体或者类需要做初始化
模拟题的坑很多,一个细节不注意就全错(哭了
编译错误时,看看是不是有变量名或者函数名是保留字#includeusing namespace std; //最终得分 66 static unsigned long nxt = 1; #define ll long long #define INF 0x3f3f3f3f int myrand(void) { nxt = nxt * 1103515245 + 12345; return((unsigned)(nxt/65536) % 32768); } #define de(a) cout<<#a<<"="< to; bool updt(){ double v=vk,u=uk; vk=v+dt*(0.04*v*v+5*v+140-u)+ik; uk=u+dt*a*(b*v-u); ik=0; if(vk>=30){ vk=c; uk+=d; ct++; return 1; } return 0; } SJY(){ vk=uk=ik=0; a=b=c=d=0; k=ct=0; } }sjy[1001]; class TC{ public: ll d; double w; ll e; TC(){ d=e=0; w=0; } }tc[1001]; class MCY{ public: ll r; vector to; MCY(){ r=0; } }mcy[1001]; struct node{ ll k; double w; ll e; bool operator<(const node &n) const{ return n.k >N>>S>>P>>T; cin>>dt; for(int i=0;i >rn>>v>>u>>a>>b>>c>>d; for(int j=i;j>mcy[i].r; } for(int i=0;i >s>>tc[i].e>>tc[i].w>>tc[i].d; if(sq; for(t=1;t<=T;t++){ for(int i=0;i



