QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#603778 | #7797. Based Zeros | surgutti# | WA | 191ms | 3972kb | C++20 | 1.6kb | 2024-10-01 19:04:00 | 2024-10-01 19:04:01 |
Judging History
answer
// Author: Olaf Surgut (surgutti)
// Created on 01-10-2024 13:00:12
#include <bits/stdc++.h>
using namespace std;
#ifdef DEBUG
auto&operator<<(auto&o,pair<auto,auto>p){return o<<"("<<p.first<<", "<<p.second<<")";}
auto operator<<(auto&o,auto x)->decltype(x.end(),o){o<<"{";int i=0;for(auto e:x)o<<","+!i++<<e;return o<<"}";}
#define debug(X...)cerr<<"["#X"]: ",[](auto...$){((cerr<<$<<"; "),...)<<endl;}(X)
#else
#define debug(...){}
#endif
#define endl '\n'
#define st first
#define nd second
#define pb push_bask
#define sz(x) (int)(x).size()
#define all(x) (x).begin(), (x).end()
#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define ROF(i, b, a) for (int i = (b); i >= (a); i--)
#define REP(i, n) for (int i = 0; i < (n); i++)
#define int long long
signed main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int tt;
cin >> tt;
while (tt--) {
int n;
cin >> n;
vector<int> maybe;
int sq = max<int>(2, sqrt(n) - 5);
for (int i = 2; i <= 2000; i++) {
maybe.push_back(i);
maybe.push_back(sq + i);
maybe.push_back(n - 2 + i);
}
sort(all(maybe));
maybe.erase(unique(all(maybe)), maybe.end());
vector<int> ans;
int best = 0;
for (int x : maybe) if (x >= 2) {
int m = n, now = 0;
while (m > 0) {
if (m % x == 0) {
now++;
}
m /= x;
}
if (now > best) {
ans = {x};
best = now;
}
else
if (now == best) {
ans.push_back(x);
}
}
cout << best << ' ' << ans.size() << '\n';
for (int x : ans)
cout << x << ' ';
cout << '\n';
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3700kb
input:
3 11 1007 239
output:
1 3 2 3 11 2 2 3 10 1 4 2 6 15 239
result:
ok 15 numbers
Test #2:
score: 0
Accepted
time: 0ms
memory: 3956kb
input:
1 2
output:
1 1 2
result:
ok 3 number(s): "1 1 2"
Test #3:
score: 0
Accepted
time: 2ms
memory: 3672kb
input:
10 56 20 6 84 25 20 60 73 70 50
output:
3 1 2 3 1 2 1 3 2 3 6 4 1 2 2 2 2 5 3 1 2 2 2 2 3 4 1 2 4 1 2 3 1 2
result:
ok 34 numbers
Test #4:
score: 0
Accepted
time: 19ms
memory: 3904kb
input:
100 6211 4783 6225 5664 9709 5455 5424 7394 2329 3880 8260 950 2604 1366 3080 5505 4983 9595 6563 2697 2249 675 1537 5884 6070 2905 3137 5675 8138 1626 5348 8876 6065 8454 9346 3421 8857 8941 2743 9343 6201 45 1651 8575 5327 2577 4553 7595 1185 8775 7241 616 4465 3642 1657 5791 2800 1669 9307 2640 6...
output:
8 1 2 5 1 2 8 1 2 9 1 2 5 1 2 5 1 2 8 1 2 6 1 2 7 1 2 6 1 2 11 1 2 3 1 2 7 1 2 5 1 2 9 1 2 8 1 2 4 1 2 5 1 2 7 1 3 7 1 2 7 1 2 5 1 2 8 1 2 4 1 2 4 1 2 5 1 2 8 1 2 6 1 2 4 1 2 5 1 2 7 1 2 8 1 2 5 1 2 10 1 2 10 1 2 4 1 2 8 1 2 6 1 2 4 1 2 5 1 2 7 1 2 2 2 2 3 4...
result:
ok 309 numbers
Test #5:
score: 0
Accepted
time: 191ms
memory: 3740kb
input:
1000 461349 350342 809551 211152 572968 896101 718511 44614 72871 106360 141199 858436 576392 414585 897161 917037 679916 987675 507878 851589 62793 717573 119037 587678 774831 977964 313698 208868 953676 26986 273250 625834 573172 865274 105345 290197 807126 566514 193786 645978 670847 961765 72414...
output:
11 1 2 11 1 2 9 1 2 10 1 2 11 1 2 9 1 2 6 1 2 8 1 2 8 1 2 6 1 2 8 1 2 12 1 2 12 1 2 8 1 2 11 1 2 6 1 2 7 1 2 10 1 2 4 2 2 3 8 1 2 7 1 2 10 1 2 6 1 2 7 1 2 7 1 2 9 1 2 11 1 2 7 1 2 10 1 2 7 1 2 11 1 2 11 1 2 8 1 2 7 1 2 9 1 2 9 1 2 11 1 2 11 1 2 6 1 2 8 1 2 7 1...
result:
ok 3016 numbers
Test #6:
score: 0
Accepted
time: 138ms
memory: 3968kb
input:
1000 777059002 567106059 388668775 167791212 42381512 49672608 177050808 261845460 149382624 99056475 130881775 525176452 534623620 238537726 967742710 365633758 326600673 670402852 581698924 947942987 925388803 294998730 302063477 209655322 871274865 966051641 105266482 685127231 675409437 29302600...
output:
13 1 2 16 1 2 12 1 2 19 1 2 16 1 2 12 1 2 15 1 2 11 2 2 3 14 1 2 8 1 2 10 1 2 14 1 2 11 1 2 8 1 2 12 1 2 14 1 2 12 1 2 15 1 2 18 1 2 17 1 2 19 1 2 16 1 2 16 1 2 13 1 2 12 1 2 14 1 2 14 1 2 13 1 2 16 1 2 10 1 2 14 1 2 16 1 2 13 1 2 13 1 2 15 1 2 14 1 2 14 1 2 13 1...
result:
ok 3004 numbers
Test #7:
score: 0
Accepted
time: 143ms
memory: 3764kb
input:
1000 279846554360 412045752288 342314468812 980743511493 147529260079 909385413888 9636990671 164548629171 115893886661 895700506608 125295918330 957773182610 770786835718 872163538712 414411444790 224773301658 292973214787 413597032696 791272938821 692413707694 335697403673 946050452282 23425062727...
output:
23 1 2 12 1 2 20 1 2 18 1 2 17 1 2 22 1 2 14 1 2 16 1 2 15 1 2 20 1 2 13 1 2 12 1 2 17 1 2 18 1 2 20 1 2 21 1 2 23 1 2 22 1 2 19 1 2 20 1 2 17 1 2 24 1 2 19 1 2 15 1 2 23 1 2 17 1 2 16 1 2 15 1 2 18 1 2 17 1 2 16 1 2 18 1 2 11 1 2 15 1 2 14 1 2 18 1 2 24 1 2 20 1...
result:
ok 3000 numbers
Test #8:
score: 0
Accepted
time: 153ms
memory: 3652kb
input:
1000 21626098135324 362066820213913 903245463366728 767979280848578 943350043731730 766006854598939 906271674193425 241098338151007 529216400439268 527684685791751 344810587233633 482106213944703 779288647429689 654884279036436 641224195307472 76645831298843 718949620066867 317730034362120 968762933...
output:
20 1 2 31 1 2 22 1 2 24 1 2 26 1 2 22 1 2 24 1 2 22 1 2 22 1 2 27 1 2 26 1 2 22 1 2 28 1 2 30 1 2 27 1 2 20 1 2 27 1 2 28 1 2 25 1 2 25 1 2 23 1 2 26 1 2 24 1 2 27 1 2 22 1 2 18 1 2 18 1 2 19 1 2 22 1 2 24 1 2 20 1 2 28 1 2 19 1 2 30 1 2 25 1 2 25 1 2 23 1 2 21 1...
result:
ok 3000 numbers
Test #9:
score: 0
Accepted
time: 156ms
memory: 3716kb
input:
1000 649146224195270358 537375873092588506 353240286745598313 757106643795373130 108739720703384089 77261839685307602 834545739369686296 770713958523995317 760140402370150400 49040205175170572 528159421818118348 190796248318634900 439926746082022255 341870645228287665 957088889949442371 193821093331...
output:
31 1 2 31 1 2 28 1 2 35 1 2 37 1 2 27 1 2 28 1 2 40 1 2 38 1 2 29 1 2 33 1 2 31 1 2 25 1 2 25 1 2 34 1 2 26 1 2 29 1 2 29 1 2 25 1 2 27 1 2 28 1 2 29 1 2 25 1 2 27 1 2 27 1 2 29 1 2 30 1 2 27 1 2 32 1 2 25 1 2 28 1 2 30 1 2 29 1 2 28 1 2 18 1 2 31 1 2 29 1 2 27 1...
result:
ok 3000 numbers
Test #10:
score: 0
Accepted
time: 162ms
memory: 3660kb
input:
1000 734186046517055256 165084007156625592 695422127422996908 685293070795327350 764057744212502744 196178700179523314 296662551094725660 661256240068125746 746188231866195473 773477966087011552 635909464109027109 613473160655768595 999391693262114068 759471734621897990 436930535877751376 1246315786...
output:
34 1 2 30 1 2 29 1 2 30 1 2 29 1 2 26 1 2 34 1 2 32 1 2 25 1 2 29 1 2 32 1 2 30 1 2 28 1 2 34 1 2 38 1 2 22 1 2 33 1 2 33 1 2 28 1 2 29 1 2 30 1 2 33 1 2 34 1 2 26 1 2 24 1 2 32 1 2 28 1 2 29 1 2 33 1 2 27 1 2 38 1 2 26 1 2 35 1 2 32 1 2 26 1 2 33 1 2 29 1 2 31 1...
result:
ok 3000 numbers
Test #11:
score: 0
Accepted
time: 161ms
memory: 3760kb
input:
1000 901200459137203037 678224965966700400 932486108644871288 961482466817641206 991527271642621456 210964052892617534 745560256820374720 497194876946615859 722309708053462640 626344722999754976 994855591433313181 386551877205110888 935004151629090204 287237917737732798 225425762226139679 7169834313...
output:
29 1 2 30 1 2 27 1 2 23 1 2 29 1 2 27 1 2 32 1 2 32 1 2 30 1 2 37 1 2 24 1 2 35 1 2 28 1 2 23 1 2 28 1 2 28 1 2 33 1 2 27 1 2 29 1 2 25 1 2 28 1 2 29 1 2 25 1 2 26 1 2 29 1 2 26 1 2 29 1 2 27 1 2 32 1 2 30 1 2 28 1 2 31 1 2 23 1 2 29 1 2 26 1 2 33 1 2 29 1 2 24 1...
result:
ok 3000 numbers
Test #12:
score: 0
Accepted
time: 162ms
memory: 3972kb
input:
1000 468214871757350817 714737957336583707 946178057306937168 737671862839955061 595624766512931666 425749405605711754 617829995105832279 909761476970330176 498431179945762512 802583516767274198 330429681902823456 459630598049420479 870616614291033636 615004100853567607 974480810622749088 7262199457...
output:
21 1 2 33 1 2 31 1 2 31 1 2 35 1 2 32 1 2 26 1 2 36 1 2 31 1 2 27 1 2 39 1 2 23 1 2 32 1 2 31 1 2 35 1 2 32 1 2 31 1 2 29 1 2 34 1 2 26 1 2 32 1 2 32 1 2 36 1 2 23 1 2 30 1 2 36 1 2 25 1 2 35 1 2 25 1 2 24 1 2 33 1 2 36 1 2 31 1 2 27 1 2 28 1 2 30 1 2 30 1 2 27 1...
result:
ok 3000 numbers
Test #13:
score: 0
Accepted
time: 160ms
memory: 3832kb
input:
1000 858601321232274393 727878911851691218 583242038528811547 913861254567301620 999722261383241879 840534758318805974 890099741981224430 545700118143787583 897924688692838177 555450273680017624 889375809227109526 756081351453538567 806229072658009773 542770292559337006 454941972865086783 8168811479...
output:
26 1 2 31 1 2 34 1 2 27 1 2 26 1 2 27 1 2 23 1 2 21 1 2 27 1 2 28 1 2 29 1 2 23 1 2 28 1 2 32 1 2 30 1 2 33 1 2 29 1 2 31 1 2 20 1 2 22 1 2 36 1 2 31 1 2 29 1 2 26 1 2 27 1 2 33 1 2 30 1 2 28 1 2 37 1 2 32 1 2 27 1 2 32 1 2 25 1 2 27 1 2 24 1 2 22 1 2 35 1 2 35 1...
result:
ok 3000 numbers
Test #14:
score: 0
Accepted
time: 159ms
memory: 3676kb
input:
1000 525615733852422174 841019866366798731 520306019750685926 990050650589615474 827191793108327881 955320111031900193 638997447706873492 958266713872534605 674046160585138046 931689067447536844 824949899696619803 529160068002880860 741841535319953205 947164438820396022 512031089662714094 7044362717...
output:
33 1 2 22 1 2 24 1 2 27 1 2 26 1 2 31 1 2 31 1 2 30 1 2 25 1 2 34 1 2 33 1 2 27 1 2 33 1 2 29 1 2 31 1 2 26 1 2 37 1 2 27 1 2 28 1 2 30 1 2 26 1 2 35 1 2 27 1 2 28 1 2 31 1 2 31 1 2 31 1 2 31 1 2 31 1 2 26 1 2 31 1 2 30 1 2 32 1 2 24 1 2 26 1 2 28 1 2 29 1 2 31 1...
result:
ok 3000 numbers
Test #15:
score: 0
Accepted
time: 158ms
memory: 3908kb
input:
1000 792630146472569957 754160816586938948 657370005267527598 866240046611929326 631289283683670795 670105468039961706 611267185992331048 970833313896248925 650167632477437915 907927861215056060 783896027020905867 702238788847190451 677453993686929341 774930626231198123 792492251905051786 6052304553...
output:
22 1 2 33 1 2 24 1 2 33 1 2 35 1 2 31 1 2 29 1 2 26 1 2 31 1 2 31 1 2 29 1 2 26 1 2 29 1 2 31 1 2 29 1 2 28 1 2 32 1 2 25 1 2 26 1 2 27 1 2 34 1 2 31 1 2 24 1 2 27 1 2 29 1 2 31 1 2 30 1 2 27 1 2 24 1 2 33 1 2 31 1 2 31 1 2 34 1 2 30 1 2 30 1 2 33 1 2 29 1 2 29 1...
result:
ok 3000 numbers
Test #16:
score: 0
Accepted
time: 159ms
memory: 3756kb
input:
1000 983016595947493522 990673807956822242 994433986489401970 842429438339275879 935386774259013712 884890820753055923 883536928572755895 806771955069706324 826289112959672377 860794622422766788 919470121785383441 975317505396532749 702696809347032922 849581372997646397 806024638905570225 7433556794...
output:
36 1 2 29 1 2 32 1 2 29 1 2 31 1 2 28 1 2 29 1 2 33 1 2 30 1 2 31 1 2 34 1 2 36 1 2 30 1 2 32 1 2 27 1 2 31 1 2 28 1 2 25 1 2 36 1 2 31 1 2 32 1 2 24 1 2 25 1 2 29 1 2 28 1 2 31 1 2 29 1 2 33 1 2 37 1 2 37 1 2 23 1 2 32 1 2 28 1 2 28 1 2 24 1 2 30 1 2 30 1 2 32 1...
result:
ok 3000 numbers
Test #17:
score: 0
Accepted
time: 154ms
memory: 3896kb
input:
1000 950031004272674007 803814766766897046 908125935151467863 818618830066622424 839484269129323929 899676173466150133 932434638593372261 819338555093420647 802410584851972244 837033416190285996 878416244814702193 871768263095618110 972050955865591970 807090959903059244 930042530945016779 8068188181...
output:
29 1 2 28 1 2 32 1 2 29 1 2 22 1 2 30 1 2 34 1 2 34 1 2 34 1 2 27 1 2 30 1 2 35 1 2 27 1 2 25 1 2 29 1 2 30 1 2 25 1 2 23 1 2 30 1 2 35 1 2 22 1 2 35 1 2 37 1 2 22 1 2 35 1 2 33 1 2 28 1 2 26 1 2 31 1 2 25 1 2 23 1 2 29 1 2 30 1 2 32 1 2 25 1 2 35 1 2 33 1 2 31 1...
result:
ok 3001 numbers
Test #18:
score: 0
Accepted
time: 160ms
memory: 3756kb
input:
1000 917045416892821794 916955721282004552 945189916373342221 994808226088936235 966953800854409879 914461530474211617 904704376878829784 955277191971910709 978532056744272107 913272209957805169 913990335284212463 944846979644960393 907663418527535358 934857147313861324 987131652037611393 9076130060...
output:
24 1 2 29 1 2 27 1 2 26 1 2 28 1 2 30 1 2 32 1 2 31 1 2 30 1 2 30 1 2 27 1 2 30 1 2 28 1 2 28 1 2 27 1 2 29 1 2 28 1 2 31 1 2 30 1 2 36 1 2 32 1 2 35 1 2 34 1 2 24 1 2 30 1 2 20 1 2 28 1 2 33 1 2 30 1 2 23 1 2 33 1 2 31 1 2 27 1 2 34 1 2 30 1 2 34 1 2 26 1 2 23 1...
result:
ok 3001 numbers
Test #19:
score: 0
Accepted
time: 158ms
memory: 3656kb
input:
1000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 100000000000000...
output:
36 1 2 36 1 2 36 1 2 36 1 2 36 1 2 36 1 2 36 1 2 36 1 2 36 1 2 36 1 2 36 1 2 36 1 2 36 1 2 36 1 2 36 1 2 36 1 2 36 1 2 36 1 2 36 1 2 36 1 2 36 1 2 36 1 2 36 1 2 36 1 2 36 1 2 36 1 2 36 1 2 36 1 2 36 1 2 36 1 2 36 1 2 36 1 2 36 1 2 36 1 2 36 1 2 36 1 2 36 1 2 36 1...
result:
ok 3000 numbers
Test #20:
score: -100
Wrong Answer
time: 137ms
memory: 3760kb
input:
1000 16760831 16760831 16760831 16760831 16760831 16760831 16760831 16760831 16760831 16760831 16760831 16760831 16760831 16760831 16760831 16760831 16760831 16760831 16760831 16760831 16760831 16760831 16760831 16760831 16760831 16760831 16760831 16760831 16760831 16760831 16760831 16760831 1676083...
output:
1 16 2 3 10 11 19 31 33 91 123 137 182 203 239 692 4541 16760831 1 16 2 3 10 11 19 31 33 91 123 137 182 203 239 692 4541 16760831 1 16 2 3 10 11 19 31 33 91 123 137 182 203 239 692 4541 16760831 1 16 2 3 10 11 19 31 33 91 123 137 182 203 239 692 4541 16760831 1 16 2 3 10 11 19 31 33 91 123 137 1...
result:
wrong answer 2nd numbers differ - expected: '19', found: '16'