Task: | Hacking hashes |
Sender: | aalto2024l_006 |
Submission time: | 2024-11-20 17:49:22 +0200 |
Language: | C++ (C++17) |
Status: | READY |
Result: | ACCEPTED |
test | verdict | time | |
---|---|---|---|
#1 | ACCEPTED | 0.00 s | details |
#2 | ACCEPTED | 0.00 s | details |
#3 | ACCEPTED | 0.00 s | details |
#4 | ACCEPTED | 0.00 s | details |
#5 | ACCEPTED | 0.00 s | details |
#6 | ACCEPTED | 0.00 s | details |
#7 | ACCEPTED | 0.00 s | details |
#8 | ACCEPTED | 0.00 s | details |
#9 | ACCEPTED | 0.00 s | details |
#10 | ACCEPTED | 0.00 s | details |
#11 | ACCEPTED | 0.00 s | details |
#12 | ACCEPTED | 0.00 s | details |
#13 | ACCEPTED | 0.00 s | details |
#14 | ACCEPTED | 0.00 s | details |
#15 | ACCEPTED | 0.00 s | details |
#16 | ACCEPTED | 0.00 s | details |
#17 | ACCEPTED | 0.00 s | details |
#18 | ACCEPTED | 0.00 s | details |
#19 | ACCEPTED | 0.00 s | details |
#20 | ACCEPTED | 0.00 s | details |
#21 | ACCEPTED | 0.00 s | details |
#22 | ACCEPTED | 0.00 s | details |
#23 | ACCEPTED | 0.00 s | details |
#24 | ACCEPTED | 0.00 s | details |
#25 | ACCEPTED | 0.00 s | details |
#26 | ACCEPTED | 0.00 s | details |
#27 | ACCEPTED | 0.00 s | details |
#28 | ACCEPTED | 0.00 s | details |
#29 | ACCEPTED | 0.00 s | details |
#30 | ACCEPTED | 0.00 s | details |
#31 | ACCEPTED | 0.00 s | details |
#32 | ACCEPTED | 0.00 s | details |
#33 | ACCEPTED | 0.00 s | details |
#34 | ACCEPTED | 0.00 s | details |
#35 | ACCEPTED | 0.00 s | details |
#36 | ACCEPTED | 0.00 s | details |
#37 | ACCEPTED | 0.00 s | details |
#38 | ACCEPTED | 0.00 s | details |
#39 | ACCEPTED | 0.00 s | details |
#40 | ACCEPTED | 0.00 s | details |
#41 | ACCEPTED | 0.01 s | details |
#42 | ACCEPTED | 0.01 s | details |
#43 | ACCEPTED | 0.01 s | details |
#44 | ACCEPTED | 0.01 s | details |
#45 | ACCEPTED | 0.00 s | details |
#46 | ACCEPTED | 0.01 s | details |
#47 | ACCEPTED | 0.00 s | details |
#48 | ACCEPTED | 0.01 s | details |
#49 | ACCEPTED | 0.01 s | details |
#50 | ACCEPTED | 0.01 s | details |
#51 | ACCEPTED | 0.01 s | details |
#52 | ACCEPTED | 0.01 s | details |
#53 | ACCEPTED | 0.01 s | details |
#54 | ACCEPTED | 0.01 s | details |
#55 | ACCEPTED | 0.01 s | details |
#56 | ACCEPTED | 0.01 s | details |
#57 | ACCEPTED | 0.01 s | details |
#58 | ACCEPTED | 0.01 s | details |
#59 | ACCEPTED | 0.04 s | details |
#60 | ACCEPTED | 0.02 s | details |
#61 | ACCEPTED | 0.01 s | details |
#62 | ACCEPTED | 0.06 s | details |
#63 | ACCEPTED | 0.03 s | details |
#64 | ACCEPTED | 0.08 s | details |
#65 | ACCEPTED | 0.08 s | details |
#66 | ACCEPTED | 0.07 s | details |
#67 | ACCEPTED | 0.03 s | details |
#68 | ACCEPTED | 0.09 s | details |
#69 | ACCEPTED | 0.03 s | details |
#70 | ACCEPTED | 0.01 s | details |
#71 | ACCEPTED | 0.08 s | details |
#72 | ACCEPTED | 0.04 s | details |
#73 | ACCEPTED | 0.11 s | details |
#74 | ACCEPTED | 0.02 s | details |
#75 | ACCEPTED | 0.06 s | details |
#76 | ACCEPTED | 0.03 s | details |
#77 | ACCEPTED | 0.09 s | details |
#78 | ACCEPTED | 0.02 s | details |
#79 | ACCEPTED | 0.04 s | details |
#80 | ACCEPTED | 0.11 s | details |
#81 | ACCEPTED | 0.20 s | details |
#82 | ACCEPTED | 0.08 s | details |
#83 | ACCEPTED | 0.19 s | details |
#84 | ACCEPTED | 0.32 s | details |
#85 | ACCEPTED | 0.51 s | details |
#86 | ACCEPTED | 0.19 s | details |
#87 | ACCEPTED | 0.27 s | details |
#88 | ACCEPTED | 0.14 s | details |
#89 | ACCEPTED | 0.12 s | details |
#90 | ACCEPTED | 0.31 s | details |
Code
#include <algorithm> #include <algorithm> #include <iostream> #include <map> #include <numeric> #include <queue> #include <random> #include <string> #define M 998244353 typedef long long int ll; using namespace std; ll F(string& s, ll A, ll B) { long long h = 0; for (char c : s) h = (h * A + c) % B; return h; } string generateRandomString(int length) { // Define the list of possible characters const string CHARACTERS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuv" "wxyz0123456789"; // Create a random number generator random_device rd; mt19937 generator(rd()); // Create a distribution to uniformly select from all // characters uniform_int_distribution<> distribution( 0, CHARACTERS.size() - 1); // Generate the random string string random_string; for (int i = 0; i < length; ++i) { random_string += CHARACTERS[distribution(generator)]; } return random_string; } int main() { ll A, B; cin >> A >> B; map<ll, string> m; while (true) { string s = generateRandomString(10); ll idx = F(s, A, B); if (m.find(idx) != m.end()) { cout << m[idx] << ' ' << s << endl; break; } else m.insert({idx, s}); } }
Test details
Test 1
Verdict: ACCEPTED
input |
---|
6 6 |
correct output |
---|
dxvdzxfqi oheo |
user output |
---|
Eo9YrfhIMy Bre1CK4s8I |
Test 2
Verdict: ACCEPTED
input |
---|
5 10 |
correct output |
---|
yzzzeszzyc uuhdakc |
user output |
---|
tgQG1t4ldD RxHliOhoYv |
Test 3
Verdict: ACCEPTED
input |
---|
5 2 |
correct output |
---|
oheo yzzzeszzyc |
user output |
---|
ppRiR56QVY GAKFgslYmq |
Test 4
Verdict: ACCEPTED
input |
---|
6 1 |
correct output |
---|
dxvdzxfqi oheo |
user output |
---|
PHKbKHyy6A LS0jQIEmPc |
Test 5
Verdict: ACCEPTED
input |
---|
10 10 |
correct output |
---|
yzzzeszzyc uuhdakc |
user output |
---|
BGJaaH2XVm TzlISmmFIY |
Test 6
Verdict: ACCEPTED
input |
---|
3 1 |
correct output |
---|
dxvdzxfqi oheo |
user output |
---|
Y86hMQodax Retw7E6eoq |
Test 7
Verdict: ACCEPTED
input |
---|
9 10 |
correct output |
---|
oheo yzzzeszzyc |
user output |
---|
rydTQO7XTZ cihtfSmYXC |
Test 8
Verdict: ACCEPTED
input |
---|
1 3 |
correct output |
---|
dxvdzxfqi oheo |
user output |
---|
EThX4iokIF Hut3KjOV3V |
Test 9
Verdict: ACCEPTED
input |
---|
9 1 |
correct output |
---|
dxvdzxfqi oheo |
user output |
---|
e0EJHrh5CC OIKKvcS5uP |
Test 10
Verdict: ACCEPTED
input |
---|
1 4 |
correct output |
---|
oheo yzzzeszzyc |
user output |
---|
ul19AfiEzS W90WnctQ1W |
Test 11
Verdict: ACCEPTED
input |
---|
78 30 |
correct output |
---|
dxvdzxfqi uuhdakc |
user output |
---|
P3maw9jKIP ThlJ1mLyRt |
Test 12
Verdict: ACCEPTED
input |
---|
19 7 |
correct output |
---|
dxvdzxfqi uuhdakc |
user output |
---|
LwGd4PkOYv hcRmlQoQRy |
Test 13
Verdict: ACCEPTED
input |
---|
16 45 |
correct output |
---|
yrrkt aihwbdczv |
user output |
---|
F3gTj60d3L EHUdTF677c |
Test 14
Verdict: ACCEPTED
input |
---|
78 61 |
correct output |
---|
oedtdfgv zgivhgayf |
user output |
---|
mvdAYuLX6Q ViCGXSiKUX |
Test 15
Verdict: ACCEPTED
input |
---|
52 93 |
correct output |
---|
yzzzeszzyc uuhdakc |
user output |
---|
Eo8fLqrnkf vsLojDCO8w |
Test 16
Verdict: ACCEPTED
input |
---|
85 82 |
correct output |
---|
dxvdzxfqi onbkb |
user output |
---|
CCN6jZsdx0 C23LYgyyVC |
Test 17
Verdict: ACCEPTED
input |
---|
23 33 |
correct output |
---|
yzzzeszzyc aekmllmqu |
user output |
---|
4zUFoZOkd2 bOk2eUo96q |
Test 18
Verdict: ACCEPTED
input |
---|
30 19 |
correct output |
---|
oheo jftb |
user output |
---|
JT1eZGwKr1 NPP8jx2vjz |
Test 19
Verdict: ACCEPTED
input |
---|
66 8 |
correct output |
---|
yzzzeszzyc uuhdakc |
user output |
---|
nXpSQztB4r cJXlsZkuFb |
Test 20
Verdict: ACCEPTED
input |
---|
10 44 |
correct output |
---|
uuhdakc gvnyskxly |
user output |
---|
fsXblKLSEk slIHgACEik |
Test 21
Verdict: ACCEPTED
input |
---|
589 888 |
correct output |
---|
irnrs nvmno |
user output |
---|
eN3yGzvjc3 Ep0XPHBt2U |
Test 22
Verdict: ACCEPTED
input |
---|
49 800 |
correct output |
---|
irnrs nvmno |
user output |
---|
JS57N98RrG TuODbJYZ8P |
Test 23
Verdict: ACCEPTED
input |
---|
209 702 |
correct output |
---|
yzzzeszzyc bpuse |
user output |
---|
Io3eHIPhnu FxkD5AfdeP |
Test 24
Verdict: ACCEPTED
input |
---|
518 670 |
correct output |
---|
nvmno mgmo |
user output |
---|
ehpsAxJ1Ic 5FwRc5fVPs |
Test 25
Verdict: ACCEPTED
input |
---|
961 295 |
correct output |
---|
aekmllmqu wcpqoadrw |
user output |
---|
eGxyk5o9RZ P1TtODFwuV |
Test 26
Verdict: ACCEPTED
input |
---|
871 697 |
correct output |
---|
xfwgyq eokm |
user output |
---|
3kCi18XIEl G8NpgyQMMR |
Test 27
Verdict: ACCEPTED
input |
---|
308 714 |
correct output |
---|
nvmno lcwlpcmzza |
user output |
---|
rDGLoPvtSl WRhr8OP6fB |
Test 28
Verdict: ACCEPTED
input |
---|
426 481 |
correct output |
---|
onbkb kqupmfo |
user output |
---|
YPkwKIaIxI 6CiBwIaYmz |
Test 29
Verdict: ACCEPTED
input |
---|
730 171 |
correct output |
---|
eqdlmuyo wpvfat |
user output |
---|
VKN6ns2MbL TefF41ufJ2 |
Test 30
Verdict: ACCEPTED
input |
---|
864 801 |
correct output |
---|
wpvfat onbkb |
user output |
---|
ZUTvHcACbY 1xQQIJriNb |
Test 31
Verdict: ACCEPTED
input |
---|
6442 9170 |
correct output |
---|
wgqgje blui |
user output |
---|
SJPhV0iDDP 0g0Cmy3UNP |
Test 32
Verdict: ACCEPTED
input |
---|
2861 290 |
correct output |
---|
wpvfat onbkb |
user output |
---|
T1JZrLkncv wawYAHAwLZ |
Test 33
Verdict: ACCEPTED
input |
---|
8589 597 |
correct output |
---|
oheo uuhdakc |
user output |
---|
qfoByVrB3p qyd37XDyML |
Test 34
Verdict: ACCEPTED
input |
---|
2486 6897 |
correct output |
---|
zlscxfnxo ngvkz |
user output |
---|
hwTUTqtz75 G5AmDz73bw |
Test 35
Verdict: ACCEPTED
input |
---|
386 1958 |
correct output |
---|
vdihr miezzgst |
user output |
---|
kw0vLLBGRt lfbLTxfMYd |
Test 36
Verdict: ACCEPTED
input |
---|
4581 4498 |
correct output |
---|
uxqojd rhvuifulrn |
user output |
---|
J2IAFHO5Ea 8nkiJde8SH |
Test 37
Verdict: ACCEPTED
input |
---|
7286 877 |
correct output |
---|
irnrs iphgzlf |
user output |
---|
T9jSnL2fMi f5IslGenp5 |
Test 38
Verdict: ACCEPTED
input |
---|
9445 1393 |
correct output |
---|
hdwsfcnq veukbhkw |
user output |
---|
LcyDwbKfmF XxygRtih2K |
Test 39
Verdict: ACCEPTED
input |
---|
3848 8971 |
correct output |
---|
xshrtktoj fcuzyfii |
user output |
---|
n6HaenzyOr VnfQlVBcpN |
Test 40
Verdict: ACCEPTED
input |
---|
5469 57 |
correct output |
---|
dxvdzxfqi yzzzeszzyc |
user output |
---|
sPwymMJKxV PeyxG74V0w |
Test 41
Verdict: ACCEPTED
input |
---|
40770 64402 |
correct output |
---|
tced hbmnyt |
user output |
---|
3q7xoXNI8L mFgKkj6bIF |
Test 42
Verdict: ACCEPTED
input |
---|
25093 68059 |
correct output |
---|
ljrc wjxknzhykr |
user output |
---|
xxdx6XMx3d uEFI8kfR2T |
Test 43
Verdict: ACCEPTED
input |
---|
37455 79656 |
correct output |
---|
tppoycpya wviirv |
user output |
---|
keLV1S0zLi S4hT22D3G0 |
Test 44
Verdict: ACCEPTED
input |
---|
11506 49687 |
correct output |
---|
xaupctgiid jcdd |
user output |
---|
Pemqu4LkVQ bVrh01Th3Q |
Test 45
Verdict: ACCEPTED
input |
---|
83486 43255 |
correct output |
---|
bodw cdmncijoh |
user output |
---|
BFwT6jHWkL sS8ah9DdKo |
Test 46
Verdict: ACCEPTED
input |
---|
98903 30455 |
correct output |
---|
xshrtktoj pofnegkmkq |
user output |
---|
jRfzfsMX41 Llq0HaGwdT |
Test 47
Verdict: ACCEPTED
input |
---|
78385 25806 |
correct output |
---|
fnyjzygwa zyfhqqpkk |
user output |
---|
Jb0n8WVCcy c4RumuxMcp |
Test 48
Verdict: ACCEPTED
input |
---|
11350 85178 |
correct output |
---|
tsgztkzvwc rkra |
user output |
---|
kw75EnhC9E ssmUCZBAXs |
Test 49
Verdict: ACCEPTED
input |
---|
1750 42650 |
correct output |
---|
rlmle czxwmutnse |
user output |
---|
nVZdjrWEj0 EVBZJ4XFu0 |
Test 50
Verdict: ACCEPTED
input |
---|
30097 47375 |
correct output |
---|
zlscxfnxo ayfmd |
user output |
---|
nXiip88Mac mnM9DJgKmN |
Test 51
Verdict: ACCEPTED
input |
---|
494714 129204 |
correct output |
---|
czxwmutnse hudvk |
user output |
---|
VIddR48bDp mTbiRs1UgJ |
Test 52
Verdict: ACCEPTED
input |
---|
675884 327185 |
correct output |
---|
rlmle rejxztcu |
user output |
---|
9NRAERKTeD kxCpzYENO5 |
Test 53
Verdict: ACCEPTED
input |
---|
823296 823560 |
correct output |
---|
ratyx aurscmksx |
user output |
---|
vYj6y4qXBs FFuizB5RMs |
Test 54
Verdict: ACCEPTED
input |
---|
846854 678908 |
correct output |
---|
rfpuucjk yjndrg |
user output |
---|
gd71IZtL9L 4rKr5qLyGt |
Test 55
Verdict: ACCEPTED
input |
---|
420278 193978 |
correct output |
---|
begabk sqac |
user output |
---|
8YpCAPneZA MsPhzZhbWk |
Test 56
Verdict: ACCEPTED
input |
---|
93130 695227 |
correct output |
---|
nkomreccwl dfboyzq |
user output |
---|
itHFaqPaYC fWppn9Hy3Z |
Test 57
Verdict: ACCEPTED
input |
---|
984414 95962 |
correct output |
---|
plsmw rufywewnbq |
user output |
---|
ae0dKrFscr OjyyldfjAL |
Test 58
Verdict: ACCEPTED
input |
---|
87370 612080 |
correct output |
---|
psmbxgyf yzwvwyf |
user output |
---|
PPvsZrPt1D 1yGp4RFubv |
Test 59
Verdict: ACCEPTED
input |
---|
365188 833610 |
correct output |
---|
jbbjpkxs asruylwnc |
user output |
---|
Y0KMFdLN2O b26W5EmVv9 |
Test 60
Verdict: ACCEPTED
input |
---|
924244 804799 |
correct output |
---|
bxok beqs |
user output |
---|
qFRzBp9gV8 mpO4d3lsUT |
Test 61
Verdict: ACCEPTED
input |
---|
3012218 7755483 |
correct output |
---|
rzhfdn bhig |
user output |
---|
RQBO56e4kL DHN0vKHUPQ |
Test 62
Verdict: ACCEPTED
input |
---|
8254242 8634301 |
correct output |
---|
gleo mavrtxor |
user output |
---|
5sBnFqtNPZ HCj6gpknEC |
Test 63
Verdict: ACCEPTED
input |
---|
337938 5429289 |
correct output |
---|
hexlssw zxdfne |
user output |
---|
FAaRAIqoHI 2tmnZ8gy41 |
Test 64
Verdict: ACCEPTED
input |
---|
5545825 4865884 |
correct output |
---|
copwroka xebbxy |
user output |
---|
SLsBrUQ6ZT X5iiOXP8fx |
Test 65
Verdict: ACCEPTED
input |
---|
3795375 7727646 |
correct output |
---|
rgde yqleban |
user output |
---|
xkiabCMAoP 9bclVcDe5t |
Test 66
Verdict: ACCEPTED
input |
---|
2188983 8702106 |
correct output |
---|
zmjbhiiqo gyrickzf |
user output |
---|
D07sr8M18v wSy5bK9sGd |
Test 67
Verdict: ACCEPTED
input |
---|
1544663 1956286 |
correct output |
---|
lwvsjair peplyj |
user output |
---|
gekFGs9XBG Ot6ac4NJVz |
Test 68
Verdict: ACCEPTED
input |
---|
5464835 7522941 |
correct output |
---|
wjctw wqbqsqcdqg |
user output |
---|
RjlDpapfZZ AqlT83p7JJ |
Test 69
Verdict: ACCEPTED
input |
---|
2596718 4049688 |
correct output |
---|
nvyasakcug bsbyew |
user output |
---|
IE6ba43tj4 bodc3buGyf |
Test 70
Verdict: ACCEPTED
input |
---|
2965922 4020437 |
correct output |
---|
zthes oazfss |
user output |
---|
FQtWbJKXAs 1UAnyRYbHs |
Test 71
Verdict: ACCEPTED
input |
---|
56122287 60624959 |
correct output |
---|
hgllxkyp oukmzblohw |
user output |
---|
TC33jhyTET 5cpgD0xYIr |
Test 72
Verdict: ACCEPTED
input |
---|
42645140 73661194 |
correct output |
---|
xkdotul jvryawmaj |
user output |
---|
nMZ96mgo7f OgSj7YFTsd |
Test 73
Verdict: ACCEPTED
input |
---|
44585330 18926703 |
correct output |
---|
yqmfko hogdxzgt |
user output |
---|
mnq9o1Jp4g yoKqA8sMbJ |
Test 74
Verdict: ACCEPTED
input |
---|
56325214 7232406 |
correct output |
---|
wvmuumpi weyyifgfw |
user output |
---|
1GmqVt3vSS lK5XIixCmo |
Test 75
Verdict: ACCEPTED
input |
---|
98889561 92098565 |
correct output |
---|
xcesn xvzzheobbo |
user output |
---|
umHfZJBEIf p79gqmlx5w |
Test 76
Verdict: ACCEPTED
input |
---|
22701272 5642782 |
correct output |
---|
lescyxpmpw hkszwirdqk |
user output |
---|
suQrsrb9ES b3X9uQIJ7Y |
Test 77
Verdict: ACCEPTED
input |
---|
91304885 96889971 |
correct output |
---|
rnve dxgzxms |
user output |
---|
tGXa4wHEva uOWusMDlzc |
Test 78
Verdict: ACCEPTED
input |
---|
7803372 23247950 |
correct output |
---|
aofeuxbryn bgcepuzv |
user output |
---|
ylbst9DBxk YUwonHngTu |
Test 79
Verdict: ACCEPTED
input |
---|
89317875 1136575 |
correct output |
---|
kfdzbbelk esohyirdk |
user output |
---|
to994cskFz GPGeTql4gH |
Test 80
Verdict: ACCEPTED
input |
---|
1060874 37270195 |
correct output |
---|
pkkvrpnjgw aoljv |
user output |
---|
Q4LFWj3vks OoWXPmr3UU |
Test 81
Verdict: ACCEPTED
input |
---|
828199235 320792352 |
correct output |
---|
cmqjomgda cyptxxyb |
user output |
---|
9QSlDRqzZX QQcfAo5T2d |
Test 82
Verdict: ACCEPTED
input |
---|
193563111 73343920 |
correct output |
---|
gtswukro ziuzhijy |
user output |
---|
zNpdeuux9Q DX4gItoWhI |
Test 83
Verdict: ACCEPTED
input |
---|
165531091 479126951 |
correct output |
---|
ozbczatbfr nplek |
user output |
---|
48mx6B8jhC BwjNIqw3M7 |
Test 84
Verdict: ACCEPTED
input |
---|
835051605 652127789 |
correct output |
---|
ypkbe jvzy |
user output |
---|
nYr0IaBad7 Xt5QEtkXXE |
Test 85
Verdict: ACCEPTED
input |
---|
551842459 989875543 |
correct output |
---|
ajtuqsqbs tqboquks |
user output |
---|
J5YbJNF8BP 7SxtxDFLFH |
Test 86
Verdict: ACCEPTED
input |
---|
911411059 873575358 |
correct output |
---|
bhhhipl bcgsdgu |
user output |
---|
1T9PsGFpch y4oORTJTJP |
Test 87
Verdict: ACCEPTED
input |
---|
239756971 350744380 |
correct output |
---|
gddvcp osie |
user output |
---|
e6Hd6UnnIC bgsHbNoRhU |
Test 88
Verdict: ACCEPTED
input |
---|
316394140 195182397 |
correct output |
---|
jthyube jxvfzsh |
user output |
---|
UEN1P5Lgl0 BOhM3SJDLY |
Test 89
Verdict: ACCEPTED
input |
---|
698334027 81615941 |
correct output |
---|
ikrcixfxr ugacbxbd |
user output |
---|
YHXzclbi5Q pBEw0o6X3e |
Test 90
Verdict: ACCEPTED
input |
---|
104725912 462211740 |
correct output |
---|
alzppvu qlyi |
user output |
---|
s8EspMltah HNX0uOrN8D |