QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#650512 | #7865. Refresher into Midas | Mrlaolu# | AC ✓ | 11ms | 3692kb | C++20 | 1.2kb | 2024-10-18 15:27:41 | 2024-10-18 15:27:43 |
Judging History
answer
#include <bits/stdc++.h>
#define int long long
using namespace std;
using LL = long long;
void solve(){
int a, b, m;
cin >> a >> b >> m;
LL ans = 160 * 2;
if(a > b * 2){
ans += (m / b) * 160LL;
cout << ans << "\n";
return;
}
if(a >= b){
LL ans = 2;
for(int i = 0; i <= m / b; i ++){
LL res = i + 2;
res += (m - i * 1LL * b) / a * 2LL;
ans = max(ans, res);
}
cout << ans * 160 << "\n";
}
else{
LL ans = 2;
LL tot = b / a * a + (b % a == 0 ? 0 : a);
// cout << tot << "\n";
for(int i = 0; i <= m / tot; i ++){
LL res = i * (tot / a + 1) + 2;
LL sum = (m - tot * i);
// cout << i << " " << res << " " << sum << "\n";
res += sum / b * 1LL * (b / a + 1) + (sum - sum / b * b) / a;
ans = max(ans, res);
}
cout << ans * 160 << "\n";
}
}
signed main(){
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int _ = 1;
cin >> _;
while(_--){
solve();
}
}
/*
1
10 40 50
1
60 200 960
*/
这程序好像有点Bug,我给组数据试试?
詳細信息
Test #1:
score: 100
Accepted
time: 3ms
memory: 3564kb
input:
6 50 100 0 40 10 50 10 40 50 1 1 1000000 60 200 960 60 185 905
output:
320 1120 1280 320000320 3520 3360
result:
ok 6 lines
Test #2:
score: 0
Accepted
time: 2ms
memory: 3572kb
input:
10000 1 1 0 1 1 1 1 1 2 1 1 3 1 1 4 1 1 5 1 1 6 1 1 7 1 1 8 1 1 9 1 1 10 1 1 11 1 1 12 1 1 13 1 1 14 1 1 15 1 1 16 1 1 17 1 1 18 1 1 19 1 1 20 1 1 21 1 1 22 1 1 23 1 1 24 1 1 25 1 1 26 1 1 27 1 1 28 1 1 29 1 1 30 1 1 31 1 1 32 1 1 33 1 1 34 1 1 35 1 1 36 1 1 37 1 1 38 1 1 39 1 1 40 1 1 41 1 1 42 1 1...
output:
320 640 960 1280 1600 1920 2240 2560 2880 3200 3520 3840 4160 4480 4800 5120 5440 5760 6080 6400 6720 7040 7360 7680 8000 8320 8640 8960 9280 9600 9920 10240 10560 10880 11200 11520 11840 12160 12480 12800 13120 13440 13760 14080 14400 14720 15040 15360 15680 16000 320 480 800 960 1280 1440 1760 192...
result:
ok 10000 lines
Test #3:
score: 0
Accepted
time: 2ms
memory: 3576kb
input:
10000 1 1 50 1 1 51 1 1 52 1 1 53 1 1 54 1 1 55 1 1 56 1 1 57 1 1 58 1 1 59 1 1 60 1 1 61 1 1 62 1 1 63 1 1 64 1 1 65 1 1 66 1 1 67 1 1 68 1 1 69 1 1 70 1 1 71 1 1 72 1 1 73 1 1 74 1 1 75 1 1 76 1 1 77 1 1 78 1 1 79 1 1 80 1 1 81 1 1 82 1 1 83 1 1 84 1 1 85 1 1 86 1 1 87 1 1 88 1 1 89 1 1 90 1 1 91 ...
output:
16320 16640 16960 17280 17600 17920 18240 18560 18880 19200 19520 19840 20160 20480 20800 21120 21440 21760 22080 22400 22720 23040 23360 23680 24000 24320 24640 24960 25280 25600 25920 26240 26560 26880 27200 27520 27840 28160 28480 28800 29120 29440 29760 30080 30400 30720 31040 31360 31680 32000 ...
result:
ok 10000 lines
Test #4:
score: 0
Accepted
time: 3ms
memory: 3692kb
input:
10000 1 1 100 1 1 101 1 1 102 1 1 103 1 1 104 1 1 105 1 1 106 1 1 107 1 1 108 1 1 109 1 1 110 1 1 111 1 1 112 1 1 113 1 1 114 1 1 115 1 1 116 1 1 117 1 1 118 1 1 119 1 1 120 1 1 121 1 1 122 1 1 123 1 1 124 1 1 125 1 1 126 1 1 127 1 1 128 1 1 129 1 1 130 1 1 131 1 1 132 1 1 133 1 1 134 1 1 135 1 1 13...
output:
32320 32640 32960 33280 33600 33920 34240 34560 34880 35200 35520 35840 36160 36480 36800 37120 37440 37760 38080 38400 38720 39040 39360 39680 40000 40320 40640 40960 41280 41600 41920 42240 42560 42880 43200 43520 43840 44160 44480 44800 45120 45440 45760 46080 46400 46720 47040 47360 47680 48000 ...
result:
ok 10000 lines
Test #5:
score: 0
Accepted
time: 3ms
memory: 3628kb
input:
10000 1 1 150 1 1 151 1 1 152 1 1 153 1 1 154 1 1 155 1 1 156 1 1 157 1 1 158 1 1 159 1 1 160 1 1 161 1 1 162 1 1 163 1 1 164 1 1 165 1 1 166 1 1 167 1 1 168 1 1 169 1 1 170 1 1 171 1 1 172 1 1 173 1 1 174 1 1 175 1 1 176 1 1 177 1 1 178 1 1 179 1 1 180 1 1 181 1 1 182 1 1 183 1 1 184 1 1 185 1 1 18...
output:
48320 48640 48960 49280 49600 49920 50240 50560 50880 51200 51520 51840 52160 52480 52800 53120 53440 53760 54080 54400 54720 55040 55360 55680 56000 56320 56640 56960 57280 57600 57920 58240 58560 58880 59200 59520 59840 60160 60480 60800 61120 61440 61760 62080 62400 62720 63040 63360 63680 64000 ...
result:
ok 10000 lines
Test #6:
score: 0
Accepted
time: 3ms
memory: 3576kb
input:
10000 1 1 200 1 1 201 1 1 202 1 1 203 1 1 204 1 1 205 1 1 206 1 1 207 1 1 208 1 1 209 1 1 210 1 1 211 1 1 212 1 1 213 1 1 214 1 1 215 1 1 216 1 1 217 1 1 218 1 1 219 1 1 220 1 1 221 1 1 222 1 1 223 1 1 224 1 1 225 1 1 226 1 1 227 1 1 228 1 1 229 1 1 230 1 1 231 1 1 232 1 1 233 1 1 234 1 1 235 1 1 23...
output:
64320 64640 64960 65280 65600 65920 66240 66560 66880 67200 67520 67840 68160 68480 68800 69120 69440 69760 70080 70400 70720 71040 71360 71680 72000 72320 72640 72960 73280 73600 73920 74240 74560 74880 75200 75520 75840 76160 76480 76800 77120 77440 77760 78080 78400 78720 79040 79360 79680 80000 ...
result:
ok 10000 lines
Test #7:
score: 0
Accepted
time: 11ms
memory: 3632kb
input:
4471 5 3 0 5 3 1 5 3 2 5 3 3 5 3 4 5 3 5 5 3 6 5 3 7 5 3 8 5 3 9 5 3 10 5 3 11 5 3 12 5 3 13 5 3 14 5 3 15 5 3 16 5 3 17 5 3 18 5 3 19 5 3 20 5 3 21 5 3 22 5 3 23 5 3 24 5 3 25 5 3 26 5 3 27 5 3 28 5 3 29 5 3 30 5 3 31 5 3 32 5 3 33 5 3 34 5 3 35 5 3 36 5 3 37 5 3 38 5 3 39 5 3 40 5 3 41 5 3 42 5 3 ...
output:
320 320 320 480 480 640 640 640 800 800 960 960 960 1120 1120 1280 1280 1280 1440 1440 1600 1600 1600 1760 1760 1920 1920 1920 2080 2080 2240 2240 2240 2400 2400 2560 2560 2560 2720 2720 2880 2880 2880 3040 3040 3200 3200 3200 3360 3360 3520 3520 3520 3680 3680 3840 3840 3840 4000 4000 4160 4160 416...
result:
ok 4471 lines
Test #8:
score: 0
Accepted
time: 1ms
memory: 3640kb
input:
4471 7 3 0 7 3 1 7 3 2 7 3 3 7 3 4 7 3 5 7 3 6 7 3 7 7 3 8 7 3 9 7 3 10 7 3 11 7 3 12 7 3 13 7 3 14 7 3 15 7 3 16 7 3 17 7 3 18 7 3 19 7 3 20 7 3 21 7 3 22 7 3 23 7 3 24 7 3 25 7 3 26 7 3 27 7 3 28 7 3 29 7 3 30 7 3 31 7 3 32 7 3 33 7 3 34 7 3 35 7 3 36 7 3 37 7 3 38 7 3 39 7 3 40 7 3 41 7 3 42 7 3 ...
output:
320 320 320 480 480 480 640 640 640 800 800 800 960 960 960 1120 1120 1120 1280 1280 1280 1440 1440 1440 1600 1600 1600 1760 1760 1760 1920 1920 1920 2080 2080 2080 2240 2240 2240 2400 2400 2400 2560 2560 2560 2720 2720 2720 2880 2880 2880 3040 3040 3040 3200 3200 3200 3360 3360 3360 3520 3520 3520 ...
result:
ok 4471 lines
Test #9:
score: 0
Accepted
time: 11ms
memory: 3632kb
input:
4471 3 4 0 3 4 1 3 4 2 3 4 3 3 4 4 3 4 5 3 4 6 3 4 7 3 4 8 3 4 9 3 4 10 3 4 11 3 4 12 3 4 13 3 4 14 3 4 15 3 4 16 3 4 17 3 4 18 3 4 19 3 4 20 3 4 21 3 4 22 3 4 23 3 4 24 3 4 25 3 4 26 3 4 27 3 4 28 3 4 29 3 4 30 3 4 31 3 4 32 3 4 33 3 4 34 3 4 35 3 4 36 3 4 37 3 4 38 3 4 39 3 4 40 3 4 41 3 4 42 3 4 ...
output:
320 320 320 480 640 640 800 800 960 960 1120 1120 1280 1280 1440 1440 1600 1600 1760 1760 1920 1920 2080 2080 2240 2240 2400 2400 2560 2560 2720 2720 2880 2880 3040 3040 3200 3200 3360 3360 3520 3520 3680 3680 3840 3840 4000 4000 4160 4160 4320 4320 4480 4480 4640 4640 4800 4800 4960 4960 5120 5120 ...
result:
ok 4471 lines
Test #10:
score: 0
Accepted
time: 7ms
memory: 3572kb
input:
4471 5 7 0 5 7 1 5 7 2 5 7 3 5 7 4 5 7 5 5 7 6 5 7 7 5 7 8 5 7 9 5 7 10 5 7 11 5 7 12 5 7 13 5 7 14 5 7 15 5 7 16 5 7 17 5 7 18 5 7 19 5 7 20 5 7 21 5 7 22 5 7 23 5 7 24 5 7 25 5 7 26 5 7 27 5 7 28 5 7 29 5 7 30 5 7 31 5 7 32 5 7 33 5 7 34 5 7 35 5 7 36 5 7 37 5 7 38 5 7 39 5 7 40 5 7 41 5 7 42 5 7 ...
output:
320 320 320 320 320 480 480 640 640 640 800 800 800 800 960 960 960 1120 1120 1120 1280 1280 1280 1280 1440 1440 1440 1600 1600 1600 1760 1760 1760 1760 1920 1920 1920 2080 2080 2080 2240 2240 2240 2240 2400 2400 2400 2560 2560 2560 2720 2720 2720 2720 2880 2880 2880 3040 3040 3040 3200 3200 3200 32...
result:
ok 4471 lines
Test #11:
score: 0
Accepted
time: 4ms
memory: 3656kb
input:
4471 7 15 0 7 15 1 7 15 2 7 15 3 7 15 4 7 15 5 7 15 6 7 15 7 7 15 8 7 15 9 7 15 10 7 15 11 7 15 12 7 15 13 7 15 14 7 15 15 7 15 16 7 15 17 7 15 18 7 15 19 7 15 20 7 15 21 7 15 22 7 15 23 7 15 24 7 15 25 7 15 26 7 15 27 7 15 28 7 15 29 7 15 30 7 15 31 7 15 32 7 15 33 7 15 34 7 15 35 7 15 36 7 15 37 7...
output:
320 320 320 320 320 320 320 480 480 480 480 480 480 480 640 800 800 800 800 800 800 960 960 960 960 960 960 960 1120 1120 1280 1280 1280 1280 1280 1280 1440 1440 1440 1440 1440 1440 1600 1600 1600 1760 1760 1760 1760 1760 1760 1920 1920 1920 1920 1920 1920 2080 2080 2080 2240 2240 2240 2240 2240 224...
result:
ok 4471 lines
Test #12:
score: 0
Accepted
time: 3ms
memory: 3572kb
input:
4471 6 24 0 6 24 1 6 24 2 6 24 3 6 24 4 6 24 5 6 24 6 6 24 7 6 24 8 6 24 9 6 24 10 6 24 11 6 24 12 6 24 13 6 24 14 6 24 15 6 24 16 6 24 17 6 24 18 6 24 19 6 24 20 6 24 21 6 24 22 6 24 23 6 24 24 6 24 25 6 24 26 6 24 27 6 24 28 6 24 29 6 24 30 6 24 31 6 24 32 6 24 33 6 24 34 6 24 35 6 24 36 6 24 37 6...
output:
320 320 320 320 320 320 480 480 480 480 480 480 640 640 640 640 640 640 800 800 800 800 800 800 1120 1120 1120 1120 1120 1120 1280 1280 1280 1280 1280 1280 1440 1440 1440 1440 1440 1440 1600 1600 1600 1600 1600 1600 1920 1920 1920 1920 1920 1920 2080 2080 2080 2080 2080 2080 2240 2240 2240 2240 2240...
result:
ok 4471 lines
Test #13:
score: 0
Accepted
time: 2ms
memory: 3616kb
input:
10000 6 7 100 8 5 61 5 75 59 65 51 47 83 37 34 54 87 46 4 26 21 87 12 97 86 68 60 11 62 76 14 83 29 31 91 62 57 80 47 75 85 97 62 77 91 86 14 25 48 77 83 65 39 61 78 77 45 46 90 74 100 91 86 98 55 5 84 42 91 69 100 4 74 98 60 37 75 44 41 12 15 34 36 1 99 16 7 87 36 26 79 42 41 84 17 98 72 16 38 55 1...
output:
4800 2720 2080 320 320 320 1120 1600 320 1440 640 640 320 640 640 480 640 480 320 480 320 320 640 320 320 480 480 320 320 320 320 1120 640 480 1280 320 320 480 320 1280 1120 320 480 1920 320 480 320 1760 1120 320 1280 480 640 320 640 640 640 640 320 320 960 320 320 640 640 4160 1280 1280 960 800 112...
result:
ok 10000 lines
Test #14:
score: 0
Accepted
time: 1ms
memory: 3576kb
input:
1000 65 223 7831 58 236 7220 88 505 9697 67 828 4245 15 832 4221 13 619 4604 68 538 8571 66 890 772 58 823 9165 63 915 9242 12 771 8597 72 74 7578 88 729 2100 20 639 3081 14 326 2224 84 434 6660 83 154 2645 77 399 9160 80 958 7504 42 997 7747 51 99 535 13 841 8540 89 911 6301 64 928 2494 57 621 6548...
output:
24320 24640 20800 11040 46080 58080 22880 2080 27200 25120 116640 32960 4320 25600 26560 15040 7840 22400 16320 30880 2720 106880 12480 6720 20160 3040 19040 18720 16480 19840 29280 5920 18240 68160 7040 3200 13600 36320 10560 21760 30720 10400 28480 40320 2720 800 60640 8000 13920 1143360 32000 112...
result:
ok 1000 lines
Test #15:
score: 0
Accepted
time: 4ms
memory: 3624kb
input:
10 10 1 832732 1 3 522866 1 6 128429 10 9 919864 4 9 333256 3 4 553309 7 4 374556 9 4 271091 2 8 875398 8 10 379537
output:
133237440 111544960 23973600 29435840 17773920 44264960 17122880 10843840 87540000 12145440
result:
ok 10 lines
Test #16:
score: 0
Accepted
time: 1ms
memory: 3624kb
input:
10 97 96 339969 8 49 676417 24 49 374754 18 3 520864 81 39 423754 63 95 328346 97 57 641650 7 2 69638 71 91 629277 89 51 811948
output:
1121600 15461280 3671360 27779680 1738720 1251040 2116960 5571360 2213120 2919680
result:
ok 10 lines
Test #17:
score: 0
Accepted
time: 1ms
memory: 3632kb
input:
1000 352 6973 4250 9698 6537 2807 9351 7213 4446 8761 678 6543 9998 9340 6975 8041 3853 7741 5408 851 5875 7341 7659 3912 43 3040 5926 6997 9188 271 9785 206 4259 2326 1204 7610 1695 8870 2966 1298 9492 3476 4679 6598 8449 696 3487 7559 618 7359 3532 5566 1206 9898 768 884 9282 989 8545 1624 8236 52...
output:
2240 320 320 1760 320 640 1280 320 22400 320 3520 1280 480 640 640 2240 1120 1600 3520 480 480 640 960 960 320 2880 640 1440 320 3840 320 320 960 640 15680 640 640 640 800 480 1440 640 18560 480 320 480 640 320 640 1600 320 480 320 480 800 320 480 640 640 320 320 480 1440 320 800 320 480 800 1120 32...
result:
ok 1000 lines
Test #18:
score: 0
Accepted
time: 0ms
memory: 3624kb
input:
10 438056 72759 404243 221169 26025 363145 109481 793560 122317 355333 503166 896923 523400 910677 61841 513532 649927 225587 33880 233809 954983 526384 136123 343300 436283 238510 469080 986898 462601 192358
output:
1120 2400 480 800 320 320 5440 640 640 320
result:
ok 10 lines
Extra Test:
score: 0
Extra Test Passed