QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#510064 | #1971. Hezardastan | PetroTarnavskyi# | AC ✓ | 58ms | 12476kb | C++20 | 4.3kb | 2024-08-08 20:54:52 | 2024-08-08 20:54:53 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define RFOR(i, a, b) for(int i = (a) - 1; i >= (b); i--)
#define SZ(a) int(a.size())
#define ALL(a) a.begin(), a.end()
#define PB push_back
#define MP make_pair
#define F first
#define S second
typedef long long LL;
typedef vector<int> VI;
typedef pair<int, int> PII;
typedef double db;
const int N = 1 << 10;
mt19937 rng;
struct Graph
{
int szL, szR;
vector<VI> g;
VI mateForR, mateForL, usedL;
vector<VI> dirGraph;
VI usedDirGraph;
void init(int L, int R)
{
szL = L, szR = R;
g.resize(szL);
mateForL.resize(szL);
usedL.resize(szL);
mateForR.resize(szR);
dirGraph.resize(szL + szR);
usedDirGraph.resize(szL + szR);
}
void addEdge(int from, int to)
{
assert(0 <= from && from < szL);
assert(0 <= to && to < szR);
g[from].PB(to);
}
int iter;
bool kuhn(int v)
{
if(usedL[v] == iter) return false;
usedL[v] = iter;
shuffle(ALL(g[v]), rng);
for(int to : g[v])
{
if(mateForR[to] == -1)
{
mateForR[to] = v;
mateForL[v] = to;
return true;
}
}
for(int to : g[v])
{
if(kuhn(mateForR[to]))
{
mateForR[to] = v;
mateForL[v] = to;
return true;
}
}
return false;
}
int doKuhn()
{
fill(ALL(mateForR), -1);
fill(ALL(mateForL), -1);
fill(ALL(usedL), -1);
int res = 0;
iter = 0;
while(true)
{
iter++;
bool ok = false;
FOR(v, 0, szL)
{
if(mateForL[v] == -1)
{
if(kuhn(v))
{
ok = true;
res++;
}
}
}
if(!ok) break;
}
return res;
}
void buildDirGraph()
{
FOR(i, 0, szL)
{
for (int to : g[i])
{
if (mateForL[i] == to)
{
dirGraph[szL + to].PB(i);
}
else
{
dirGraph[i].PB(szL + to);
}
}
}
}
void dfsDirGraph(int v)
{
usedDirGraph[v] = true;
for (int to : dirGraph[v])
{
if (!usedDirGraph[to])
dfsDirGraph(to);
}
}
pair<VI, VI> minVertexCover()
{
buildDirGraph();
FOR(i, 0, szL)
if (mateForL[i] == -1 && !usedDirGraph[i])
dfsDirGraph(i);
VI vecL, vecR;
FOR(i, 0, szL)
if (!usedDirGraph[i])
vecL.PB(i);
FOR(i, 0, szR)
if (usedDirGraph[szL + i])
vecR.PB(i);
return {vecL, vecR};
}
};
int n;
string s[2][N];
pair<string, int> sorted[2][N];
int lcp[2][N][N];
int calcLCP(const string& s1, const string& s2)
{
int res = 0;
while (res < SZ(s1) && res < SZ(s2) && s1[res] == s2[res])
res++;
return res;
}
void solve()
{
int m;
cin >> m;
VI good(n);
FOR(j, 0, m)
{
int i;
cin >> i;
i--;
good[i] = 1;
}
vector<vector<string>> f(2, vector<string>(n));
vector<string> fs[2];
map<string, int> fIndex[2];
FOR(t, 0, 2)
{
VI maxLCP(n, -1);
int start = 0, end = n - 1, step = 1;
FOR(tt, 0, 2)
{
int prvBad = -1;
for (int i = start; ; i += step)
{
int j = sorted[t][i].S;
if (good[j] && prvBad != -1)
maxLCP[j] = max(maxLCP[j], lcp[t][prvBad][i]);
else if (!good[j])
prvBad = i;
if (i == end)
break;
}
start = n - 1;
end = 0;
step = -1;
}
FOR(i, 0, n)
{
if (good[i])
{
f[t][i] = maxLCP[i] == SZ(s[t][i]) ? s[t][i] : (s[t][i].substr(0, maxLCP[i] + 1) + "*");
if (t)
reverse(ALL(f[t][i]));
if (!fIndex[t].count(f[t][i]))
{
fIndex[t][f[t][i]] = SZ(fIndex[t]);
fs[t].PB(f[t][i]);
}
}
}
}
Graph g;
g.init(SZ(fIndex[0]), SZ(fIndex[1]));
FOR(i, 0, n)
{
if (good[i])
{
g.addEdge(fIndex[0][f[0][i]], fIndex[1][f[1][i]]);
}
}
int cnt = g.doKuhn();
auto [vecL, vecR] = g.minVertexCover();
assert(SZ(vecL) + SZ(vecR) == cnt);
cout << 1000 * m + cnt << " " << cnt;
for (int i : vecL)
cout << " " << fs[0][i];
for (int i : vecR)
cout << " " << fs[1][i];
cout << "\n";
}
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
int k;
cin >> n >> k;
FOR(i, 0, n)
{
cin >> s[0][i];
s[1][i] = s[0][i];
reverse(ALL(s[1][i]));
}
FOR(t, 0, 2)
{
FOR(i, 0, n)
{
sorted[t][i] = {s[t][i], i};
}
sort(sorted[t], sorted[t] + n);
FOR(i, 0, n)
FOR(j, 0, n)
lcp[t][i][j] = calcLCP(sorted[t][i].F, sorted[t][j].F);
}
while (k--)
solve();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 12184kb
input:
8 7 K-PAX SIRIUS REGULUS ARCTURUS BELLATRIX ANDROMEDA CYGNUS SCORPIUS 8 1 2 3 4 5 6 8 7 6 2 3 4 7 8 6 5 1 2 3 5 8 3 5 6 7 2 2 8 0 1 1
output:
8001 1 * 6002 2 A* *S 5003 3 S* R* *X 3003 3 B* AN* C* 2001 1 S* 0 0 1001 1 K*
result:
ok correct
Test #2:
score: 0
Accepted
time: 1ms
memory: 6008kb
input:
1 2 A 0 1 1
output:
0 0 1001 1 *
result:
ok correct
Test #3:
score: 0
Accepted
time: 1ms
memory: 5768kb
input:
2 4 A B 1 2 0 1 1 2 1 2
output:
1001 1 B* 0 0 1001 1 A* 2001 1 *
result:
ok correct
Test #4:
score: 0
Accepted
time: 1ms
memory: 5840kb
input:
1 2 AB 0 1 1
output:
0 0 1001 1 *
result:
ok correct
Test #5:
score: 0
Accepted
time: 1ms
memory: 5832kb
input:
2 4 A AB 2 1 2 0 1 1 1 2
output:
2001 1 * 0 0 1001 1 A 1001 1 AB*
result:
ok correct
Test #6:
score: 0
Accepted
time: 1ms
memory: 5840kb
input:
2 4 A BA 1 2 2 1 2 0 1 1
output:
1001 1 B* 2001 1 * 0 0 1001 1 A*
result:
ok correct
Test #7:
score: 0
Accepted
time: 1ms
memory: 6048kb
input:
3 8 A B C 2 2 3 2 1 2 1 3 0 1 2 3 3 2 1 2 3 1 1 1
output:
2002 2 B* C* 2002 2 A* B* 1001 1 C* 0 0 1001 1 B* 3001 1 * 2002 2 A* C* 1001 1 A*
result:
ok correct
Test #8:
score: 0
Accepted
time: 1ms
memory: 5844kb
input:
1 2 ABC 1 1 0
output:
1001 1 * 0 0
result:
ok correct
Test #9:
score: 0
Accepted
time: 1ms
memory: 5760kb
input:
2 4 AB ABC 0 2 2 1 1 1 1 2
output:
0 0 2001 1 * 1001 1 AB 1001 1 ABC*
result:
ok correct
Test #10:
score: 0
Accepted
time: 1ms
memory: 5832kb
input:
2 4 A ABC 1 2 0 1 1 2 1 2
output:
1001 1 AB* 0 0 1001 1 A 2001 1 *
result:
ok correct
Test #11:
score: 0
Accepted
time: 1ms
memory: 5792kb
input:
3 8 A AB ABC 2 3 1 0 2 2 1 1 1 3 1 3 2 2 2 3 1 3 1 2
output:
2002 2 A ABC* 0 0 2002 2 A AB 1001 1 A 3001 1 * 2001 1 AB* 1001 1 ABC* 1001 1 AB
result:
ok correct
Test #12:
score: 0
Accepted
time: 39ms
memory: 11576kb
input:
803 100 CQ3WDIY3SD BI5AFJ9MMR B6O7ET7572 CQGMC7R4WD BAHSOB3SR2 WC77BFVCP2 C8W28TZ-TD WAI462U52D CQKN3HAFYD CPXLSU-POR BY5CJJMUH2 B3O1M0QL62 CMDE4OCUM2 B5NHGKPDOR CM1401G-RD WAOI3Z-7XD B4YJB4ID-R CC5POFTRVR B7K5BUCVTD B3BUZ5EAZD CTTY5VAXJ2 BX6YJL2FNR CSH608L01D W2K4RQBSXR B1D8T4AH8D B58M3B-UG2 B28Z04...
output:
130128 128 CQGM* WAI* B3O* BX6* B1T* WQEI* B4S* WQM* CN9* B3S* BA2-* WPC* W88G* BDX* W6G* CRN* WLDR* BCY* BFH* WGK* CJ0* BPH* W04* WKL* CZ4* BSO* B3RX* W1Z* C1G* C8R* WFZ* WJM* BJO* CRS* CNQH* CC-* W3X* B--* BFT* CDN* BV0* B5Z* BOAQ* BSV* WMQX* C0H* CX8* B9-* W-H* BB5* WQWZ* C0I* WOE* BTO* CV2* CTA*...
result:
ok correct
Test #13:
score: 0
Accepted
time: 10ms
memory: 6772kb
input:
206 100 W7NIO4VAN7 3GK-DMGK8U 3KLSUXD4JX WU4CVHWHPX 3OG75G-TRP 3-N7FXW3V7 16B9S6HUT7 TARLAQMG1H TZ3CGBEWQH R9O9SWJ8E7 35RV2QSAR7 RYWFN4WTL0 TD-O-J233U WRHAHADLEU WMSR2GY5S7 WR9HRRXZSP TIRAKFTXPX R753K0P6EP XNLUEDLAEX 188LPIDPKX 37SAM404FU T3ZVREV2WU WN99DYF54P X0KNAKPWOP 35GFCE4IPU WI5W9Z6F3U 16-ADB...
output:
196115 115 W7* 3G* 3K* 16* TA* TZ* R9* 35* RY* WR* WM* R7* 37* WN* X0* WC* RG* TP* WK* XC* 1I* TO* 3T* R3* T8* T4* XW* TE* 3D* T0* 3E* 3R* 3M* X2* TL* TV* X7* 17* 3C* 1X* TW* 1J* 39* X3* W6* XS* XL* 3W* X4* RF* RX* RT* TC* XD* 14* R6* 1L* 3P* 1R* W1* 1H* 1Z* X5* 1U* 3NV* 3NY* RH* 1G* WP* WX* 1T* 13*...
result:
ok correct
Test #14:
score: 0
Accepted
time: 44ms
memory: 11752kb
input:
906 100 AM46Z0MXLJ AZKKLNUMWP T51TW0AZLC ZG9NZVLRSP L-2JMTU-AC FX4DCXQIXJ V2DJKT2GM0 FBYEQNDPSJ F494LP4GS0 V9PFHS3L6J TAUBZFR3BJ TEBM88HU-P T85J5K9EYM AU3G56H2KC ZJN-7TOAPM AP4G4LDHZ0 TDX2Z-UJ20 FE8NYQBYF0 LQKBV2582P FMZRJV54FP ZW9AXZ30OC TK0T82GX6C LVVVD8OIHM ZJTE8YHY1P ZO8-FT36IC ZSLJ1CG6HM TWPWHP...
output:
453389 389 AM4* AZK* ZG9* V2DJ* TAU* TEB* T85* AU3* ZJN* FE8* ZW9* LVV* ZJT* AK2* AIJ* TY1* ABDA* Z9E* TS* FK9* LZJ* LLY* TPT* T2G* LHO* ZGZ* LHE* TA4* TDA* AN4* VOM* LQA* T1* VSI* FOX* L6QX* LSP3* TPR* L6L* A28* L0* FWJ* ZJR* VRW* VOO* FZY* LXX* T92* VEB* L7* L13* ZOC* ZOD* VUH* TFK* AZFX* TF7* L9L...
result:
ok correct
Test #15:
score: 0
Accepted
time: 22ms
memory: 12208kb
input:
514 100 HRQQFROGZ6 XKGQ3O3AW6 5CWKWXOKU5 HFJ39F7P0D L3UDP7HL8D K9O976VAHD 0EJ2LC5YL5 UI8JWJS6Z5 LVA-G-ZYR6 USEDOZ12O5 J1DRPLR905 H-JCM3N04D LRFI5-4X5D DQ16KF0PX5 U7GBSAO5L5 0Q78OHWFI5 NETHRINMQ6 JJN1640DA5 4NNXPLA5T5 N85CWUTXK5 K0R7C7LIR6 POLO4L9T7D U8UKB7ZFWD KJ5P0OZEO5 4-23X9ZP55 JC8GJ5JWKD LGZUPC...
output:
354243 243 5C* HF* K9O* 0E* UI8* LV* US* LR* DQ1* U7* 0Q* NET* JJ* 4NN* N85* POL* U8* 4-* LG* KIY* DO* UO* UF* 4SB* 0N* -1* H1* LQ* JL* 5H* -Y* LA* D8* J7* LB* KE* JZX* J0* HX6* 5-* JQ* 5B* 09I* L6P* 49* G5* DZ* GBX* J6* PR* 0U* 4UO* GC* DHQ* ND* PII* JD* PH* DH5* 42* UB* 5N* HP* X9* P-H* X4* LW* LY...
result:
ok correct
Test #16:
score: 0
Accepted
time: 24ms
memory: 12208kb
input:
514 100 L96USRZM0R LZG4B1YBFV LIWW6DYKKJ JKCBL0O-F0 LPSF-KUIFL PZT7W87ODV L3NE13IXZW L-KUJP48RV JVM1BWDL80 JR79AO561V LVPN1QA5XY JVZWNDU8S0 PLMTYPH-W2 J4ZRSDNOEZ LEBE-EEKY2 J9B1G3F2U4 PF1IYLK8TR JE11IW9R2Q J38ZIHGUYZ PJ60-64VLW LNP0RFLERZ L9LHGCCJD0 L-YOS22I-F P3P2LJL2GR LGG4S7E9M2 JFM6IKMRBL JSRAPO...
output:
248215 215 L96* L3N* JVM* JR7* JVZ* PLM* JE1* PJ6* JSR* JMY* JOT* P8Z* LCU* P75* L1W* PS-* JSO* PN3* LHP* JF0* P8-* LE4* JA3* LB2* JEJ* PUP* P-M* LXD* L36* JX2* P-X* LCJ* JDH* JOA* JQ-* P72* LI5* PO4* J52* LQV* JBE* LRGQ* LLZL* LO* LFS* JRD* LBX2* LZ5* JBF* PMD* L33* JC* JRR* J-7* JS7* L5O* PHL* PLZ...
result:
ok correct
Test #17:
score: 0
Accepted
time: 28ms
memory: 11188kb
input:
614 100 WCC4V-YSP5 X-0G-V82N8 KONWGWS5QT OONP33YVOV KOXU-81YIQ URZ9JOEMHY QLJO2235LI -DPZVO00T5 G800H9UIEH -GJPY0XMGT KZVFW4D3OQ 6P3YNNEPLQ 65LAON651X 0H8GORN6-X U5J-YMVT2V XN7CWFHB9T Y5AD68Q4H0 WCIFZRUV-H G4N9HHZ8-5 Y2F-EDA1J1 0MUVY2XLHA 8QW1KN9BL0 -FCCKWVN3T GA548DYM7Y KM72O6FUDG UA0YN1P8PG Q4RBHD...
output:
183159 159 WC* U5J* Y2* -F* KM* -H* KAM* UQL4* 0O* BT* QN* Y5S* UMA* -W* 6A* YG7* DYB* 6G* 07* DZT* URN* WW5* DD* UE8* O4* U6-* OTI* YAR* GI* -IR* DF9* 0QL* UWZ* 6XM* GEJ* Y8K* GXH* WM* Y9* 02* XL* O8B* WD1* DWO* 88* Q8* GLD* YR* 66* Q2* O7J* 6S-* K0* KAY* 0Y* 8FZ* B8* -RX* 64K* -L* GE3* XX* QWS* O1...
result:
ok correct
Test #18:
score: 0
Accepted
time: 47ms
memory: 11796kb
input:
914 100 V5W5MV48VU JVVC804AZ7 YA19I7GKJ4 MFD643KHBF YK3OG4LDZD K2O5DKELDJ RQOI4GLHLF VBFLM3KBOT 7YWHM7AR-8 MRZJY2UGCX 1QJG-FVCKP 74YJ1B58ED CGKOVYQVCP HSIC91T98V JA4ELCIGNU VMYN4KIZ6P K2CQLJJ63C PMY12Y3PC5 PJ5MMWS5OT JGWS986DEP H4WX27KQE7 MAB--0UIM4 RC75BV8PVT UBV6MH5UOC HQAQM9UTRF R6LALTM19D CVLI-Z...
output:
521375 375 V5W* YA* MFD* YK3* 7Y* MR* 1Q* JA* VM* H4* RC* UBV* CV* U2X* MYB* 1V* V2* 7II* 7I4* SYO* J0E* 14* SZG* Y53* PRE* WPM* WH-* HER* WB* J7* SMP* KC* KD9* UMH* RI* S1K* 12P* PO* VZ2* UV6* W9S* VS* J5Z* 1Y* MT-* SIT* UU* VA8* KG* YPB* JPA* 74E* 1UM* JJP* WZ5* RZ4* S67* RQ0* W1* U9* PB5* C0* 72*...
result:
ok correct
Test #19:
score: 0
Accepted
time: 40ms
memory: 11952kb
input:
923 100 02DU15IS6A U3Z4MW-QQE 82NKKTU-ZS 4SO95XTIC9 OQY-ZQRUGI H3BO76UNN3 857LO29G7J 9CB2LXC-W7 TTVGRPOK87 YMTTM-3RHT H59I7RBBDW 2YUSGOZ5MN 5E43579XBT TRSYI32YQ8 H2X7XL8DLU 25P89DXTNJ DKDOB6UWZ9 D9Y2HW92DO 2J6HDOG8YA ULLOA-QOME WG4OCGW5WO RR2-F6TM73 0QC0XE2IQW 8IAFPQSKNW H61OQEATD9 TQCFQK0WIU D1N0UR...
output:
439343 343 02* 82N* H3B* 85* TT* H59* D9* 2J* TQ* 2M* ZIP* 742* HX* 05E* 5F* UJ* Q5F* DC* 5EL* 9C17* H4* WH6* T70* B6* 0G1X* 0G7* XZQ* 551* QT* ZNLV* TN* 8J3* HP7* Y4* WH5* 0F* 70* DO* UM* 4EK* 76* 4BY* R0* HOR* DWC* OF* 0C* 04K* 40* TAI* 0TF* 7FS* 97N* 4JO* D8* YKH* R1* RNX* YC* 0X* DM* UZP* 2E* Q-...
result:
ok correct
Test #20:
score: 0
Accepted
time: 43ms
memory: 12120kb
input:
990 100 OR4Q33JL64 U93T4VNWIN IMOF-B0WV3 USX1SKBO7Q VIW0ZL0TP9 29GG57V1XU G3I2HH6X7V S4QFQAPINB FGPOZDORVZ 5SBEMSOWJH Y5BRZPO9NU VGTO6I6HRC E8VWBO3HW8 YQUPH-WKB3 BC0QV9QENZ U1L49WWRUI 8JVW5S1XS2 F8355QXKF6 44UJRRIA5B 1RZSC334-H NFH0L3IO8F 5EUS-24K42 UD12L7-T-0 5Y6BEPQBU6 G06SC7KNE3 FXNDDBLBQS 4XMKES...
output:
260232 232 VI* S4Q* FG* YQU* BC* 8J* 5Y6* 978* T5* K9K* O4* 1W* 72* Z7M* B4* 1N* 9LF* 2F7* EB* NY* 9-EA* VDJ* 4V0* 6P* 7AS* V8O* 95V* 1U* KX* U43* B61* -K* 8GNC* G3X* UQ-* ZT8* 7P* UXG* ZVU5* -04* YXG* YUR* FV-* 7ZV* ZG0* NCQ* RF* RT* EZ* U79* R9* FL* VGN* X7* KK* KQ* XO* E--* TW2* 73D* V12* FU* IV*...
result:
ok correct
Test #21:
score: 0
Accepted
time: 47ms
memory: 12416kb
input:
997 100 3G50RU18DK ZENZYU0RDG P76NNCV6UB JR3PFF3FQU RQN5X4N1KL 8IT3OCB0LI 9MF8L74N5J 9B0672VN1E 4C294ZF3TC J3QD3B5ZBR RO4J6KYPJS UEVEOC0GM3 Z0SVUOMT91 F9V14Q76XY EK4Q04F0PQ 6KFYOYLRSB G2XLU7ZHTA 1W48-OBBHF 20ZF5JERBU 8ZIVSHBH5A QGZRK0TFXJ 3RO-RU5B9N PQB9YMX-1Z YUMGXIGKLS YMMCOGEZF1 BCLZ4M02M3 GHZ60J...
output:
541414 414 3G* ZEN* JR* 8I* 9M* 9B* RO* Z0* G2X* PQB* YM* BC* GHZ* R0S* QR* FW* AY* DRQ2* G6* QD6* BG9* OJ* YX* U-* UU* O0* 467* AM* I4* T7* ARV* G4A* T11* AF* RP* ZI* 3Z* WBK* A5* -Z* YF* LN* ZTK* 9F* Q-* 3S* 3N* JS* 65* -AWW* 6A2* B5* IJ-* AQ* 20H* 41* RX* WI* PF* 40H* E3* EE* Q0B* H1* JH* PC* FL*...
result:
ok correct
Test #22:
score: 0
Accepted
time: 0ms
memory: 5784kb
input:
2 4 BA CBA 0 1 1 2 1 2 1 2
output:
0 0 1001 1 B* 2001 1 * 1001 1 C*
result:
ok correct
Test #23:
score: 0
Accepted
time: 46ms
memory: 12476kb
input:
998 100 EO0ED0NUTL 1JKH0B5ITH OUJ5KE99ZW 19ZK0WJPO0 H4BFNDS8US 26K4M4MZWP WUV-ZZIEFU WIH2IBRFZL UBA3W8G55S 64-E1A9-JL BTXWZSND80 I-NFNQ4VS6 MG1P3-81S3 MAU4BOHP9H OQ9A8-707P J5Y0R0SEUP -00PJA9ZIL VWLP4WER2H QDXCSZ0T3C 4SOM6N54TN X-EK6X3DW8 05NPZAG0VY JNRF4DPD73 IIRRNXEQBU 2NGLKZ4U33 T63IYYFQ31 FKT6E3...
output:
529413 413 1J* H4* MG1* OQ* VW* QD* 4SO* X-* II* FK* Y46* ZQ* FU* 2D* F3P* LR8* HF7* 5A* 2Z* 6Q* 4M* QUR* NXU* U9H* NT* 62H* 0-* JAA* 5O* 7L* UL* UF* WO* F-QC* 6O* BHP* 1L* QEA* ZN* EL* E7* 40* WA* 4EW* IO* 1-2* OUO* LZO* WBX* 4L* OSZ* 66* LB* J5P* 6I* U-O* XN1* YS* OFZ* W-W* 7Q7* 0M* TA6E* YB* 7Z* ...
result:
ok correct
Test #24:
score: 0
Accepted
time: 10ms
memory: 6752kb
input:
206 100 3WKWKI20 3WMBMI20 3WO8OI20 3WI6II20 3WK1KI20 3WIHII20 3WKLKI20 3WIKII20 3WK5KI20 3W2F2I20 3WTKTI20 3WK2KI20 3WMNMI20 3WO6OI20 3WKUKI20 3WKXKI20 3WILII20 3WM5MI20 3W2N2I20 3WKPKI20 3WK6KI20 3WO9OI20 3WM0MI20 3WTUTI20 3W282I20 3WKMKI20 3WO3OI20 3WM9MI20 3WTZTI20 3WIDII20 3WKCKI20 3WTGTI20 3WO0...
output:
67067 67 3WKW* 3WI6* 3WKL* 3WIK* 3WK2* 3WMN* 3WKP* 3WO9* 3WKM* 3WO3* 3WTZ* 3WO0* 3WOC* 3WIO* 3WTP* 3WTJ* 3WOG* 3WM6* 3WK4* 3WOO* 3WK8* 3WIW* 3WKS* 3W2J* 3WTL* 3WOU* 3WT3* 3WM7* 3WKJ* 3WIT* 3WI2* 3WTM* 3WTO* 3WIS* 3WOZ* 3WOJ* 3WI9* 3WTN* 3WMX* 3WO4* 3W23* 3WOA* 3WTT* 3WME* 3W2H* 3WOW* 3WOB* 3WKQ* 3W2...
result:
ok correct
Test #25:
score: 0
Accepted
time: 51ms
memory: 12440kb
input:
999 100 XV0XTXAHJG XV0Z5ZAHJG XV0FIFAHJG XV0XEXAHJG XV0QTQAHJG XV07O7AHJG XV0TATAHJG XV0555AHJG XV0N7NAHJG XV07S7AHJG XV0RTRAHJG XV0TETAHJG XV0OXOAHJG XV0JVJAHJG XV07Q7AHJG XV0BKBAHJG XV0-J-AHJG XV0AOAAHJG XV07Y7AHJG XV0JQJAHJG XV09D9AHJG XV0676AHJG XV0JUJAHJG XV0-4-AHJG XV0T8TAHJG XV0434AHJG XV0RUR...
output:
255255 255 XV0XT* XV0XE* XV07O* XV07S* XV0RT* XV0TE* XV0OX* XV0JV* XV0BK* XV0-J* XV0AO* XV07Y* XV0JQ* XV0RU* XV069* XV0XP* XV09B* XV0RJ* XV0FS* XV073* XV090* XV05H* XV0NS* XV0OT* XV087* XV0R7* XV0ZN* XV0Y9* XV0HQ* XV0UB* XV0WH* XV0QQ* XV097* XV0RR* XV07I* XV0SA* XV0F1* XV0-T* XV0X9* XV071* XV0B8* XV...
result:
ok correct
Test #26:
score: 0
Accepted
time: 1ms
memory: 5852kb
input:
2 4 A CBA 2 2 1 0 1 1 1 2
output:
2001 1 * 0 0 1001 1 A* 1001 1 C*
result:
ok correct
Test #27:
score: 0
Accepted
time: 1ms
memory: 5768kb
input:
3 8 A BA CBA 1 3 2 3 1 2 2 1 1 1 0 3 2 3 1 1 2 2 3 2
output:
1001 1 C* 2002 2 A* C* 2002 2 A* B* 1001 1 A* 0 0 3001 1 * 1001 1 B* 2001 1 *BA
result:
ok correct
Test #28:
score: 0
Accepted
time: 1ms
memory: 5852kb
input:
2 4 AB AC 1 2 1 1 0 2 1 2
output:
1001 1 AC* 1001 1 AB* 0 0 2001 1 *
result:
ok correct
Test #29:
score: 0
Accepted
time: 1ms
memory: 6020kb
input:
3 8 A AB AC 1 3 2 1 3 3 3 1 2 0 2 3 2 2 2 1 1 1 1 2
output:
1001 1 AC* 2002 2 A AC* 3001 1 * 0 0 2002 2 AB* AC* 2002 2 A AB* 1001 1 A 1001 1 AB*
result:
ok correct
Test #30:
score: 0
Accepted
time: 1ms
memory: 5828kb
input:
2 4 BA CA 1 1 2 1 2 1 2 0
output:
1001 1 B* 2001 1 * 1001 1 C* 0 0
result:
ok correct
Test #31:
score: 0
Accepted
time: 1ms
memory: 7652kb
input:
3 8 A BA CA 2 3 1 0 1 2 1 1 3 3 2 1 2 2 1 2 3 2 1 3
output:
2002 2 A* C* 0 0 1001 1 B* 1001 1 A* 3001 1 * 2002 2 A* B* 2002 2 B* C* 1001 1 C*
result:
ok correct
Test #32:
score: 0
Accepted
time: 0ms
memory: 5768kb
input:
2 4 AB C 1 2 2 2 1 1 1 0
output:
1001 1 C* 2001 1 * 1001 1 A* 0 0
result:
ok correct
Test #33:
score: 0
Accepted
time: 1ms
memory: 5772kb
input:
3 8 A AB C 2 3 2 3 1 2 3 0 1 1 1 2 1 3 2 1 3 2 1 2
output:
2002 2 AB* C* 3001 1 * 0 0 1001 1 A 1001 1 AB* 1001 1 C* 2002 2 A C* 2001 1 A*
result:
ok correct
Test #34:
score: 0
Accepted
time: 1ms
memory: 5764kb
input:
3 8 A BA C 2 3 2 0 3 1 3 2 2 1 2 1 1 1 2 2 1 3 1 3
output:
2002 2 B* C* 0 0 3001 1 * 2001 1 *A 1001 1 A* 1001 1 B* 2002 2 A* C* 1001 1 C*
result:
ok correct
Test #35:
score: 0
Accepted
time: 1ms
memory: 6056kb
input:
4 16 A B C D 2 2 1 1 1 2 3 2 1 2 0 3 3 1 2 2 1 3 4 2 3 1 4 2 4 2 3 1 2 4 3 1 3 4 2 4 1 1 4 2 4 3 1 3 3 2 4 3
output:
2002 2 A* B* 1001 1 A* 2002 2 B* C* 1001 1 B* 0 0 3003 3 A* B* C* 2002 2 A* C* 4001 1 * 2002 2 B* D* 3003 3 A* B* D* 3003 3 A* C* D* 2002 2 A* D* 1001 1 D* 2002 2 C* D* 1001 1 C* 3003 3 B* C* D*
result:
ok correct
Test #36:
score: 0
Accepted
time: 1ms
memory: 5780kb
input:
3 8 AB AC AD 0 2 1 3 1 1 3 2 3 1 1 3 1 2 2 1 2 2 3 2
output:
0 0 2002 2 AB* AD* 1001 1 AB* 3001 1 * 1001 1 AD* 1001 1 AC* 2002 2 AB* AC* 2002 2 AC* AD*
result:
ok correct
Test #37:
score: 0
Accepted
time: 1ms
memory: 5772kb
input:
4 16 A AB AC AD 2 2 4 2 1 3 3 4 2 3 2 2 1 3 1 2 3 2 3 4 4 1 3 4 2 2 4 1 3 1 4 2 1 4 0 1 1 1 3 1 2 3 1 4 3 2 2 3
output:
2002 2 AB* AD* 2002 2 A AC* 3003 3 AB* AC* AD* 2002 2 A AB* 3003 3 A AB* AC* 2002 2 AC* AD* 4001 1 * 2002 2 A AD* 3003 3 A AB* AD* 1001 1 AD* 0 0 1001 1 A 1001 1 AC* 1001 1 AB* 3003 3 A AC* AD* 2002 2 AB* AC*
result:
ok correct
Test #38:
score: 0
Accepted
time: 1ms
memory: 6024kb
input:
3 8 BA CA DA 3 1 3 2 2 2 1 1 1 1 3 2 3 2 2 3 1 0 1 2
output:
3001 1 * 2002 2 B* C* 1001 1 B* 1001 1 D* 2002 2 C* D* 2002 2 B* D* 0 0 1001 1 C*
result:
ok correct
Test #39:
score: 0
Accepted
time: 1ms
memory: 6024kb
input:
4 16 A BA CA DA 1 1 3 4 3 1 1 2 2 1 4 2 1 3 1 3 2 3 4 0 1 4 3 4 2 3 2 2 3 3 1 2 4 2 1 2 4 4 3 2 1 2 4 2 3 1 2 3
output:
1001 1 A* 3003 3 A* C* D* 1001 1 B* 2002 2 A* D* 2002 2 A* C* 1001 1 C* 2002 2 C* D* 0 0 1001 1 D* 3003 3 B* C* D* 2002 2 B* C* 3003 3 A* B* D* 2002 2 A* B* 4001 1 * 2002 2 B* D* 3003 3 A* B* C*
result:
ok correct
Test #40:
score: 0
Accepted
time: 0ms
memory: 7676kb
input:
3 8 AB C D 1 2 2 2 1 1 1 2 3 2 1 3 0 2 3 1 3 2 1 3
output:
1001 1 C* 2002 2 A* C* 1001 1 A* 2002 2 C* D* 1001 1 D* 0 0 2002 2 A* D* 3001 1 *
result:
ok correct
Test #41:
score: 0
Accepted
time: 0ms
memory: 5832kb
input:
4 16 A AB C D 4 3 2 4 1 2 4 2 3 2 3 4 1 1 2 3 4 1 4 1 2 3 3 1 4 3 1 2 4 3 2 1 3 2 1 2 1 3 2 1 3 2 2 3 2 1 4 0
output:
4001 1 * 2002 2 AB* D* 3003 3 AB* C* D* 1001 1 A 2002 2 C* D* 1001 1 D* 1001 1 AB* 3003 3 A C* D* 3002 2 A* D* 3002 2 A* C* 2001 1 A* 1001 1 C* 2002 2 A C* 2002 2 AB* C* 2002 2 A D* 0 0
result:
ok correct
Test #42:
score: 0
Accepted
time: 1ms
memory: 6028kb
input:
4 16 A BA C D 2 4 1 1 1 2 3 4 3 3 1 2 4 4 2 3 1 3 3 1 4 1 4 2 2 1 3 2 1 4 3 4 3 2 2 2 3 2 1 3 0 1 2 1 3 2 2 4
output:
2002 2 A* D* 1001 1 A* 2002 2 C* D* 3002 2 C* *A 4001 1 * 3003 3 A* C* D* 1001 1 D* 2001 1 *A 3002 2 D* *A 3003 3 B* C* D* 2002 2 B* C* 2002 2 A* C* 0 0 1001 1 B* 1001 1 C* 2002 2 B* D*
result:
ok correct
Test #43:
score: 0
Accepted
time: 2ms
memory: 11964kb
input:
3 8 AB AC D 1 3 2 1 3 2 2 3 0 3 3 2 1 1 2 2 1 2 1 1
output:
1001 1 D* 2002 2 AB* D* 2002 2 AC* D* 0 0 3001 1 * 1001 1 AC* 2001 1 A* 1001 1 AB*
result:
ok correct
Test #44:
score: 0
Accepted
time: 1ms
memory: 5724kb
input:
4 16 A AB AC D 3 1 3 2 2 1 4 0 1 3 2 3 4 4 1 2 4 3 3 1 4 2 2 3 1 2 3 2 1 1 2 4 2 1 2 3 4 1 3 1 4 2 2 1 3 3 4 2
output:
3001 1 A* 2002 2 A D* 0 0 1001 1 AC* 2002 2 AC* D* 4001 1 * 3003 3 A AB* D* 2002 2 A AC* 2002 2 AB* AC* 1001 1 A 2002 2 AB* D* 1001 1 AB* 3003 3 A AC* D* 1001 1 D* 2002 2 A AB* 3003 3 AB* AC* D*
result:
ok correct
Test #45:
score: 0
Accepted
time: 1ms
memory: 5988kb
input:
3 8 BA CA D 3 1 3 2 1 3 0 2 3 1 1 2 1 1 2 2 1 2 3 2
output:
3001 1 * 1001 1 D* 0 0 2002 2 B* D* 1001 1 C* 1001 1 B* 2001 1 *A 2002 2 C* D*
result:
ok correct
Test #46:
score: 0
Accepted
time: 1ms
memory: 5788kb
input:
4 16 A BA CA D 2 1 4 2 1 3 3 3 4 1 2 2 3 1 3 2 2 4 1 2 2 2 1 3 4 3 2 1 1 3 2 4 1 3 1 2 3 2 4 3 0 1 4 4 1 2 4 3
output:
2002 2 A* D* 2002 2 A* C* 3003 3 A* C* D* 2002 2 B* C* 1001 1 C* 2002 2 B* D* 1001 1 B* 2002 2 A* B* 3003 3 B* C* D* 1001 1 A* 3003 3 A* B* D* 3001 1 *A 2002 2 C* D* 0 0 1001 1 D* 4001 1 *
result:
ok correct
Test #47:
score: 0
Accepted
time: 0ms
memory: 5780kb
input:
2 4 AB CD 2 2 1 0 1 2 1 1
output:
2001 1 * 0 0 1001 1 C* 1001 1 A*
result:
ok correct
Test #48:
score: 0
Accepted
time: 0ms
memory: 5784kb
input:
3 8 A AB CD 2 2 3 1 1 3 3 1 2 1 2 1 3 0 2 1 2 2 3 1
output:
2002 2 AB* C* 1001 1 A 3001 1 * 1001 1 AB* 1001 1 C* 0 0 2001 1 A* 2002 2 A C*
result:
ok correct
Test #49:
score: 0
Accepted
time: 1ms
memory: 6064kb
input:
3 8 C AB CD 1 1 3 2 1 3 1 3 0 2 1 3 2 3 2 1 2 2 1 2
output:
1001 1 C 3001 1 * 1001 1 CD* 0 0 2001 1 C* 2002 2 A* CD* 1001 1 A* 2002 2 C A*
result:
ok correct
Test #50:
score: 0
Accepted
time: 1ms
memory: 6024kb
input:
4 16 A C AB CD 3 2 1 4 3 2 4 3 2 1 2 0 2 3 2 2 3 1 1 2 1 4 2 4 1 2 4 2 4 1 4 3 2 2 4 3 3 4 3 1 3 1 2 3 1 3 1 1
output:
3002 2 A C* 3002 2 C* AB* 2002 2 A C 0 0 2002 2 C AB* 2001 1 A* 1001 1 C 1001 1 CD* 2002 2 A CD* 2001 1 C* 4001 1 * 2002 2 AB* CD* 3002 2 A* CD* 3002 2 A* C 1001 1 AB* 1001 1 A
result:
ok correct
Test #51:
score: 0
Accepted
time: 1ms
memory: 8000kb
input:
3 8 A BA DC 0 3 1 2 3 2 1 3 1 1 2 2 3 2 1 2 1 2 1 3
output:
0 0 3001 1 * 2002 2 A* D* 1001 1 A* 2002 2 B* D* 2001 1 *A 1001 1 B* 1001 1 D*
result:
ok correct
Test #52:
score: 0
Accepted
time: 1ms
memory: 5788kb
input:
3 8 C BA DC 3 2 3 1 0 1 3 2 3 1 1 2 2 1 2 2 3 2 1 1
output:
3001 1 * 0 0 1001 1 D* 2001 1 *C 1001 1 B* 2002 2 C* B* 2002 2 B* D* 1001 1 C*
result:
ok correct
Test #53:
score: 0
Accepted
time: 0ms
memory: 5836kb
input:
4 16 A C BA DC 2 1 2 3 4 2 1 1 1 1 2 1 3 3 3 4 2 4 2 4 1 3 2 2 3 2 4 1 2 1 3 1 4 2 3 4 3 1 3 4 0 2 4 2 3 3 1 2
output:
2002 2 A* C* 3002 2 A* *C 1001 1 A* 1001 1 C* 1001 1 B* 3002 2 B* *C 4001 1 * 2002 2 C* B* 2002 2 A* D* 2001 1 *A 1001 1 D* 2002 2 B* D* 3002 2 D* *A 0 0 2001 1 *C 3002 2 C* *A
result:
ok correct
Test #54:
score: 0
Accepted
time: 0ms
memory: 5760kb
input:
2 4 ABC D 1 2 0 1 1 2 1 2
output:
1001 1 D* 0 0 1001 1 A* 2001 1 *
result:
ok correct
Test #55:
score: 0
Accepted
time: 1ms
memory: 5760kb
input:
3 8 AB ABC D 1 2 0 3 3 2 1 1 1 2 1 2 2 3 1 2 3 2 1 3
output:
1001 1 ABC* 0 0 3001 1 * 1001 1 AB 2001 1 A* 2002 2 AB D* 2002 2 ABC* D* 1001 1 D*
result:
ok correct
Test #56:
score: 0
Accepted
time: 1ms
memory: 5992kb
input:
3 8 A ABC D 2 2 3 1 1 2 1 3 1 2 0 2 2 1 3 3 1 2 1 3
output:
2002 2 AB* D* 1001 1 A 2002 2 A D* 1001 1 AB* 0 0 2001 1 A* 3001 1 * 1001 1 D*
result:
ok correct
Test #57:
score: 0
Accepted
time: 1ms
memory: 7992kb
input:
4 16 A AB ABC D 1 3 1 2 4 1 3 4 2 2 2 1 2 2 3 1 1 2 1 3 3 2 1 4 3 4 1 3 0 2 2 4 1 4 3 3 1 2 2 4 1 2 4 3 3 4 2 3
output:
1001 1 ABC* 1001 1 AB 4001 1 * 2002 2 A AB 2001 1 AB* 1001 1 A 2002 2 A ABC* 3003 3 A AB D* 3003 3 A ABC* D* 0 0 2002 2 AB D* 1001 1 D* 3001 1 A* 2002 2 A D* 2002 2 ABC* D* 3002 2 AB* D*
result:
ok correct
Test #58:
score: 0
Accepted
time: 1ms
memory: 7984kb
input:
3 8 BA CBA D 3 3 1 2 2 2 3 0 1 3 1 2 2 1 2 2 3 1 1 1
output:
3001 1 * 2002 2 C* D* 0 0 1001 1 D* 1001 1 C* 2001 1 *A 2002 2 B* D* 1001 1 B*
result:
ok correct
Test #59:
score: 0
Accepted
time: 1ms
memory: 5860kb
input:
3 8 A CBA D 3 3 2 1 1 1 0 2 2 1 1 2 2 2 3 1 3 2 1 3
output:
3001 1 * 1001 1 A* 0 0 2001 1 *A 1001 1 C* 2002 2 C* D* 1001 1 D* 2002 2 A* D*
result:
ok correct
Test #60:
score: 0
Accepted
time: 1ms
memory: 6024kb
input:
4 16 A BA CBA D 2 3 2 2 4 1 1 3 1 4 2 2 4 0 3 1 2 4 3 1 2 3 1 1 2 2 1 1 2 4 1 4 2 3 2 1 3 3 3 2 4 3 1 4 3 2 3 4
output:
2001 1 *BA 2002 2 A* D* 1001 1 C* 1001 1 D* 2002 2 B* D* 0 0 3003 3 A* B* D* 3001 1 *A 1001 1 A* 2002 2 A* B* 1001 1 B* 4001 1 * 2002 2 A* C* 3002 2 D* *BA 3003 3 A* C* D* 2002 2 C* D*
result:
ok correct
Test #61:
score: 0
Accepted
time: 1ms
memory: 5712kb
input:
2 4 ABC AD 1 2 0 1 1 2 2 1
output:
1001 1 AD* 0 0 1001 1 AB* 2001 1 *
result:
ok correct
Test #62:
score: 0
Accepted
time: 1ms
memory: 5852kb
input:
3 8 AB ABC AD 1 2 1 1 3 2 3 1 2 2 3 1 3 0 2 3 1 2 2 1
output:
1001 1 ABC* 1001 1 AB 3001 1 * 2002 2 ABC* AD* 1001 1 AD* 0 0 2002 2 AB AD* 2001 1 AB*
result:
ok correct
Test #63:
score: 0
Accepted
time: 1ms
memory: 5764kb
input:
3 8 A ABC AD 1 1 2 1 3 2 3 2 1 2 1 3 2 2 1 0 3 2 3 1
output:
1001 1 A 2002 2 A AD* 2002 2 AB* AD* 1001 1 AB* 1001 1 AD* 2002 2 A AB* 0 0 3001 1 *
result:
ok correct
Test #64:
score: 0
Accepted
time: 1ms
memory: 5856kb
input:
4 16 A AB ABC AD 1 1 3 4 2 3 2 3 2 2 1 3 1 3 3 1 3 2 2 1 2 2 4 3 1 2 3 3 1 4 2 1 4 0 3 2 1 4 2 4 2 1 4 4 1 4 2 3
output:
1001 1 A 3002 2 AB* AD* 2001 1 AB* 2002 2 A ABC* 1001 1 ABC* 3002 2 A AB* 2002 2 A AB 2002 2 ABC* AD* 1001 1 AB 3003 3 A ABC* AD* 2002 2 A AD* 0 0 3003 3 A AB AD* 2002 2 AB AD* 1001 1 AD* 4001 1 *
result:
ok correct
Test #65:
score: 0
Accepted
time: 1ms
memory: 5848kb
input:
2 4 CBA DA 0 1 2 1 1 2 1 2
output:
0 0 1001 1 D* 1001 1 C* 2001 1 *
result:
ok correct
Test #66:
score: 0
Accepted
time: 1ms
memory: 5720kb
input:
3 8 BA CBA DA 1 1 2 3 2 1 3 3 1 3 2 0 1 2 2 1 2 2 1 3
output:
1001 1 B* 2002 2 C* D* 1001 1 D* 3001 1 * 0 0 1001 1 C* 2001 1 *BA 2002 2 B* D*
result:
ok correct
Test #67:
score: 0
Accepted
time: 1ms
memory: 6020kb
input:
3 8 A CBA DA 1 2 1 1 0 2 1 2 2 3 1 2 2 3 3 2 1 3 1 3
output:
1001 1 C* 1001 1 A* 0 0 2002 2 A* C* 2002 2 A* D* 2002 2 C* D* 3001 1 * 1001 1 D*
result:
ok correct
Test #68:
score: 0
Accepted
time: 1ms
memory: 5764kb
input:
4 16 A BA CBA DA 1 3 3 3 1 2 2 2 4 2 3 1 2 4 1 4 4 1 3 2 1 1 2 3 4 3 2 4 3 3 4 1 3 2 3 2 3 4 2 1 1 4 0 2 1 2 1 2
output:
1001 1 C* 3002 2 A* *BA 2002 2 B* D* 2002 2 A* C* 2002 2 A* D* 4001 1 * 1001 1 A* 2002 2 C* D* 3002 2 D* *BA 3003 3 A* C* D* 2001 1 *BA 3003 3 A* B* D* 1001 1 D* 0 0 2002 2 A* B* 1001 1 B*
result:
ok correct
Test #69:
score: 0
Accepted
time: 1ms
memory: 5852kb
input:
2 4 ABC ABD 2 1 2 1 1 1 2 0
output:
2001 1 * 1001 1 ABC* 1001 1 ABD* 0 0
result:
ok correct
Test #70:
score: 0
Accepted
time: 0ms
memory: 5988kb
input:
3 8 AB ABC ABD 2 3 1 0 1 2 2 1 2 2 2 3 1 3 1 1 3 2 3 1
output:
2002 2 AB ABD* 0 0 1001 1 ABC* 2002 2 AB ABC* 2002 2 ABC* ABD* 1001 1 ABD* 1001 1 AB 3001 1 *
result:
ok correct
Test #71:
score: 0
Accepted
time: 1ms
memory: 5988kb
input:
3 8 A ABC ABD 2 2 1 2 2 3 0 1 3 3 3 2 1 2 1 3 1 2 1 1
output:
2002 2 A ABC* 2001 1 AB* 0 0 1001 1 ABD* 3001 1 * 2002 2 A ABD* 1001 1 ABC* 1001 1 A
result:
ok correct
Test #72:
score: 0
Accepted
time: 1ms
memory: 5832kb
input:
4 16 A AB ABC ABD 2 2 1 2 2 4 1 4 3 4 2 3 4 2 4 1 3 1 1 2 1 3 1 2 2 1 4 2 3 4 3 2 3 1 0 3 2 4 1 3 3 4 1 1 3 2 3 2
output:
2002 2 A AB 2002 2 AB ABD* 1001 1 ABD* 3001 1 AB* 4001 1 * 1001 1 A 2002 2 A ABC* 1001 1 AB 2002 2 A ABD* 2002 2 ABC* ABD* 3003 3 A AB ABC* 0 0 3003 3 A AB ABD* 3003 3 A ABC* ABD* 1001 1 ABC* 2002 2 AB ABC*
result:
ok correct
Test #73:
score: 0
Accepted
time: 1ms
memory: 5832kb
input:
2 4 CBA DBA 2 2 1 1 1 1 2 0
output:
2001 1 * 1001 1 C* 1001 1 D* 0 0
result:
ok correct
Test #74:
score: 0
Accepted
time: 1ms
memory: 6048kb
input:
3 8 BA CBA DBA 2 3 2 2 2 1 1 3 2 3 1 1 1 3 1 2 3 1 2 0
output:
2002 2 C* D* 2002 2 B* C* 1001 1 D* 2002 2 B* D* 1001 1 B* 3001 1 * 1001 1 C* 0 0
result:
ok correct
Test #75:
score: 0
Accepted
time: 0ms
memory: 6020kb
input:
3 8 A CBA DBA 2 1 2 0 1 2 3 1 3 2 2 1 3 2 2 3 1 3 1 1
output:
2002 2 A* C* 0 0 1001 1 C* 3001 1 * 2002 2 A* D* 2001 1 *BA 1001 1 D* 1001 1 A*
result:
ok correct
Test #76:
score: 0
Accepted
time: 0ms
memory: 5832kb
input:
4 16 A BA CBA DBA 3 1 4 2 2 1 4 1 3 1 1 2 2 3 4 1 4 2 3 2 2 1 2 3 1 3 4 1 3 3 2 1 3 2 4 2 1 2 3 4 2 3 1 4 2 3 4 0
output:
3003 3 A* B* D* 2002 2 A* D* 1001 1 C* 1001 1 A* 2002 2 B* C* 4001 1 * 2002 2 A* B* 2002 2 A* C* 3003 3 A* C* D* 3003 3 A* B* C* 2002 2 B* D* 1001 1 B* 3001 1 *BA 1001 1 D* 2002 2 C* D* 0 0
result:
ok correct
Test #77:
score: 0
Accepted
time: 0ms
memory: 7756kb
input:
1 2 ABCD 0 1 1
output:
0 0 1001 1 *
result:
ok correct
Test #78:
score: 0
Accepted
time: 0ms
memory: 5980kb
input:
2 4 ABCD ABC 0 2 2 1 1 1 1 2
output:
0 0 2001 1 * 1001 1 ABCD* 1001 1 ABC
result:
ok correct
Test #79:
score: 0
Accepted
time: 0ms
memory: 6016kb
input:
2 4 ABCD AB 2 1 2 1 2 0 1 1
output:
2001 1 * 1001 1 AB 0 0 1001 1 ABC*
result:
ok correct
Test #80:
score: 0
Accepted
time: 1ms
memory: 6064kb
input:
3 8 ABCD AB ABC 1 3 0 2 1 3 1 2 2 2 1 2 3 2 1 1 3 1 2 3
output:
1001 1 ABC 0 0 2001 1 ABC* 1001 1 AB 2002 2 ABCD* AB 2002 2 AB ABC 1001 1 ABCD* 3001 1 *
result:
ok correct
Test #81:
score: 0
Accepted
time: 1ms
memory: 5984kb
input:
2 4 ABCD A 1 2 2 2 1 0 1 1
output:
1001 1 A 2001 1 * 0 0 1001 1 AB*
result:
ok correct
Test #82:
score: 0
Accepted
time: 1ms
memory: 5716kb
input:
3 8 ABCD A ABC 2 1 2 1 2 1 3 2 2 3 3 1 2 3 0 2 1 3 1 1
output:
2002 2 ABCD* A 1001 1 A 1001 1 ABC 2002 2 A ABC 3001 1 * 0 0 2001 1 AB* 1001 1 ABCD*
result:
ok correct
Test #83:
score: 0
Accepted
time: 1ms
memory: 5768kb
input:
3 8 ABCD A AB 2 3 2 1 1 2 1 3 2 1 2 3 2 1 3 0 1 2 1 3
output:
2002 2 A AB 1001 1 ABC* 2001 1 AB* 2002 2 ABC* A 3001 1 * 0 0 1001 1 A 1001 1 AB
result:
ok correct
Test #84:
score: 0
Accepted
time: 1ms
memory: 6024kb
input:
4 16 ABCD A AB ABC 2 1 4 1 4 2 4 3 2 2 4 3 3 2 4 4 3 1 2 4 1 2 0 3 3 2 1 1 3 3 1 2 4 1 1 3 1 4 3 2 2 3 2 3 1 2 2 1
output:
2001 1 ABC* 1001 1 ABC 2002 2 AB ABC 2002 2 A ABC 3003 3 A AB ABC 4001 1 * 1001 1 A 0 0 3003 3 ABCD* A AB 1001 1 AB 3002 2 ABC* A 1001 1 ABCD* 3001 1 AB* 2002 2 A AB 2002 2 ABCD* AB 2002 2 ABCD* A
result:
ok correct
Test #85:
score: 0
Accepted
time: 1ms
memory: 5760kb
input:
2 4 DCBA CBA 1 2 2 1 2 0 1 1
output:
1001 1 C* 2001 1 * 0 0 1001 1 D*
result:
ok correct
Test #86:
score: 0
Accepted
time: 1ms
memory: 6060kb
input:
2 4 DCBA BA 1 2 0 2 2 1 1 1
output:
1001 1 B* 0 0 2001 1 * 1001 1 D*
result:
ok correct
Test #87:
score: 0
Accepted
time: 1ms
memory: 5856kb
input:
3 8 DCBA BA CBA 0 3 2 3 1 2 2 3 1 2 2 3 1 1 3 2 1 2 1 1
output:
0 0 3001 1 * 2002 2 B* C* 1001 1 B* 2001 1 *CBA 1001 1 C* 2002 2 D* B* 1001 1 D*
result:
ok correct
Test #88:
score: 0
Accepted
time: 1ms
memory: 5764kb
input:
2 4 DCBA A 1 1 2 1 2 0 1 2
output:
1001 1 D* 2001 1 * 0 0 1001 1 A*
result:
ok correct
Test #89:
score: 0
Accepted
time: 1ms
memory: 5760kb
input:
3 8 DCBA A CBA 2 2 1 3 2 3 1 1 2 2 1 3 2 2 3 0 1 1 1 3
output:
2002 2 D* A* 3001 1 * 1001 1 A* 2001 1 *BA 2002 2 A* C* 0 0 1001 1 D* 1001 1 C*
result:
ok correct
Test #90:
score: 0
Accepted
time: 1ms
memory: 5720kb
input:
3 8 DCBA A BA 2 2 3 0 1 1 2 2 1 3 1 2 3 1 2 1 3 2 1 3
output:
2002 2 A* B* 0 0 1001 1 D* 2002 2 D* A* 3001 1 * 1001 1 A* 1001 1 B* 2001 1 *BA
result:
ok correct
Test #91:
score: 0
Accepted
time: 1ms
memory: 5772kb
input:
4 16 DCBA A BA CBA 4 3 1 4 2 2 1 3 3 4 3 1 1 4 1 2 2 4 2 3 2 3 1 2 4 1 2 1 2 1 3 0 3 3 4 2 1 1 2 3 2 3 2 4 1 2 4 3
output:
4001 1 * 2002 2 D* B* 3001 1 *BA 1001 1 C* 1001 1 A* 2002 2 A* C* 3003 3 D* A* B* 2001 1 *CBA 2002 2 D* A* 1001 1 B* 0 0 3003 3 A* B* C* 1001 1 D* 2002 2 A* B* 3002 2 A* *CBA 2002 2 B* C*
result:
ok correct
Test #92:
score: 0
Accepted
time: 1ms
memory: 5836kb
input:
3 8 AB B BC 3 1 3 2 1 3 2 3 2 2 3 1 1 2 1 1 0 2 2 1
output:
3001 1 * 1001 1 BC* 2001 1 B* 2002 2 A* BC* 1001 1 B 1001 1 A* 0 0 2001 1 *B
result:
ok correct
Test #93:
score: 0
Accepted
time: 1ms
memory: 6000kb
input:
6 64 A AA AAA AAAA AAAAA AAAAAA 2 2 6 3 3 4 6 1 4 4 2 5 6 4 4 1 3 2 5 2 1 4 3 2 4 5 2 6 1 3 5 2 3 3 3 4 2 5 2 5 3 1 6 3 6 5 1 3 2 1 4 4 6 1 4 5 3 1 3 6 4 1 4 3 5 1 3 1 5 4 3 6 1 4 4 4 3 6 5 3 6 4 2 2 2 1 1 1 4 2 4 6 1 2 2 4 0 3 4 3 1 4 2 4 3 6 2 3 5 3 1 5 4 3 6 4 1 5 1 5 4 2 6 6 1 2 5 3 4 6 4 2 5 4 ...
output:
2002 2 AA AAAAAA* 3003 3 AAA AAAA AAAAAA* 1001 1 AAAA 4002 2 AA AAAA* 4004 4 A AA AAA AAAAA 2002 2 A AAAA 3003 3 AA AAAA AAAAA 2002 2 A AAAAAA* 3003 3 AA AAA AAAAA 3003 3 AA AAA AAAA 5004 4 A AA AAA AAAAA* 3002 2 A AAAAA* 3003 3 A AA AAAA 4002 2 A AAAA* 3003 3 A AAA AAAAAA* 4004 4 A AAA AAAA AAAAA 1...
result:
ok correct
Test #94:
score: 0
Accepted
time: 0ms
memory: 6000kb
input:
6 64 A AA AAB ABB BB B 3 1 6 2 3 5 3 1 3 5 6 3 3 2 3 1 2 3 1 6 3 6 5 1 4 2 2 4 3 2 6 3 4 6 5 3 2 3 4 1 5 3 2 5 4 4 4 1 5 6 5 4 1 6 5 2 2 2 1 4 1 3 6 5 3 6 1 5 5 6 5 4 3 1 4 3 2 1 4 1 2 4 4 3 6 1 3 3 6 4 4 3 6 1 2 5 3 6 2 4 5 3 4 3 5 2 1 5 2 2 6 3 4 1 6 3 5 6 2 5 3 2 4 1 5 3 5 6 4 2 4 6 4 1 2 4 6 4 5...
output:
3002 2 B *A 3003 3 A AAB* BB* 3002 2 AAB* B* 3002 2 A AA* 2002 2 A AAB* 6001 1 * 2002 2 AAB* AB* 2002 2 AAB* B 4002 2 AA* B* 3002 2 A *BB 3002 2 AA *BB 4003 3 A AB* B* 5003 3 AB* B* *A 2001 1 *A 4003 3 A AAB* B* 3002 2 A B* 5002 2 A *B 4001 1 A* 1001 1 AA 4004 4 A AAB* AB* B 3003 3 AAB* AB* B 4003 3...
result:
ok correct
Test #95:
score: 0
Accepted
time: 0ms
memory: 7620kb
input:
5 32 ABC BC C CB CBA 2 4 1 3 5 2 1 1 5 3 3 4 5 1 1 2 3 2 2 2 5 1 3 3 3 1 2 2 1 2 1 4 4 4 2 1 5 3 3 2 5 1 2 2 4 2 3 5 4 2 2 1 5 4 1 5 3 2 2 5 4 3 5 3 1 4 1 5 4 3 3 1 2 4 0 3 1 5 4 2 3 1 2 5 3 2 4 3 4 4 1 3 2 3 4 3 2 5 3 1 2 4 5 3 1 3 4 4 4 2 3 5
output:
2002 2 A* CB 3002 2 CBA* *BC 1001 1 CBA* 3001 1 C* 1001 1 A* 2002 2 B* C 2002 2 B* CBA* 1001 1 C 3001 1 *C 2001 1 *BC 1001 1 CB 4002 2 CB* *BC 3003 3 B* C CBA* 1001 1 B* 2002 2 B* CB 3002 2 B* CB* 2002 2 A* CBA* 4002 2 CBA* *C 2001 1 CB* 3003 3 A* C CBA* 4002 2 A* C* 3002 2 CB *BC 0 0 3002 2 A* CB* ...
result:
ok correct
Test #96:
score: 0
Accepted
time: 0ms
memory: 5784kb
input:
6 64 ABCD BCD CD D DC DCB 4 2 6 5 4 3 5 2 6 6 5 3 2 6 1 4 2 1 5 3 6 2 4 2 6 4 4 5 4 3 1 3 6 1 2 0 3 3 2 4 3 1 2 4 5 2 5 1 4 6 2 5 4 4 4 2 6 1 2 1 4 4 1 6 2 3 3 5 6 1 3 1 2 5 2 6 2 3 3 5 6 1 4 1 6 3 4 5 2 3 2 6 3 2 3 6 5 1 4 3 5 2 4 1 5 4 6 3 5 1 4 2 6 5 2 4 2 2 3 5 5 3 6 5 4 1 1 2 3 1 4 6 4 2 6 3 5 ...
output:
4002 2 B* D* 3002 2 B* DC* 6001 1 * 2002 2 A* DC 3003 3 B* D DCB* 2002 2 D DCB* 4004 4 A* C* D DC 3002 2 DCB* *BCD 0 0 3003 3 B* C* D 3002 2 D *BCD 5002 2 D* *BCD 2002 2 D DC 4003 3 D DCB* *BCD 2002 2 A* D 4002 2 DCB* *CD 3002 2 A* DC* 3002 2 DC *BCD 2002 2 B* DCB* 3002 2 C* DC* 1001 1 D 1001 1 DCB*...
result:
ok correct
Test #97:
score: 0
Accepted
time: 50ms
memory: 12188kb
input:
1000 100 OAA9YQ5VOZ H4G8T8-AWG 2V8J2DY88H VOTJRYQHSC JIV57RYB4I CKDA7GCT-F 59OT9PN7MV E55SCNCHOI 3QRSJ1Z165 D2LZJ6KCM1 1AZ8X8XYNA UN1EIVMEU6 -6GLAQ459B 4U39QLQWYM 4376K3Z-G6 GO8CUD2615 VDQMQBZD56 PYD65T3YN0 F0HP5LJKAF S8TW3-7HKX 6BLTEOO1VL UZOMT710K1 URAD3ML3W4 S9D6J09WJS M9X7FHI-CT YLWMGUUBBA -MEF0...
output:
506414 414 H4* VOTJ* 3Q* 1A* UN1* -6* 4U* 43* GO8* VD* S8* UR* S9* M9* E5H* C0* 46* 90O* 1F* 07Y* 283* S7Y* JQR* U55* 7Z* XB* 1DS* VK4* R6* -T* KT* OZ* 81M* R1* 3D* G9* NJ1* 1BT* MB* 8E* YH* ZZ* 6L* EDW* 4MN* 2G* XY2* I-4* TM0* O0* KVK* 11* 9W* DO* 1XM* RZ* HXX* 69* HQ* UP* LX* TU* KR* F2TL* XF* FH*...
result:
ok correct
Test #98:
score: 0
Accepted
time: 35ms
memory: 12100kb
input:
629 100 AABAAABABB BABABABAAA BBBBAABAAB AABBBBBAAB BAABBAABAA BABBBBBABA ABAAAABABB AABAAAAABB BABABBBBAB BBABBBABAA BAABBBABAA ABBBBABBAA BBBABBAAAB BBBBAABAAA ABABAABABA AAABAAAAAB ABAABBABBA ABBABBBBAB BBBAAAABBB BBBAABABBA BABBBABBAA AAABAABBBA BBBABBBABB BABBBBBAAB AAABBABBAB AAAABAABBB ABABBB...
output:
316209 209 AABBBBBAA* BABBBBBAB* AABAAAAAB* BABABBBB* BBABBBABAA* BAABBBAB* ABABAABABA* AAABAAAAA* ABBABBB* BBBAABABBA* AAABAABB* AAABBABBAB* ABBBAAA* AABBBBAA* AAAABBBAA* ABABAABBBA* BBBABABBA* BABAABBB* ABBABABBA* BBABABABA* ABAABABBAA* BBAABBABB* ABBAAAAAA* BBBBBAAAB* ABBAABBAA* BBABAAAA* BBBBABA...
result:
ok correct
Test #99:
score: 0
Accepted
time: 58ms
memory: 12112kb
input:
997 100 BABBAABBCB CBCCBACCCA CABACCCBBB BBACABACAA CCCBBCBABC ACCAAACBCC CCCABBBABC CCBABCABBB ABABAABCBB ABACAAABAB ACABCCBBAB BABCABCAAC CCCBABBAAB ABCBCCBABC BBACCCCBBB CAAABBACCC CACAACCAAA BCCCBAABAB CAACCCBCCA CBABBBCCCB CBCACBCBAB ABACCBCBCB ABBCCCCCAA CBCCBABBCA BCABCBBCCB CBAACCBCBC BCBABA...
output:
482337 337 BABBAABB* CCCBBCB* ACCAAAC* CCCABBB* CCBABC* ABABAABC* ABACAAA* ABCBCC* BBACCC* CAACCCB* CBABBBCCCB* CBCAC* ABBCCCCCA* BCABCB* CBAACCBC* ABAAB* CAACA* ABABABCC* CBBBCCC* ACBAABA* BAACC* CABBCA* ABCCBA* ACACAAA* AACBBA* CCAABC* BBCBCC* BBBCC* CACAACA* ACCBBAA* CACBC* ABBCAA* AACCBC* ABACAA...
result:
ok correct
Test #100:
score: 0
Accepted
time: 53ms
memory: 12364kb
input:
1000 100 ADACDEFBF DGGCFBCGF DCGEBCGFC EBDFDCFDD FEDGCAFAG AEBBBFDDB AGGEAEGDF BBACFECCD CDFBBEDCA AGBBAEDBC BCDDGECGE CDGEFEBGA DBGBFGCBA DEABECGDD GDCGBDEEE FEAGEDCAE AGBFABAED FFBBEFEDF DFGBEGEGE CBGBGECAD BADGECBGE DCGBCBEEE ADGAABFFA EEECABDFD FAEEAABBE FEDEDEFFG DFFBGEDEE AACACFAFG BGGFBCBEG D...
output:
501356 356 FEDG* AEBB* AGBB* BCDD* DEAB* FEAG* FFBB* CBGB* BADG* EEE* FAEEA* FEDE* BGGFB* DDFE* AGC* FDAF* CEB* DFGC* EGCA* EDAA* ADBDG* FFFC* DFEA* CDAE* FADA* DAAG* BEGA* GGGG* BCFF* EGFE* DEB* AFDG* FEBE* AGEC* EFB* EACD* FGEFA* FCDC* DFC* ECAC* AGBD* ADF* GCB* BGDC* AADB* CFCC* BDBG* AACDF* CECC...
result:
ok correct
Test #101:
score: 0
Accepted
time: 54ms
memory: 12112kb
input:
1000 100 JEEFFJADAF JHCCFJBGFE EAHJCDDBBE GJBHAHJAFF HJCHDIFBEI CICBGFDDHC GHJFGBFAAC DGBFFDFGEE BJHBAGBJAA FAFJCBAJEC JCJJHGIBGI IIIEGDCCBB GEJCHAADDG FFFECHBFHJ IHCEIJEGEI GBEHDBADDA FHJFIDJAJA GCDHDCIABJ CDEFJBCFFB DJFCGCJGGB JJBFEECBAG DJCABDHCJB DEGGHHBCID AGJEGIEDFI CHIJCAJDBG EDIDHCDGGF EFGEE...
output:
487381 381 JEE* JHC* GJB* HJC* DGBFF* III* GEJC* FHJF* JJBF* DJC* DEG* JGFJ* HBAI* HJJ* GIH* HGD* DFHA* ACA* DFBF* EAA* AHHF* FED* HGG* CEE* ABF* BBI* EHJ* BEG* DCDB* BDF* GDBI* FIAC* GCB* HDDH* GJI* CJFED* HCC* GFAE* FGF* EFE* EBEI* DFGJ* HEE* CJD* IAHB* DHD* ACH* GFD* BJA* GAG* ABA* DDJ* BCFD* AJJ...
result:
ok correct
Test #102:
score: 0
Accepted
time: 54ms
memory: 12116kb
input:
1000 100 ECNSLCKQCM JEHFECCSEC RIFNTEKGIA SLCKLSFJAC CHGCGBFIOK ISFGQDENGQ NHIALQNSDN MAAGNPMNKO SIPEDOGIGD TDITCLNJGR RMIMIRLBCA MIOHFDOEGQ LLLACCGDRK BSJAMFDETE STHBBGKDEF QHMGOERAPR RAKQHLCDMA PIEDTGLMIO TCNOHCARDD JSMRJMOHOP PCQGKELEOC IHAIFIFDCJ ENLEPKCBJR RITFQMTKJE KFBJOJAASS HIPQRRIFFQ FENNN...
output:
489376 376 RIF* SLC* CHG* ISF* NHIA* MAA* SIP* TDI* RM* QHM* RAK* PIE* PCQ* IHAI* KFB* LABM* CIS* NHH* LKD* NL* JF* MGH* LAS* MJM* LO* ANA* PGK* FFA* LSP* EP* SFR* GE* RF* RE* JC* QF* LFK* BB* TK* IF* OAG* RCE* PO* QQB* RKC* NJN* FH* QQO* SMJ* JOR* KQFS* ANG* DMC* DOF* MLK* KHT* IBR* MDB* CIA* TPNEI...
result:
ok correct
Test #103:
score: 0
Accepted
time: 53ms
memory: 12112kb
input:
988 100 2Z- B9Y NKK K3G K5Z VF0 TQW UL5 5TI LFI LB3 Y3K T7R GGK S55 YTS 0OF U12 B2C 7T3 M0M 413 B9U YRM KWW FAU SGU 55X 7QZ DCV JJN UE1 H3L O4F 4S8 DMM SA9 1E8 H31 1V3 C7R C9U E31 NL5 23H 6IG 1QI YUZ GF3 LIB 734 FHD B23 M5K 6S5 G4E AUS HET 8R4 F4B 5DH WR2 ER7 56X AOT 8XT WVP SGT V7V TC- RD8 3DW ZOP ...
output:
511411 411 2Z* NKK* K3G* VF* UL* 5T* Y3* T7R* GG* YTS* 0OF* M0* B9U* 7Q* H3* DM* SA* C7* E3* 6IG* GF3* LIB* FH* M5* 8R* F4* ER7* WVP* V7V* 3DW* PR* BWZ* F-* 24* X5* HL* I0* HS* EWO* J7* 2Q* AUW* CC* M2D* J5* SN9* Y9* N6* L4* IH* SW* AK* P1* AR* YJ* PA* A30* HQ* Z6* I7* EF* UD* EK* BD* 6W* DL* ES* 16...
result:
ok correct
Test #104:
score: 0
Accepted
time: 1ms
memory: 5792kb
input:
8 100 B5GHG VMYSO W5GHG R5GH1 R5GHJ XMYSD -MYSD VMYSA 8 1 7 2 3 6 8 5 4 2 1 6 8 7 8 5 6 2 4 1 3 2 8 5 7 7 1 6 4 5 8 3 7 8 5 6 2 3 7 4 2 5 4 6 4 8 6 7 1 5 6 3 5 6 4 7 1 8 4 5 2 3 7 8 6 1 0 0 6 3 7 6 5 4 8 0 3 1 6 5 2 6 3 7 1 3 4 6 5 8 2 0 1 6 5 5 1 3 2 7 8 4 5 2 6 8 3 7 1 8 8 7 4 6 2 5 3 1 4 1 8 4 2 ...
output:
8001 1 * 2002 2 B* X* 8001 1 * 2002 2 R5GHJ* VMYSA* 7004 4 R* VMYSA* *G *D 7004 4 V* W* R* *D 2001 1 R* 6004 4 B* R* VMYSA* *D 6003 3 R* *G *D 8001 1 * 0 0 0 0 6004 4 W* R* VMYSA* *D 0 0 3003 3 B* R5GHJ* X* 2002 2 W* X* 7004 4 V* R* X* *G 0 0 1001 1 X* 5004 4 VMYSO* R5GHJ* -* *G 8001 1 * 8001 1 * 40...
result:
ok correct
Test #105:
score: 0
Accepted
time: 5ms
memory: 6448kb
input:
100 100 7YP5GHA 38ZITV9 0IT14GW R0HQ62W 7YP5GU9 CEZVHUX 39ZITP- NW8OQ1N Y-ZITV9 8C29D04 7YJ0TF3 0ONZMGV GA4KAY- ANV0JTJ 7F8OQ1M 3TTDDVU EHITSL8 1UOMHCX AG29DYG R0HQ6Q3 ZZHQ60X MX9J0VE M2AZQPZ ESWMLRD E6SP6SC ZJV0JE7 TEKG3IR ESWMLT9 J43DS2B NTITSL8 W2TDD2I ZJV0JG2 AK3PRU3 XMHPRVI JE2-BR2 -SHPRVI 314K...
output:
97033 33 3* 0* R* CE* N* Y* A* 7F* E* 1* M* ZJ* T* J* W* X* C4OMH6* P* D* 2* Z4* F* Q* 9* L* 5* O* *A *- *4 *3 *M *I 73036 36 7Y* 0* R* C* 39* NW* Y* 3T* 1U* AG29DY* MX* M2* ZJ* T* W* 31* ZF* P9* AM* F* Q* 9* 6* L* XZHPR7* DE* S* EA* O6* I* *9 *8 *0X *SC *VI *0 43033 33 7Y* CE* 39ZITP* NW* AN* AG29D...
result:
ok correct
Test #106:
score: 0
Accepted
time: 48ms
memory: 12360kb
input:
966 100 D-J ULU LRS QTP 1J8 32G -P0 HGI 0BQ 2MG CVH -34 R1G M-N U64 MEN L4Z 0E1 -WC BTJ Y0F KE1 NMA 9L- NX7 UNC 1SL KJS 9VW TXM SB0 4YJ MGW 4TA RMI DKT XX0 12N G6E GNY IL- 8PT LWS ZTC ETQ WGW ZJ9 KP4 MJK ILN HGW 7NE N0S 4N6 T5D Z4Z 0FW WPT VXQ BMW E36 O2M 5B4 342 LUF OTC H2D OFD WLC QB0 LQ6 PGN JT2 ...
output:
589413 413 D-* UL* LRS* 1J8* 32* HG* -3* M-* U64* ME* 0E1* Y0* 9L-* 1SL* MG* 12* G6* GNY* 8P* LWS* ZT* ET* WG* MJK* ILN* E3* O2* OT* OFD* WL* PGN* 91F* I7* LH6* 1IN* 7Z* 7P* -5* OY* TB* FV* ZU* TR* EP* QT2* BU* OFR* ICS* WI1* AGZ* XIW* JC6* 06* 7L* 5A* JL* 42* 7G* P2Q* QHN* DKP* 6Q* Z6* LC* 3JQ* YK*...
result:
ok correct
Test #107:
score: 0
Accepted
time: 52ms
memory: 12340kb
input:
1000 100 FZ0SPZ9 G3MHZIL 238D3G0 QYP4LBI LF9CC0A 9KK8BWH VO3KA2T 0272EZ8 8DU2LLB AAQGQIR -BMTS2U 5JA10-N 05KMNAR BSULLS5 ANTGWW5 QIP5XTC 2FGP-O1 3CFXLED 3-4REN9 ENDT914 5YJ9VOG 1CT-MW8 WXAPKFY 42E3DBO 2RWIVQY QL7IVG4 -S-5LE1 Z1EZL0F Q-R0TCQ 72LM5MG WMT-M8R 1P9J2RH R2VIMQI 9HUEX1Y 5GQ40L1 LV8F-UZ R2Z...
output:
66062 62 AC5XTA* 8EC1H9* AIRE6H* QBEK* 02VQ8T* JV5* QR* A8* -36* UKG9ZR* UB0* 2W* SI* X0S* LG8VPQ* 88* 1HJ* LC* SXMS-G* QAZ9UU* PTR0T0* YP* 1QGHK0* 7TR6* GGE220* WKB* SMPUA6* TUKDQN* DRL93K* 24BST0* 35K8B9* YL-* 3CFXLB* IOS2T8* RH* AZ07GS* RV0B9C* 2JTPFB* 49* 26BEZN* HB5M2F* VQH* 1D* 97DXFJ* BYA* UT...
result:
ok correct
Test #108:
score: 0
Accepted
time: 53ms
memory: 12292kb
input:
1000 100 XW42DVU4F SB5J4T44L ZRTETRUAY 1WV5YNL5W -KUVGVDTH 8-HHQABYU IICJUHWF- 2T4OIMA2P 3NWX1CC-0 SVA52M7VW GZ45ZQ7E9 WN1KD91TI Z1OSKWFNB D7T5BS2HM 4DLB87XBH UR0I2UM7H G3UHUA-PP PNS2HPW8O LU5GHYF8E J5KB7U71P D6JC2SE0L QK41JIW00 L43LU9AAP ORZ-Z4-3A 3DPM2LZB2 V5WC2SVZI UY18ISCMR 28EP3OX9T QJZZOWW4L Y...
output:
74072 72 QK4* L43LU9A* D0FM2L2* 1LQ* KD6U192* SZKR-PV* 05JD56K* LN* 5O* RK4DU4G* HDY* DH* LP9DL-9* XJBC5XF* ZJ* 8KTU33S* WN1KD9A* EEB* KTOU3EZ* KQ9R2G3* 1U* IE* 5F* 3Q2BRL6* T0YOE4E* GXR* YRM43VS* IUYETR9* LXAT61P* 7J* JN* TE* QF0E80Z* XVWMSZE* 7E0* NNG* 3YE* SLPO9E0* 2Z* NMHG9DL* CVNI6PX* G8BGB3Q* ...
result:
ok correct
Test #109:
score: 0
Accepted
time: 54ms
memory: 12216kb
input:
1000 100 712P8A2FAM 09H9-JYTOM B64-WIOPAP RSWNYLZZ6K KIG1X2R5D6 AT-FY48HMX K6ZP0YUOR2 AAZEOD8CMZ AEFJY2OJGF PUQ4PX2YG6 13JJMPGBBN E5A9EKZNEE LJOJOVSS7P 46T06QZ49T 2331TV7FCO 39OL9-ILP5 UZF7BVAY2H 2QHPVSYGLF 6SN2FG2OME IU7YWZ9GC3 9ETXQ4QB0I 88X1VKR9T3 L0QZOLR4EZ 7YZWR424MV AHXGIXM5OU TZR-KCO7AI KNGCS...
output:
649411 411 09* KI* AT* K6ZP* AA* AE* E5A* 39O* UZ* 2Q* IU* 9ETXQ4QB* 88* AH* TZ* YJBDZ6S2* 6VKE76WL* 49* LM4* -W* 3WP* GV* UF* OUNMP7OZ* Y7* 5W4D9YSB* J2* 2R* MW* 0V* N5* -J* F2* LL* 5M* 0MZAX892* 8NE* 8P* TT* -6* KM* 13JJMPGT* BR* A0XLGNPI* BEJ* -M* 2T* WJ5* T1* PK* F0* 0X7M7U8G* 28C* L9* CQ* QH* O...
result:
ok correct
Test #110:
score: 0
Accepted
time: 1ms
memory: 5852kb
input:
7 100 YDIUW0CI0C YKRVY9W9UY CXWNQYCTNY Y5H9AMVTQY 6GY0UTDYDK 4E-AOS3BQY YGMIQP9RJG 4 6 7 5 2 2 7 3 5 2 1 4 6 7 6 1 7 6 3 5 4 3 4 5 2 6 2 5 6 7 3 1 1 7 2 5 4 2 6 1 0 5 7 5 2 1 4 1 2 1 3 3 4 7 5 0 0 6 7 5 1 6 4 3 3 2 5 4 1 1 2 5 3 4 7 4 3 6 3 7 3 2 6 2 3 4 7 1 6 7 1 7 4 6 3 5 2 2 1 3 5 4 6 1 5 2 4 3 1...
output:
4004 4 YK* 6* 4* YG* 2002 2 C* YG* 5002 2 Y* 4* 6005 5 YD* C* 6* YG* *QY 3003 3 YK* Y5* 6* 6006 6 YD* YK* C* 6* 4* YG* 1001 1 YG* 2002 2 Y5* 6* 2002 2 YD* 4* 0 0 5002 2 Y* 6* 1001 1 YK* 1001 1 C* 3003 3 Y5* 6* YG* 0 0 0 0 6005 5 YD* C* 6* YG* *QY 3003 3 YK* Y5* 6* 1001 1 YD* 2002 2 C* 6* 4003 3 C* Y...
result:
ok correct
Test #111:
score: 0
Accepted
time: 2ms
memory: 6024kb
input:
41 100 V457JG9HW2 G47YX6MZM9 -Y9B0RBO-R 9IXFEC9OPZ FY8NMG70RI WFV1PZQJZK 95QL0GGXHH 7E6W550I27 OVOP4FRQGI K3EHYQSX44 GUT6VPQ0U6 0ZW1DOTBB3 8H-O0XN25K 94T6OMB5D9 JJ3DRJULO- 7TBEPXLFX9 -5EJE1OOIS 75NV774CV4 JNWE-LHDCV YPEU3O9NSF UDJ9JHW1CK ANLA3AA5SZ R49WPX9BNV VOXEXGTN1- KBF96IZBUR JCYUZEUCV4 DGSH3UY...
output:
16016 16 -Y* W* K3* GU* 94* 75* Y* U* A* -7* GV* KQR* 08* T* I* -P* 37018 18 V* G* 9* 7* K* 0* -5* Y* A* JC* D* -7* -M* T* -P* *I *K *V 22016 16 9* W* GU* JJ* Y* VO* -7* GV* -M* KQ* T* 0E* GL* *R *I *7 23021 21 V4* G4* W* O* K3* GU* 0Z* 8H* JJ* 75* JN* Y* U* R* KB* D* -7* -M* -P* *7 *S 6005 5 -Y* 7E...
result:
ok correct
Test #112:
score: 0
Accepted
time: 34ms
memory: 11788kb
input:
802 100 66NUVUSI3X UXJ2YC8BUX -1P28XWYOX 8E7SC98B6X -IUN4JWIFX AS6B37EV-X RX48RJ8754 83CZAB5PUX IVFYVKY7XX AFQXK1UBWX LB2PMW-IYX MFLPGASYOX N3CKSBCEAX DTCQMEKD8X Q3HN1S453X 4IO46G4TGX K22YHJUMF4 GK3FKYJJ1X 5495G5ORGX GDZFX3FQXX TR8-UYG52X 0C1DNGA1DX 2CLMQI73FX GKM-I2MMVX D46EV-41PX 5UCH6UQ5-X 0HYFCA...
output:
460366 366 UX* -1* 8E* RX* MF* N3* GK* TR* 0C* 2C* D46* 5U* BT* T9* O0* KR* QHJ* BA* VW* C29* 6C* VE* 0HD* QS* RG* OT* 37Q* W1* V0* 9X* LL* QL* L6* BX* SF* 2S* WU* AJ* GB* H4* QI* L9M* 21* OOO* IZL* DS* WS7* WJ* PPB* HEE* 2K* M4* LMR* P3* 6QX* -3* IL* AZ9* QQ* 8LD* OM* -N* 62* 5NV* 7Q* L98* 4Z* MR3*...
result:
ok correct
Test #113:
score: 0
Accepted
time: 5ms
memory: 6492kb
input:
103 100 95XDA92N7U FOAVHUFZHU 04LTPWAYJL 9KWSIR0GY7 FVLK9X-4L7 087QW2O-DL F54H2VQYRL F4VY6CVW6L 0EV7UJ-PIU 9AEY353TIL FZX8O3YK97 9EQRL2PVWL FQLRGD58ML F-J6L2CMWU 0CE9TP4TEU 90HFRCV227 9RRP5X0QFU 0H1L9HYG8U 0R1S47HXR7 0IQBBGFF0U 0BQ-WQ3LS7 96W0XLKHB7 98WO2SS5YL 04BD1T8QF7 91HPAQI-HU FNOL8M9AMU FCZJHC...
output:
90060 60 95* 04* 9K* F5* F4* 0E* 9AE* 9E* FQ* F-* 0C* 90* 0H* 0R* 0I* 0B* 91* FN* FC* 0G* 0W* 0Q* 06* FGP* 98Y* FY* FU* 0AS* FOM* 0J* FJ* FP* 9O* FOB* FL* 00* 0K* FVK* 98C* F6* 05* 03* 0AN* 9B* FD* 02* 0Y* 9G* 01* F2* 9Y* *DL *97 *S7 *B7 *57 *6U *17 *5U *A7 8008 8 9AE* 91* 0GW* 0-* 05* FJ5* 0Y* F7* ...
result:
ok correct