QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#374561 | #8316. Random Permutation | PetroTarnavskyi# | WA | 1ms | 3788kb | C++20 | 1.2kb | 2024-04-02 15:11:01 | 2024-04-02 15:11:01 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define RFOR(i, a, b) for(int i = (a) - 1; i >= (b); i--)
#define SZ(a) int(a.size())
#define ALL(a) a.begin(), a.end()
#define PB push_back
#define MP make_pair
#define F first
#define S second
typedef long long LL;
typedef vector<int> VI;
typedef pair<int, int> PII;
typedef double db;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
map<string, db> m;
m["ATK"] = 0;
m["ATK Rate"] = 0;
m["Crit Rate"] = 0.05;
m["Crit DMG Rate"] = 0.5;
FOR (i, 0, 25)
{
string s;
getline(cin, s);
FOR (j, 0, SZ(s))
{
if (s[j] == '+')
{
string stat = s.substr(0, j);
string val = s.substr(j + 1, SZ(s) - j - 1);
bool per = false;
if (val.back() == '%')
{
val.pop_back();
per = true;
}
db d = stod(val);
if (per)
d /= 100;
m[stat] += d;
}
}
}
db atk = 1500 * (1 + m["ATK Rate"]) + m["ATK"];
db cr = min(1.0, m["Crit Rate"]);
db crd = m["Crit DMG Rate"];
db E = atk * (1 - cr) + atk * (1 + crd) * cr;
cout << fixed << setprecision(15) << E << '\n';
return 0;
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3788kb
input:
2
output:
1537.499999999999773
result:
wrong answer 1st numbers differ - expected: '1.0000000', found: '1537.5000000', error = '1536.5000000'