QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#709557 | #8410. Splatanie ciągów [A] | liuziao | 0 | 0ms | 3608kb | C++23 | 891b | 2024-11-04 15:27:14 | 2024-11-04 15:27:15 |
answer
#include <bits/stdc++.h>
#define int int64_t
int h, w, n;
int a[35];
void dickdreamer() {
std::cin >> h >> w >> n;
for (int i = 1; i <= n; ++i) std::cin >> a[i];
if (h % a[1] != 0 || w % a[1] != 0) return void(std::cout << "-1\n");
int ans = 0;
for (int i = 1; i <= n; ++i) {
h /= a[i], w /= a[i];
for (int j = i + 1; j <= n; ++j) a[j] /= a[i];
a[i] = 1;
if (i == n) {
ans += h * w;
} else {
ans += h * w - (h / a[i + 1] * a[i + 1]) * (w / a[i + 1] * a[i + 1]);
}
}
std::cout << ans << '\n';
}
int32_t main() {
#ifdef ORZXKR
freopen("in.txt", "r", stdin);
freopen("out.txt", "w", stdout);
#endif
std::ios::sync_with_stdio(0), std::cin.tie(0), std::cout.tie(0);
int T = 1;
// std::cin >> T;
while (T--) dickdreamer();
// std::cerr << 1.0 * clock() / CLOCKS_PER_SEC << "s\n";
return 0;
}
详细
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3608kb
input:
1 1 1 2
output:
-1
result:
wrong answer 1st lines differ - expected: '0 1', found: '-1'
Subtask #2:
score: 0
Wrong Answer
Test #10:
score: 0
Wrong Answer
time: 0ms
memory: 3556kb
input:
30 30 21 60 56 26 50 1 4 52 51 58 34 13 54 59 7 28 33 46 18 39 43 37 32 36 19 25 30 16 38 55 45 23 48 40 2 17 29 27 57 53 12 6 49 15 3 31 9 5 20 44 47 24 11 22 10 42 41 35 8 14
output:
-1
result:
wrong answer 1st lines differ - expected: '0 149064 63399 3762 0 0 0 0 0 ...0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0', found: '-1'
Subtask #3:
score: 0
Wrong Answer
Test #21:
score: 0
Wrong Answer
time: 0ms
memory: 3544kb
input:
100 100 3 185 115 158 149 111 166 94 76 141 167 193 49 11 95 99 97 89 191 98 32 8 20 170 179 63 190 50 4 16 70 75 169 125 178 198 5 71 30 12 128 6 107 62 90 116 39 173 133 31 139 162 144 195 28 160 23 53 55 78 182 153 114 157 46 92 188 43 177 192 124 150 79 146 80 102 7 77 18 82 165 17 15 197 119 14...
output:
-1
result:
wrong answer 1st lines differ - expected: '0 16086875 8174944 1124681 116...0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0', found: '-1'
Subtask #4:
score: 0
Wrong Answer
Test #32:
score: 0
Wrong Answer
time: 0ms
memory: 3552kb
input:
300 300 97 322 293 313 283 13 27 353 474 32 562 75 10 317 136 482 81 309 584 138 437 48 159 339 334 356 526 357 1 352 235 242 456 461 219 66 436 565 559 284 112 20 111 23 384 51 514 134 462 124 400 261 216 76 171 202 239 238 333 179 545 527 407 539 418 588 248 440 427 376 549 15 411 355 299 365 9 12...
output:
-1
result:
wrong answer 1st lines differ - expected: '0 264114717 638832402 11062902...0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0', found: '-1'
Subtask #5:
score: 0
Runtime Error
Test #43:
score: 0
Runtime Error
input:
2000 2000 762 3148 1563 2539 1799 983 3993 1082 2912 3178 1908 2990 16 886 2973 823 913 243 357 850 2486 1588 2649 1893 1634 3691 150 996 3789 2922 2393 577 2316 924 3674 3636 910 2406 1483 1212 579 2442 1875 918 2039 928 2009 920 462 3898 1764 1592 1220 3893 1602 772 3485 1640 1940 2409 994 3201 62...
output:
result:
Subtask #6:
score: 0
Runtime Error
Test #55:
score: 0
Runtime Error
input:
8000 8000 7244 4104 4116 4733 1865 12849 14465 11794 1095 7219 5206 2781 11617 6866 9595 11983 14469 13258 2346 10847 5429 3414 4293 15825 10314 9643 14412 9550 6406 7816 13719 15736 5333 15692 12756 4329 2709 5284 5261 1707 11238 4301 13797 2131 12768 7126 9864 3229 3785 4314 8719 1117 646 8153 111...
output:
result:
Subtask #7:
score: 0
Runtime Error
Test #68:
score: 0
Runtime Error
input:
70000 70000 65040 83209 46810 43228 58294 97341 24577 26778 64585 34392 121492 59033 52566 63751 20036 135689 72762 109553 67967 51787 107523 120416 95354 49900 60667 110736 115814 16626 34683 37257 119483 91814 68147 131865 33293 114111 65264 122197 57479 111482 75492 84033 133075 73321 7539 47697 ...
output:
result:
Subtask #8:
score: 0
Runtime Error
Test #82:
score: 0
Runtime Error
input:
150000 150000 58983 100778 109945 294477 253435 1447 4311 110912 171122 212851 165373 102223 98625 274188 43059 196284 13184 232675 189091 37409 150201 227081 221065 161136 37343 47901 56955 197030 149843 137335 85230 291418 55155 84454 284046 96806 7342 94155 189355 60618 87506 281679 180207 125356...
output:
result:
Subtask #9:
score: 0
Runtime Error
Test #97:
score: 0
Runtime Error
input:
230000 230000 53349 24839 147164 179787 169500 138524 104308 71283 404918 183895 337401 419461 119619 389931 304997 360563 177306 435849 94845 192364 358356 159738 442086 88126 354608 167743 320160 221916 402274 207329 178240 316555 328700 13950 214332 286314 232082 56917 406912 123163 219788 153687...
output:
result:
Subtask #10:
score: 0
Runtime Error
Test #112:
score: 0
Runtime Error
input:
300000 300000 416773 186118 31247 38672 389294 339767 320108 250609 228574 232436 344414 316497 334835 318936 3172 393368 210300 145194 50617 423649 504469 6918 54400 485308 99748 556889 171790 488017 290307 560629 126324 57741 457051 257487 336091 524134 571207 573790 18672 361275 414336 343166 314...