正文
增加 5 行删除 5 行
170 行未改动全部展开17117217317417517617717817918018118258 行未改动2412422432442452462472482499 行未改动25926026126226326426526626726826927027127227327427527623 行未改动170 行未改动全部展开/*------------------------------res_F------------------------------*/struct qaq{int F, day_left;qaq(){}qaq(const int &F_in, const int &day_left_in):F(F_in), day_left(day_left_in){}bool operator < (const qaq &B) const{return F < B.F;}}res_F[(int)1e6];58 行未改动for(int i =0; i < m; ++i){scanf("%d", &C[i]);C_max =max(C_max, C[i]);}/*暴力 dp 出最多能用来攻击的天数*/memset(dp, -0x3f, sizeof(dp));/*-0x3f 代表状态不合法 ( 活不到这种状态 )*/dp[0][mc] =0;for(int i =0; i < n; ++i)9 行未改动int max_day_to_attack =0;for(int i =1; i <= n; ++i)for(int j =0; j <= mc; ++j)max_day_to_attack =max(max_day_to_attack, dp[i][j]);/*处理出得到每个 F 并使用后的最大的剩余天数,以及 F_max_pre[.]*/pre_set(n, C_max);bfs(max_day_to_attack, C_max);sort(res_F, res_F+tot);for(int i =0, mx =-0x3f3f3f3f; i < tot; ++i){mx =max(mx, res_F[i].F+res_F[i].day_left);F_max_pre[i] =mx;}for(int i =0; i < m; ++i){bool able_to_beat =0;if(max_day_to_attack >= C[i])able_to_beat =1;23 行未改动170 行未改动全部展开17117217317417517617717817918018118258 行未改动2412422432442452462472482499 行未改动25926026126226326426526626726826927027127227327427527623 行未改动170 行未改动全部展开/*------------------------------res_F------------------------------*/struct qaq{int F, day_left;qaq(){}qaq(const int &F_in, const int &day_left_in):F(F_in), day_left(day_left_in){}bool operator < (const qaq &B) const{return F < B.F;}}res_F[(int)1e6];58 行未改动for(int i =0; i < m; ++i){scanf("%d", &C[i]);C_max =max(C_max, C[i]);}/*暴力 dp 出最多能用来攻击的天数*/memset(dp, -0x3f, sizeof(dp));/*-0x3f 代表状态不合法 ( 活不到这种状态 )*/dp[0][mc] =0;for(int i =0; i < n; ++i)9 行未改动int max_day_to_attack =0;for(int i =1; i <= n; ++i)for(int j =0; j <= mc; ++j)max_day_to_attack =max(max_day_to_attack, dp[i][j]);/*处理出得到每个 F 并使用后的最大的剩余天数,以及 F_max_pre[.]*/pre_set(n, C_max);bfs(max_day_to_attack, C_max);sort(res_F, res_F+tot);for(int i =0, mx =-0x3f3f3f3f; i < tot; ++i){mx =max(mx, res_F[i].F+res_F[i].day_left);F_max_pre[i] =mx;}for(int i =0; i < m; ++i){bool able_to_beat =0;if(max_day_to_attack >= C[i])able_to_beat =1;23 行未改动