QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#203403 | #4004. Resource Calculator | Hongzy | AC ✓ | 644ms | 3920kb | C++17 | 3.9kb | 2023-10-06 17:14:26 | 2023-10-06 17:14:27 |
Judging History
answer
#include <bits/stdc++.h>
#define LOG(FMT...) fprintf(stderr, FMT);
#define rep(i, j, k) for(int i = j; i <= k; ++ i)
#define per(i, j, k) for(int i = j; i >= k; -- i)
using namespace std;
using ll = long long;
const int normalCost[90] = {0, 1000, 1325, 1700, 2150, 2625, 3150, 3725, 4350, 5000, 5700, 6450, 7225, 8050, 8925, 9825, 10750, 11725, 12725, 13775, 14875, 16800, 18000, 19250, 20550, 21875, 23250, 24650, 26100, 27575, 29100, 30650, 32250, 33875, 35550, 37250, 38975, 40750, 42575, 44425, 46300, 50625, 52700, 54775, 56900, 59075, 61275, 63525, 65800, 68125, 70475, 76500, 79050, 81650, 84275, 86950, 89650, 92400, 95175, 98000, 100875, 108950, 112050, 115175, 118325, 121525, 124775, 128075, 131400, 134775, 138175, 148700, 152375, 156075, 159825, 163600, 167425, 171300, 175225, 179175, 183175, 216225, 243025, 273100, 306800, 344600, 386950, 434425, 487625, 547200};
const int normalList[6] = {20, 40, 50, 60, 70, 80};
struct Level {
int a, l, t[3];
void in() {
scanf("%d%d", &a, &l);
rep(i, 0, 2)
scanf("%d", t + i);
}
} A, B;
int main() {
int test;
scanf("%d", &test);
rep(T, 1, test) {
map<string, ll> M;
A.in(); B.in();
rep(i, 0, 2) {
while(A.t[i] < B.t[i]) {
if(A.t[i] == 1) M["Coin"] += 12500, M["CommonMob"] += 6, M["Teachings"] += 3;
if(A.t[i] == 2) M["Coin"] += 17500, M["RareMob"] += 3, M["Guides"] += 2;
if(A.t[i] == 3) M["Coin"] += 25000, M["RareMob"] += 4, M["Guides"] += 4;
if(A.t[i] == 4) M["Coin"] += 30000, M["RareMob"] += 6, M["Guides"] += 6;
if(A.t[i] == 5) M["Coin"] += 37500, M["RareMob"] += 9, M["Guides"] += 9;
if(A.t[i] == 6) M["Coin"] += 120000, M["EpicMob"] += 4, M["Phylosophies"] += 4, M["WeeklyBossdrop"] += 1;
if(A.t[i] == 7) M["Coin"] += 260000, M["EpicMob"] += 6, M["Phylosophies"] += 6, M["WeeklyBossdrop"] += 1;
if(A.t[i] == 8) M["Coin"] += 450000, M["EpicMob"] += 9, M["Phylosophies"] += 12, M["WeeklyBossdrop"] += 2;
if(A.t[i] == 9) M["Coin"] += 700000, M["EpicMob"] += 12, M["Phylosophies"] += 16, M["WeeklyBossdrop"] += 2, M["Crown"] += 1;
++ A.t[i];
}
}
ll toPay = 0;
auto upNormal = [&]() {
toPay += normalCost[A.l];
A.l ++;
};
auto Buy = [&](ll o) {
M["Coin"] += o / 5;
o = (o + 999) / 1000;
ll t;
M["Hero"] += (t = o / 20); o -= 20 * t;
M["Adventurer"] += (t = o / 5); o -= 5 * t;
M["Wanderer"] += o;
};
while(A.a < B.a) {
while(A.l < normalList[A.a]) {
upNormal();
}
Buy(toPay), toPay = 0;
if(A.a == 0) M["Slivers"] += 1, M["Bossdrop"] += 0, M["CommonMob"] += 3, M["Specialties"] += 3, M["Coin"] += 20000;
if(A.a == 1) M["Fragments"] += 3, M["Bossdrop"] += 2, M["CommonMob"] += 15, M["Specialties"] += 10, M["Coin"] += 40000;
if(A.a == 2) M["Fragments"] += 6, M["Bossdrop"] += 4, M["RareMob"] += 12, M["Specialties"] += 20, M["Coin"] += 60000;
if(A.a == 3) M["Chunks"] += 3, M["Bossdrop"] += 8, M["RareMob"] += 18, M["Specialties"] += 30, M["Coin"] += 80000;
if(A.a == 4) M["Chunks"] += 6, M["Bossdrop"] += 12, M["EpicMob"] += 12, M["Specialties"] += 45, M["Coin"] += 100000;
if(A.a == 5) M["Gemstones"] += 6, M["Bossdrop"] += 20, M["EpicMob"] += 24, M["Specialties"] += 60, M["Coin"] += 120000;
++A.a;
}
while(A.l < B.l) {
upNormal();
}
Buy(toPay), toPay = 0;
printf("%lld %lld %lld %lld %lld\n", M["Coin"], M["Specialties"], M["Bossdrop"], M["WeeklyBossdrop"], M["Crown"]);
printf("%lld %lld %lld\n", M["Wanderer"], M["Adventurer"], M["Hero"]);
printf("%lld %lld %lld %lld\n", M["Slivers"], M["Fragments"], M["Chunks"], M["Gemstones"]);
printf("%lld %lld %lld\n", M["CommonMob"], M["RareMob"], M["EpicMob"]);
printf("%lld %lld %lld\n", M["Teachings"], M["Guides"], M["Phylosophies"]);
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3920kb
input:
2 0 1 1 1 1 0 20 4 5 6 0 20 3 3 3 1 30 6 6 6
output:
286535 0 0 0 0 1 0 6 0 0 0 0 18 42 0 9 39 0 340085 3 0 0 0 3 2 10 1 0 0 0 3 57 0 0 57 0
result:
ok 10 lines
Test #2:
score: 0
Accepted
time: 644ms
memory: 3916kb
input:
171037 0 1 9 8 6 0 1 10 10 10 0 1 4 5 8 0 2 7 7 9 0 1 6 8 8 0 3 8 8 9 0 1 8 2 2 0 4 10 5 8 0 1 6 4 5 0 5 7 7 9 0 1 9 9 6 0 6 9 10 7 0 1 6 4 6 0 7 6 5 9 0 1 10 9 10 0 8 10 10 10 0 1 7 10 2 0 9 9 10 5 0 1 6 8 1 0 10 7 8 6 0 1 4 6 8 0 11 10 6 10 0 1 1 6 9 0 12 10 6 10 0 1 5 5 9 0 13 7 8 9 0 1 3 1 2 0 1...
output:
3380000 0 0 12 3 0 0 0 0 0 0 0 0 0 64 0 0 82 795200 0 0 4 0 1 0 0 0 0 0 0 0 24 17 0 24 20 830465 0 0 4 0 3 0 0 0 0 0 0 0 0 19 0 0 22 1713305 0 0 6 1 0 1 0 0 0 0 0 0 35 31 0 33 38 1176235 0 0 6 0 2 1 0 0 0 0 0 0 24 27 0 24 30 821760 0 0 3 1 4 1 0 0 0 0 0 0 0 16 0 0 20 862390 0 0 4 0 2 2 0 0 0 0 0 0 6...
result:
ok 855185 lines