Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // __________________
- // | ________________ |
- // || ____ ||
- // || /\ | ||
- // || /__\ | ||
- // || / \ |____ ||
- // ||________________||
- // |__________________|
- // \\#################\\
- // \\#################\\
- // \ ____ \
- // \_______\___\_______\
- // An AC a day keeps the doctor away.
- #pragma gcc optimize("Ofast")
- #pragma loop_opt(on)
- #include <bits/stdc++.h>
- #define debug(x) 1&&(cout<<#x<<':'<<(x)<<'\n')
- #define pb emplace_back
- #define ff first
- #define ss second
- #define siz(v) (ll(v.size()))
- #define all(v) begin(v),end(v)
- #define REP(i,l,r) for(int i=(l);i<(r);i++)
- #define mid (l+(r-l>>1))
- using namespace std;
- typedef long long ll;
- typedef long double ld;
- typedef pair<ll,ll> pll;
- constexpr long double PI = acos(-1),eps = 1e-8;
- constexpr ll N = 1000000, INF = 1e18, MOD = 998244353;
- struct soldier{
- int pos, killed, dps, dmg;
- int cd, maxCd, buff, maxBuff;
- double buffEff;
- int output;
- string name;
- } S[5];
- int bossHp, maxHp, bossReload;
- signed main(){
- S[0].dps = S[1].dps = S[2].dps = 150*10;
- S[0].cd = 6, S[0].maxCd = 16, S[0].maxBuff = 8, S[0].buffEff = 1200;
- S[1].cd = 6, S[1].maxCd = 8, S[1].maxBuff = 5, S[1].buffEff = 1440;
- S[2].cd = 6, S[2].maxCd = 16, S[2].maxBuff = 4, S[2].buffEff = 3000;
- S[3].dps = S[4].dps = 100*20;
- S[3].cd = 4, S[3].maxCd = 8, S[3].maxBuff = 5, S[3].buffEff = 3000;
- S[4].cd = 3, S[4].maxCd = 16, S[4].maxBuff = 5, S[4].buffEff = 3000, S[4].dmg = 100*7;
- S[0].name = "RFB", S[1].name = "AK12", S[2].name = "G11", S[3].name = "SR-3MP", S[4].name = "Vector";
- for(int i = 0; i < 5; i++) cin >> S[i].pos;
- sort(S,S+5,[](soldier &a,soldier &b){return a.pos<b.pos;});
- cin >> maxHp >> bossReload, bossHp = maxHp;
- for(int t = 1; t <= 1000; t++) {
- bool alive = false;
- int totDps = 0;
- for(int i = 0; i < 5; i++) {
- auto &s = S[i];
- if(s.killed) continue;
- alive = true;
- if(--s.cd == 0) s.buff = s.maxBuff+1, s.cd = s.maxCd, totDps += s.dmg, s.output += s.dmg;
- if(s.buff > 0) s.buff--, totDps += s.dps+s.buffEff, s.output += s.dps+s.buffEff;//, cout<<"use skill... ";
- else totDps += s.dps, s.output += s.dps;
- //cout << s.name << ' ' << s.output << '\n';
- }
- //system("PAUSE");
- if(!alive) {
- cout << "Failure\n";
- cout << fixed << setprecision(1) << double(bossHp)*100/maxHp << '\n';
- return 0;
- }
- bossHp -= totDps;
- if(bossHp <= 0) {
- cout << "Victory\n";
- cout << t;
- int mx = -1e9;
- vector<int> ans;
- for(int i = 0; i < 5; i++)
- if(S[i].output > mx) mx = S[i].output, ans.clear(), ans.push_back(i);
- else if(S[i].output == mx) ans.push_back(i);
- for(auto i:ans) cout << ' ' << S[i].name;
- cout << '\n';
- return 0;
- }
- if(t%bossReload == 0) {
- for(int i = 0; i < 5; i++) if(!S[i].killed) {
- S[i].killed = true;
- break;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment