纯题解
查看原帖
纯题解
467725
hw20高玮泽楼主2021/12/12 17:02
#include<bits/stdc++.h>
using namespace std;

int n,t,s,sg,shul=0,a,b;
struct People{
	long long tme;
	int guoj;
};

People one[1000001];
long long f=0,r=0;
int zcs[1000001];

int main(){
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>t;
		cin>>s;
		for(int j=1;j<=s;j++){
			cin>>sg;
			r++;
			one[r].tme=t;
			one[r].guoj=sg;
			zcs[sg]++;
			if(zcs[sg]==1) shul++;
		}
		while(1){
			a=one[f+1].tme;
			b=one[f+1].guoj;
			if(t-a<86400) break;
			zcs[b]--;
			if(zcs[b]==0) shul--;
			f++;
		}
		cout<<shul<<endl;
	}
	return 0;
}

附加游戏: #include<bits/stdc++.h> #include #include #include<windows.h> #include<time.h> #include<stdlib.h> #include<conio.h> #include #include #include #include using namespace std;

void beido(int n,int m);

void jineng(int n,int m);

void wupxs(int n,int m);

int jied=1; int wup[500]; int zhuap[101][5]; int zhpsp[101][5]; int baid[101]; int jine[101]; int tiaoz[6][7];

struct jsz{ long long suzhi; long long sujz; };

struct wanja{ string name; int dj; long long jiya; int bad[4][2]; int jinen[4][2]; int suxing[5]; char a,b,c,d,e,f,g; long long huih; int sz[4][3]; long long xueli1,money; jsz xueli2,fangy,gonj; long long fyxy,gjxy; int fanc; int a1,a2,a3; };

struct boss{ string name; int a,b,c,d; int suxing[5]; long long su,gj,fay; int a1,a2; };

wanja one; boss two;

int main(){

srand((int)time(0)); 
//        gongji       fangyu            shanbi         baoji 
one.suxing[1]=one.suxing[2]=one.suxing[3]=one.suxing[4]=0;
two.suxing[1]=two.suxing[2]=two.suxing[3]=two.suxing[4]=0;
tiaoz[1][1]=1;
one.jiya=0;
one.bad[1][1]=one.bad[2][1]=one.bad[3][1]=0;
one.jinen[1][1]=one.jinen[2][1]=one.jinen[3][1]=0;
one.huih=1;
one.sz[1][1]=one.sz[1][2]=one.sz[2][1]=one.sz[2][2]=one.sz[3][1]=one.sz[3][2]=0;
one.xueli1=100;
one.xueli2.suzhi=100;
one.fangy.suzhi=10;
one.gonj.suzhi=10;
one.xueli2.sujz=0;
one.fangy.sujz=0;
one.gonj.sujz=0;
one.dj=1;
one.money=0;
// chushihua 
cout<<"            Nighter"<<endl;
cout<<"wait."<<endl;
for(int i=1;i<=3;i++){
    cout<<"-";
    Sleep(1050);
}
system("cls");




	cout<<"Your name :";
    getline(cin,one.name);
    system("cls"); 

















while(1){
	if(jied==1){
		cout<<"   story:"<<endl;
		                                                                                            //cout<<"在[世界之界-轮]的影响下,整个世界都受到了影响。"<<endl;
		                                                                                            // cout<<"未知名的界入-弑者的在追杀,只好寻找出路。"<<endl;
		                                                                                            //cout<<"在未知的旅途上,前行。"<<endl;
		Sleep(0.0001);
		system("cls");
		while(1){
			if(one.jiya>=one.dj*one.dj*100&&one.dj<100){
				one.jiya-=one.dj*one.dj*100;
				one.xueli2.suzhi+=one.dj*one.dj*10;
				one.gonj.suzhi+=one.dj*one.dj*10;
				one.fangy.suzhi+=one.dj*one.dj*10;
				one.dj++;
				cout<<"等级+1"<<endl;
				Sleep(1000);
			}
			cout<<"1.信息"<<endl;
			cout<<"2.危城"<<endl;
			one.a=getch();
			system("cls");
			if(one.a=='1'){
				cout<<"       name:"<<one.name<<endl;
				cout<<"       生命:"<<one.xueli1<<endl;
				cout<<"       血量(上限):"<<one.xueli2.suzhi+one.xueli2.sujz<<"   "<<one.sz[3][1]<<'.'<<one.sz[3][2]<<endl;
				cout<<"       攻击:"<<one.gonj.suzhi+one.gonj.sujz<<"   "<<one.sz[1][1]<<'.'<<one.sz[1][2]<<endl;
				cout<<"       防御:"<<one.fangy.suzhi+one.fangy.sujz<<"   "<<one.sz[2][1]<<'.'<<one.sz[2][2]<<endl;
				cout<<endl;
				cout<<"1.装备"<<endl;
				cout<<"2.背包"<<endl;
				cout<<"输入0退出"<<endl;
				one.b=getch();
				system("cls");
				if(one.b=='1'){
					cout<<"   背包:"<<endl;
					if(zhuap[1][1]>=1){
						cout<<"1.1 铁剑(10)   *"<<zhuap[1][1]<<endl; 
					}
					if(zhuap[1][2]>=1){
						cout<<"1.2 铁盾(10)   *"<<zhuap[1][2]<<endl; 
					}
					if(zhuap[1][3]>=1){
						cout<<"1.3 铁甲(10)   *"<<zhuap[1][3]<<endl; 
					}
					cout<<"输入0 0 0退出"<<endl<<"输入1+标号出售"<<endl<<"输入2+标号装备"<<endl;
					one.c=getch();
					one.d=getch();
					one.e=getch();
					system("cls");
					if(one.c=='1'){
						if(one.d=='1'&&one.e=='1'&&zhuap[1][1]>=1){
						    zhuap[1][1]--;
						    if(zhuap[1][1]==0&&one.sz[1][1]==1&&one.sz[1][2]==1){
						    	one.gonj.sujz=0;
						    	one.sz[1][1]=one.sz[1][2]=0;
						    	cout<<"攻击为"<<one.gonj.suzhi<<"(无装备)"<<endl;
						    }
						    cout<<"成功出售"<<endl;
						    cout<<"钱+5"<<endl;
						    one.money+=5;
						    Sleep(1000);
						    system("cls");
					    }
					}
					if(one.c=='2'){
						if(one.d=='1'&&one.e=='1'&&zhuap[1][1]>=1){
							one.sz[1][1]=one.sz[1][2]=1;
							one.gonj.sujz=10;
							cout<<"成功装备"<<endl;
							cout<<"攻击为"<<one.gonj.suzhi+one.gonj.sujz<<endl;
							Sleep(1000);
						    system("cls");
						}
					}
				}
				if(one.b=='2'){
					cout<<"背包:"<<endl;
					for(int i=1;i<=500;i++){
						if(wup[i]>=1){
							wupxs(i,1);
						    cout<<" * "<<wup[i]<<endl;
						}
					}
					cout<<"输入0退出"<<endl;
					one.c=getch();
					one.a3=one.c-'0';
					wupxs(one.a3,2);
				}
			}
			if(one.a=='2'){
				cout<<"1.地图"<<endl;
				cout<<"2.商店"<<endl;
				cout<<"输入0退出"<<endl;
				one.b=getch();
				system("cls");
				if(one.b=='1'){
					one.c='1';
					while(one.c!='0'){
						if(tiaoz[1][1]==1){
							cout<<"1. Asewastndot(城)"<<endl; 
						}
						cout<<"输入0退出"<<endl;
						one.c=getch();
						system("cls");
						if(one.c=='1'&&tiaoz[1][1]==1){
							if(tiaoz[1][1]==1){
								cout<<"1. 士兵"<<endl;
							}
							if(tiaoz[1][2]==1&&tiaoz[1][3]==0){
								cout<<"2. ???"<<endl;
							}
							if(tiaoz[1][2]==1){
								cout<<"6.黑贩"<<endl;
							}
							cout<<"输入0退出"<<endl;
							one.d=getch();
							system("cls");
	//		//		//		//
							if(one.d=='1'&&tiaoz[1][1]==1){
								two.name="士兵";
								one.huih=1;
								two.su=80;
								two.gj=5;
								two.fay=5;
								one.fanc=10;
								one.a1=0;
								one.a2=0;
								one.fyxy=one.fangy.suzhi+one.fangy.sujz;
								one.gjxy=one.gonj.suzhi+one.gonj.sujz;
								one.suxing[1]=one.suxing[2]=one.suxing[3]=one.suxing[4]=0;
                            	two.suxing[1]=two.suxing[2]=two.suxing[3]=two.suxing[4]=0;
								while(one.xueli1>0&&two.su>0){
									cout<<"回合:"<<one.huih<<endl;
								
									two.a=rand()%10+1;
					    			if(two.a==1||two.a==2){
					    				cout<<two.name<<':'<<"暴击(bed)"<<endl;
					    				two.gj+=1;
					    				two.fay+=1;
									}
								    
								    one.gjxy=one.gonj.suzhi+one.gonj.sujz+one.suxing[1]*one.dj*one.dj;
								    two.gj=two.gj+two.suxing[1]*one.dj*one.dj;
								    one.fyxy+=one.suxing[2]*one.dj*one.dj;
								    two.fay+=two.suxing[2]*one.dj*one.dj;
								    
						    		cout<<"boss:"<<two.name<<"     You:"<<one.name<<endl;
					    			cout<<"血量:"<<two.su<<"     "<<one.xueli1<<endl;
					    			cout<<"攻击:"<<two.gj<<"     "<<one.gjxy<<endl;
					    			cout<<"防御:"<<two.fay<<"     "<<one.fyxy<<endl<<endl<<endl;
									cout<<"1.攻击"<<endl;
									cout<<"2.防御"<<"("<<one.fanc<<")"<<endl;
									//cout<<"3.闪避"<<endl;
									cout<<"3.技能"<<endl;
									cout<<"4.背包"<<endl;
									one.e=getch();
									system("cls");
								
									one.a2=10+one.suxing[3]*5;
									if(one.a2<=0){
										one.a2=1;
									}
									if(one.a2>=100){
										one.a2=90;
									}
									two.a2=10+two.suxing[3]*5;
									if(two.a2<=0){
										two.a2=1;
									}
									if(two.a2>=100){
										two.a2=90;
									}
									one.a1=rand()%100+1;
									two.a1=rand()%100+1;
								
									if(one.e=='1'){
										if(two.a1>two.a2){
											two.fay-=one.gjxy;
											if(two.fay<0){
												two.su+=two.fay;
												two.fay=0;
											}
										}
										if(one.a1>one.a2){
											one.fyxy-=two.gj;
											if(one.fyxy<0){
												one.xueli1+=one.fyxy;
												one.fyxy=0;
											}
										}
									}
									if(one.e=='2'&&one.fanc>=1){
										if(one.a1>one.a2){
											if(two.gj>one.fyxy){
												one.xueli1=one.xueli1-(two.gj-one.fyxy);
											}
											one.fanc--;
										}
									}
									if(one.e=='3'){
										cout<<"技能:"<<endl;
										jineng(one.jinen[1][1],1);
										jineng(one.jinen[2][1],1);
										jineng(one.jinen[3][1],1);
										cout<<"输入0退出"<<endl;
										one.f=getch();
										one.a3=one.f-'0';
										jineng(one.a3,2);
									}
									if(one.e=='4'){
										cout<<"背包:"<<endl;
					            	    for(int i=1;i<=500;i++){
					            	    	if(wup[i]>=1&&i!=1&&i!=2){
					            	    		wupxs(i,1);
					   		  	          	    cout<<" * "<<wup[i]<<endl;
				        	 	       		}
					     	            }
					     	            cout<<"输入0退出"<<endl;
					     	            one.d=getch();
					      	            one.a3=one.d-'0';
					      	            wupxs(one.a3,2);
									}
									if(two.su<=0){
										cout<<"成功击败"<<endl;
										one.money+=5;
										one.jiya+=15;
										cout<<"Moketud+5"<<endl;
										if(tiaoz[1][2]==0){
											tiaoz[1][2]=1; 
										}
										one.a3=rand()%100+1;
										if(one.a3<=3){
											one.a1=rand()%100+1;
											if(one.a1<=90){
												zhpsp[2][1]++;//zhuap[2][1]:ASe dao 碎片需(5)
												cout<<"获得 ASe dao 碎片"<<endl;
											}
											else{
												zhuap[2][1]++;
												cout<<"获得 ASe dao"<<endl;
											}
										}
										break;
										Sleep(1000);
									}
									one.huih++;
								}
							}
	//		//		//		//
	                        
	//		//		//		//
	                        if(one.d=='2'&&tiaoz[1][2]==1&&tiaoz[1][3]==0){
	                        	
							}                        






	/**/

                	        if(one.d=='6'&&tiaoz[1][2]==1){
                 		       	one.e='1';
                   		     	int gusl=0;
                		       	while(one.e!='0'){
                	        		cout<<"1.H 回 Y [50%] {boss战除外} (4m)"<<endl;
                  		      		cout<<"2.H 满 Y [100%] {boss战除外} (7m)"<<endl;
                    	    		one.e=getch();
                    	    		system("cls");
                       		 		if(one.e=='0'&&gusl==0){
                        				one.xueli2.suzhi-=10*one.dj;
                        				if(one.xueli2.suzhi<=10){
                        					one.xueli2.suzhi=20;
										}
										if(one.xueli1>one.xueli2.suzhi+one.xueli2.sujz){
											one.xueli1=one.xueli2.suzhi+one.xueli2.sujz;
										}
										one.money-=10*one.dj;
										cout<<"哼!竟然不买东西。"<<endl;
										cout<<"You 生命-"<<10*one.dj<<endl<<"You Moketud-"<<10*one.dj<<endl;
										break;
										Sleep(1000);
										system("cls");
									}
									if(one.e=='1'&&one.money>=4)
									{
										wup[1]++;
										one.money-=4;
										gusl++;
										cout<<"获得H 回 Y [50%]"<<endl;
										Sleep(1000);
										system("cls");
									}
									if(one.e=='2'&&one.money>=7)
									{
										wup[2]++;
										one.money-=7;
										gusl++;
										cout<<"获得H 满 Y [100%]"<<endl;
										Sleep(1000);
										system("cls");
									}
								}
							} 
						
	/**/		
						
						
						
						
						
						
						}
					}
				}
				if(one.b=='2'){
					one.c='1';
					while(one.c!='0'){
						cout<<"1.攻击"<<endl;
						cout<<"2.防御"<<endl;
						cout<<"3.生命"<<endl;
						cout<<"输入0退出"<<endl;
						one.c=getch();
						system("cls");
						if(one.c=='1'){
							cout<<"1.铁剑(10)[10m]"<<endl;
							cout<<"输入0退出"<<endl;
							one.a=getch();
							system("cls");
							if(one.a=='1'&&one.money>=10){
								one.money-=10;
							    zhuap[1][1]++;
							    cout<<"获得铁剑"<<endl;
							    Sleep(1000);
							    system("cls");
							}
						} 
						if(one.c=='2'){
							cout<<"1.铁盾(10)[10m]"<<endl;
							cout<<"输入0退出"<<endl;
							one.a=getch();
							system("cls");
							if(one.a=='1'&&one.money>=10){
								one.money-=10;
								zhuap[1][2]++;
								cout<<"获得铁盾"<<endl;
								Sleep(1000);
							    system("cls");
							} 
						} 
						if(one.c=='3'){
							cout<<"1.铁甲(10)[10m]"<<endl;
							cout<<"输入0退出"<<endl;
							one.a=getch();
							system("cls");
							if(one.a=='1'&&one.money>=10){
								one.money-=10;
								zhuap[1][3]++;
								cout<<"获得铁甲"<<endl;
								Sleep(1000);
							    system("cls");
							} 
						}
					}
				}
			} 
		}
	}
}
return 0;

}

void jineng(int n,int m){ if(m==1){ if(n==1&&jine[n]==1){ cout<<n<<'.'<<""<<endl; } } if(m==2){ if(n==1&&jine[n]==1){

	}
}

}

void wupxs(int n,int m){ if(m==1){ if(n==1&&wup[n]>=1){ cout<<n<<'.'<<"H 回 Y [50%]"; } if(n==2&&wup[n]>=1){ cout<<n<<'.'<<"H 满 Y [100%]"; } } if(m==2){ if(n==1&&wup[n]>=1){ one.xueli1=(one.xueli2.suzhi+one.xueli2.sujz)/2; cout<<"血量为50%"<<endl; wup[n]--; Sleep(1000); } if(n==2&&wup[n]>=1){ one.xueli1=one.xueli2.suzhi+one.xueli2.sujz; cout<<"血量为100%"<<endl; wup[n]--; Sleep(1000); } } }

2021/12/12 17:02
加载中...