QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#475208 | #9129. Quotient Sum | ucup-team4352# | WA | 30ms | 5268kb | C++23 | 602b | 2024-07-13 13:14:30 | 2024-07-13 13:14:30 |
Judging History
answer
#include<bits/stdc++.h>
#define ll long long
#define pii pair<int,int>
#define lowbit(x) (x&-x)
#define inf 2000000000
#define log(x) (31^__builtin_clz(x))
using namespace std;
ll a[200005];
const ll qp18=1e18;
void solve(){
int n;
cin>>n;
ll ans=0;
for(int i=1;i<=n;i++){
cin>>a[i];
}
sort(a+1,a+n+1);
int nxt=1;
for(int i=1;i<n;){
nxt=i+1;
while(nxt<n&&a[nxt]/a[i]==a[nxt+1]/a[i])nxt++;
ans+=a[nxt]/a[i];
i=nxt;
}
cout<<ans<<"\n";
}
int main(){
ios::sync_with_stdio(0), cin.tie(0);
int t=1;
//cin>>t;
while(t--)solve();
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3612kb
input:
3 2 3 6
output:
3
result:
ok "3"
Test #2:
score: 0
Accepted
time: 0ms
memory: 3604kb
input:
2 15 4
output:
3
result:
ok "3"
Test #3:
score: 0
Accepted
time: 0ms
memory: 3540kb
input:
9 284791808 107902 13660981249408 4622332661 13405199 24590921 361 244448137 16077087227955422
output:
4580
result:
ok "4580"
Test #4:
score: 0
Accepted
time: 0ms
memory: 3704kb
input:
9 12 9 5 17 2 6 7 1 15
output:
6
result:
ok "6"
Test #5:
score: 0
Accepted
time: 0ms
memory: 3612kb
input:
10 19 13 18 11 20 16 6 8 17 3
output:
4
result:
ok "4"
Test #6:
score: 0
Accepted
time: 0ms
memory: 3628kb
input:
8 5 7 11 16 2 15 1 20
output:
7
result:
ok "7"
Test #7:
score: 0
Accepted
time: 0ms
memory: 3560kb
input:
10 13 2 19 11 15 9 16 5 12 1
output:
7
result:
ok "7"
Test #8:
score: 0
Accepted
time: 0ms
memory: 3576kb
input:
8 9 1 14 11 3 12 8 20
output:
7
result:
ok "7"
Test #9:
score: 0
Accepted
time: 0ms
memory: 3552kb
input:
4 4 6 20 3
output:
5
result:
ok "5"
Test #10:
score: 0
Accepted
time: 0ms
memory: 3624kb
input:
382 1495 1297 1197 976 1335 486 1850 992 1483 1269 1898 1593 237 1342 711 957 1992 1401 1413 206 917 1831 1444 698 1291 1987 231 1559 1119 1822 1790 471 736 496 1157 1886 1974 699 1702 321 325 758 683 1826 1051 95 632 456 1224 1590 1394 1854 1226 1963 1926 1819 989 34 980 371 535 807 1541 144 433 12...
output:
11
result:
ok "11"
Test #11:
score: 0
Accepted
time: 0ms
memory: 3620kb
input:
317 1565 1374 387 1215 766 1670 862 673 1391 70 727 152 182 26 1111 1430 64 1318 349 994 780 1762 1993 552 715 1943 967 972 1039 646 617 1822 373 486 1863 1179 1840 1781 1963 220 773 671 126 613 719 1660 334 1851 65 707 1862 490 1466 1590 1717 1723 656 1526 1138 31 1976 1823 1335 1719 397 612 593 13...
output:
8
result:
ok "8"
Test #12:
score: 0
Accepted
time: 0ms
memory: 3556kb
input:
100 1070 947 7 1735 476 1172 995 2000 536 15 1499 656 1810 1435 639 1647 61 630 4 754 1594 442 1644 1743 5 629 1879 1707 1174 1984 1526 1829 1449 783 1483 1734 1032 494 537 1872 1117 1316 1069 780 520 689 31 1970 1653 1071 251 360 1063 988 1154 638 547 525 264 495 273 436 967 633 462 1863 164 402 18...
output:
12
result:
ok "12"
Test #13:
score: 0
Accepted
time: 0ms
memory: 3632kb
input:
495 368 27 1415 966 351 1575 449 1982 15 1207 1806 1483 1304 1488 750 1751 1047 314 1833 1365 1281 589 1062 419 1430 345 41 230 1248 11 338 1139 1146 1892 281 1994 950 26 1247 817 1250 131 1954 631 1020 1705 382 220 172 1434 1841 1866 849 793 1236 53 1275 1366 1038 1889 615 1652 218 1862 84 377 76 1...
output:
19
result:
ok "19"
Test #14:
score: 0
Accepted
time: 0ms
memory: 3648kb
input:
452 1711 258 865 1330 1923 4 1656 652 1660 1768 603 1841 646 1810 1235 200 503 1083 418 511 1803 886 54 213 1914 734 1531 1941 272 1686 1873 1831 1367 1746 141 404 1538 989 768 1830 1684 426 527 1872 1105 1655 540 1444 331 767 1896 49 1141 921 772 307 614 764 848 1997 1406 339 63 828 416 1891 1925 6...
output:
11
result:
ok "11"
Test #15:
score: 0
Accepted
time: 0ms
memory: 3648kb
input:
61 320 456 426 201 1105 1894 570 661 1307 618 956 1185 1241 6 574 1236 604 462 1900 1488 697 1688 1085 775 635 747 1252 1721 431 192 768 1798 1712 686 1496 932 1309 1431 904 1467 1863 804 856 1682 1159 78 1276 211 942 848 270 225 117 302 1418 1951 534 1345 591 110 1967
output:
19
result:
ok "19"
Test #16:
score: 0
Accepted
time: 0ms
memory: 3676kb
input:
6007 926195740081456592 954460021832145143 601395744686943902 21575530228356921 463431657670752021 711276919720293649 916086948281828983 942717046975828490 627872019769751663 375556646744053894 531095909932455304 993855300776486066 208335586285140634 319193845177757965 985795314563730251 10507706789...
output:
12
result:
ok "12"
Test #17:
score: 0
Accepted
time: 1ms
memory: 3684kb
input:
8261 284791808 107902 13660981249408 4622332661 13405199 24590921 361 244448137 16077087227955422 29020 2999 243823 11405 3084850839644 51410 1293 598217528 6419212814 19670 42431 16305842936592 588083868939790 35416223344083524 1670928183457 462015428 19431 7573789315 819 4594126473685 8554104 1422...
output:
63
result:
ok "63"
Test #18:
score: 0
Accepted
time: 1ms
memory: 3668kb
input:
6015 358871240359366151 224257618022883235 172819476860570817 75125953034362365 824984506523526062 988848382335902687 898522089822105149 755567463105677238 970409760639198928 430709898290812041 779827111538256956 857511190324448260 329465323773300663 685019732014997951 197724427289098867 15126091335...
output:
14
result:
ok "14"
Test #19:
score: 0
Accepted
time: 1ms
memory: 3656kb
input:
2319 7 769 14566 213732121851657504 3031249 117432 1853 43404611161 2137819942 2525662612281 575 628859144901512192 82402637244386 570993657677445760 244 540730562 190876 146904 11282 2881663495750947 36247 410727237 100465424998099 48557284 334485561776644672 1611191 191632019669065056 203 2122865 ...
output:
64
result:
ok "64"
Test #20:
score: 0
Accepted
time: 1ms
memory: 3716kb
input:
3647 191274254202747070 816451465136605666 632954453162088720 316484101993458936 400530481203520131 36361261508615425 107377728836074713 479766874026239333 132490733793819615 701342570200191348 393529093120808255 997930221798392349 37262148109322604 236346409115411 445572155956552286 578658600443172...
output:
15
result:
ok "15"
Test #21:
score: 0
Accepted
time: 1ms
memory: 3644kb
input:
2459 1418053410414 637622553455 1470 1931006024625 27526276968 4967139053 521674647989055 186443981371189 39480756299336 95680188183 2727948481 557901603 11423 10709859272749 242760849 307283093727562688 42213 3181 518822290138407936 1532145441957570 40684208181105 254735022780282 56 58 5905 166 193...
output:
63
result:
ok "63"
Test #22:
score: 0
Accepted
time: 15ms
memory: 4580kb
input:
113844 462209310844307827 895186606000026911 536883699910050004 923768182795407203 116843726498620270 837342622857072639 5401336272754811 956408591677017253 644988425043116019 643246228819184945 544277427880226394 694401128212891523 352892254813391858 739821579965916396 991683818573040504 7744776087...
output:
16
result:
ok "16"
Test #23:
score: 0
Accepted
time: 29ms
memory: 5096kb
input:
194435 2691485 412893522790905728 14698764318 223230348450 79466646146 106916997248562 668789825 15651263346034818 6602164367069652 7736843382176793 398591166927295 21282612274422 12609786010 463 73237470025259248 1756698204 17854370570384 364588 13045 1165416117509 22557532638431 28889662774652 649...
output:
62
result:
ok "62"
Test #24:
score: 0
Accepted
time: 5ms
memory: 3852kb
input:
28233 492525631319916156 711072765816623886 459232417094360150 178798507591150604 353974036315601613 194110040523143355 505141911910923391 664035751438995680 165712677460360109 173043053636817457 846663981201087731 374037523526255941 615493493779455262 402943770653209584 177780263822236862 587639656...
output:
19
result:
ok "19"
Test #25:
score: 0
Accepted
time: 14ms
memory: 4460kb
input:
95668 3858000880 60795117 38235057004215 298098951 64314296133179 18833904350356 120770850925 2774944191269 255141101 4154206501543 21211992074 2182387455404017 1081676 363628 100215812 2894 4715142770132 3907947523860996 14800803990578786 1539665 336976382981 346697971791917 14189195 1223709102 125...
output:
62
result:
ok "62"
Test #26:
score: 0
Accepted
time: 23ms
memory: 4644kb
input:
138737 344080383853530510 506164534912392073 139977616575079622 514052853498838453 152764635074458728 832083649720388173 993219396611857398 879660925480156303 453759956308175743 160600829699596235 323853232622454230 723843069506245926 575269759636569718 168343487411019088 838968602347042497 57119631...
output:
22
result:
ok "22"
Test #27:
score: 0
Accepted
time: 15ms
memory: 4392kb
input:
100166 1151157553 836591449264925312 313948 2676928393605 13001634471019 99365359359285008 769801072 697627803298476 191573 113952 845016 127215 11816661249 1354142147467898 457548 38436728826913 653 1401486 180932188831607 392180 225912447 52306519486088240 107369540422594 273624 1554040 370171615 ...
output:
62
result:
ok "62"
Test #28:
score: 0
Accepted
time: 30ms
memory: 5112kb
input:
200000 920958999654769887 44652757342146560 588489988140055764 699663983847393136 315612138966758196 363575024892322674 672781839441013508 88936379681887294 804875024546631171 658554778695822095 286444958264530140 23178858151405656 799137576073800100 663360499806895180 970593772223770261 59102126259...
output:
18
result:
ok "18"
Test #29:
score: 0
Accepted
time: 30ms
memory: 5176kb
input:
200000 174039034751809 3913449945 1231151041349148 1716357008 387750331009 265833 2128290757998 1581879 6554637 10528531 825870 54581638747659 61324040385337 73724654248641 2437818 2432559052495 1157877982 21743686292271 2608906738 17773353689 1340616779510480 212791991 6356509296744 27163067 371427...
output:
62
result:
ok "62"
Test #30:
score: 0
Accepted
time: 29ms
memory: 5120kb
input:
200000 608206876488013963 765742835263016526 404552338643357901 106165943051038032 661019497372534691 826671466097675376 154008041242843652 349350716523790060 114843035991741400 923861710816630325 502676115113668896 370704897782885594 937730204337141988 341874145536678500 893689026695611024 36360588...
output:
19
result:
ok "19"
Test #31:
score: 0
Accepted
time: 30ms
memory: 5192kb
input:
200000 147868401596385856 216988611781312 3142577822912 15277293516341 117746406342738 256984283219 564300524272028224 733656753 48331071205 455402217 6028756 12485 33225 271076 119063025316758624 9358818030569930 924666 492150932707103040 203341335439014 4385930676651 27248614129 14439049 186662971...
output:
62
result:
ok "62"
Test #32:
score: 0
Accepted
time: 29ms
memory: 5208kb
input:
200000 951721177876293159 170996162850303371 799238425724097973 477741534830539723 995930401206693919 657374179590985166 329086821700411311 609454572273843502 54543294048485422 819305692977092597 596293161077766507 894898386836465941 68509791070187014 364976989437807875 523648367694886346 7725358029...
output:
18
result:
ok "18"
Test #33:
score: 0
Accepted
time: 30ms
memory: 5116kb
input:
200000 935075 5200293 660465 12624 287192907 760535865 23881028 79277607409072560 90163533257784 345142177 3989 12145088 415115636533749248 1496354690718777 125569825487850 325525721 895741 35120072566556 30876357000311232 7442 57056874945 15011529 890928819587 11137912789 99883451555613712 26285956...
output:
62
result:
ok "62"
Test #34:
score: 0
Accepted
time: 10ms
memory: 5204kb
input:
200000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 1...
output:
20
result:
ok "20"
Test #35:
score: 0
Accepted
time: 13ms
memory: 5176kb
input:
200000 200000 200001 200002 200003 200004 200005 200006 200007 200008 200009 200010 200011 200012 200013 200014 200015 200016 200017 200018 200019 200020 200021 200022 200023 200024 200025 200026 200027 200028 200029 200030 200031 200032 200033 200034 200035 200036 200037 200038 200039 200040 200041...
output:
1
result:
ok "1"
Test #36:
score: 0
Accepted
time: 9ms
memory: 5144kb
input:
200000 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 2...
output:
10
result:
ok "10"
Test #37:
score: 0
Accepted
time: 13ms
memory: 5124kb
input:
200000 191759 191760 191761 191762 191763 191764 191765 191766 191767 191768 191769 191770 191771 191772 191773 191774 191775 191776 191777 191778 191779 191780 191781 191782 191783 191784 191785 191786 191787 191788 191789 191790 191791 191792 191793 191794 191795 191796 191797 191798 191799 191800...
output:
2
result:
ok "2"
Test #38:
score: 0
Accepted
time: 9ms
memory: 5268kb
input:
200000 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 2...
output:
11
result:
ok "11"
Test #39:
score: 0
Accepted
time: 13ms
memory: 5116kb
input:
200000 114853 114854 114855 114856 114857 114858 114859 114860 114861 114862 114863 114864 114865 114866 114867 114868 114869 114870 114871 114872 114873 114874 114875 114876 114877 114878 114879 114880 114881 114882 114883 114884 114885 114886 114887 114888 114889 114890 114891 114892 114893 114894...
output:
2
result:
ok "2"
Test #40:
score: 0
Accepted
time: 0ms
memory: 3624kb
input:
2 1 1000000000000000000
output:
1000000000000000000
result:
ok "1000000000000000000"
Test #41:
score: 0
Accepted
time: 23ms
memory: 5176kb
input:
200000 1 999999999999800002 999999999999800003 999999999999800004 999999999999800005 999999999999800006 999999999999800007 999999999999800008 999999999999800009 999999999999800010 999999999999800011 999999999999800012 999999999999800013 999999999999800014 999999999999800015 999999999999800016 999999...
output:
999999999999800003
result:
ok "999999999999800003"
Test #42:
score: -100
Wrong Answer
time: 17ms
memory: 5172kb
input:
200000 3 4 16 17 18 19 20 21 22 23 24 25 26 27 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 2...
output:
121
result:
wrong answer 1st words differ - expected: '119', found: '121'