Task: | Sukat |
Sender: | Kemm1706 |
Submission time: | 2024-01-20 14:08:14 +0200 |
Language: | C++ (C++11) |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
#2 | WRONG ANSWER | 0 |
#3 | WRONG ANSWER | 0 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | ACCEPTED | 0.00 s | 1, 2, 3 | details |
#2 | WRONG ANSWER | 0.00 s | 1, 2, 3 | details |
#3 | WRONG ANSWER | 0.00 s | 1, 2, 3 | details |
#4 | WRONG ANSWER | 0.00 s | 1, 2, 3 | details |
#5 | WRONG ANSWER | 0.00 s | 1, 2, 3 | details |
#6 | WRONG ANSWER | 0.00 s | 1, 2, 3 | details |
#7 | WRONG ANSWER | 0.00 s | 1, 2, 3 | details |
#8 | WRONG ANSWER | 0.00 s | 2, 3 | details |
#9 | WRONG ANSWER | 0.00 s | 2, 3 | details |
#10 | WRONG ANSWER | 0.00 s | 2, 3 | details |
#11 | WRONG ANSWER | 0.00 s | 2, 3 | details |
#12 | WRONG ANSWER | 0.00 s | 2, 3 | details |
#13 | WRONG ANSWER | 0.00 s | 2, 3 | details |
#14 | WRONG ANSWER | 0.00 s | 2, 3 | details |
#15 | RUNTIME ERROR | 0.00 s | 3 | details |
#16 | RUNTIME ERROR | 0.00 s | 3 | details |
#17 | RUNTIME ERROR | 0.00 s | 3 | details |
#18 | RUNTIME ERROR | 0.00 s | 3 | details |
#19 | RUNTIME ERROR | 0.00 s | 3 | details |
#20 | RUNTIME ERROR | 0.00 s | 3 | details |
#21 | RUNTIME ERROR | 0.01 s | 3 | details |
Compiler report
input/code.cpp: In function 'int main()': input/code.cpp:26:31: warning: variable 'pmax' set but not used [-Wunused-but-set-variable] 26 | ll l, i, j, k, maxx = -1, pmax; | ^~~~
Code
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector <ll> vl; typedef vector <vl> vvl; typedef pair <ll, ll> pl; typedef vector <pl> vpl; typedef vector <bool> vb; const ll inf = 1e18; const ll mod = 1e9 + 7; const ll nmax = 1e6; #define fi first #define se second #define mp make_pair #define pb push_back int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); string s; vpl a(26, {0, 0}); ll l, i, j, k, maxx = -1, pmax; cin >> s; l = s.length(); for(i = 0; i < l; i++) a[s[i] - 'A'].fi++; for(i = 0; i < 26; i++) a[i].se = i; for(i = 0; i < l; i++) if(a[i].fi > maxx) { maxx = a[i].fi; pmax = i; } sort(a.begin(), a.end(), greater<pl>()); cout << min(l / 2, l - maxx) << "\n"; i = 0, j = 1, k = 25; while(i < k && j < k) { while(a[i].fi > 0 && a[j].fi > 0 && a[k].fi > 0) { cout << char(a[i].se + 'A') << char(a[k].se + 'A') << "\n"; if(a[k].fi > 1) cout << char(a[j].se + 'A') << char(a[k].se + 'A') << "\n"; else { a[k].fi++; a[j].fi++; } a[i].fi--; a[j].fi--; a[k].fi -= 2; } if(a[i].fi == 0) { i = max(i, j) + 1; swap(i, j); } if(a[j].fi == 0) j = max(i, j) + 1; if(a[k].fi == 0) k--; } while(a[i].fi != 0 && a[j].fi != 0) { cout << char(a[i].se + 'A') << char(a[j].se + 'A') << "\n"; a[i].fi--; a[j].fi--; } return 0; }
Test details
Test 1
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
QBAXGXJZJS |
correct output |
---|
5 XJ ZX SQ JG ... |
user output |
---|
5 XA XB JG JQ ... |
Test 2
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
SSSSSSSSSS |
correct output |
---|
0 |
user output |
---|
5 |
Test 3
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
SETTSESEEE |
correct output |
---|
5 ES ET ES ET ... |
user output |
---|
5 ET ST ES ES |
Test 4
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
SSMRSSSSKR |
correct output |
---|
4 SR SR SM SK |
user output |
---|
5 SK SM SR SR |
Test 5
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
BIIILIIRRL |
correct output |
---|
5 IR IL IR IL ... |
user output |
---|
5 IB IL RL IR |
Test 6
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
YYGEYTDSTY |
correct output |
---|
5 YT YT YS YG ... |
user output |
---|
5 YD YE YG YS |
Test 7
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
MMMMMMMMMN |
correct output |
---|
1 MN |
user output |
---|
5 MN |
Test 8
Group: 2, 3
Verdict: WRONG ANSWER
input |
---|
XQQZJQDDJOWXDFVQUIODDJIZIQDQIW... |
correct output |
---|
500 DQ DQ DQ DQ ... |
user output |
---|
-6508070091232660322 DG QG DN QN ... Truncated |
Test 9
Group: 2, 3
Verdict: WRONG ANSWER
input |
---|
IIIIIIIIIIIIIIIIIIIIIIIIIIIIII... |
correct output |
---|
0 |
user output |
---|
-5280832617179596129 |
Test 10
Group: 2, 3
Verdict: WRONG ANSWER
input |
---|
KEOHHYHHAIHLLHEKIHKAHHHHOHEHHE... |
correct output |
---|
493 HA HA HA HA ... |
user output |
---|
-6505539032746317152 HJ HX HZ HG ... Truncated |
Test 11
Group: 2, 3
Verdict: WRONG ANSWER
input |
---|
WNNFXQNODQFSQVQQPNLQNQNNVVNXHN... |
correct output |
---|
499 NQ NQ NQ NQ ... |
user output |
---|
-6363109438946101866 NU QU NU NZ ... Truncated |
Test 12
Group: 2, 3
Verdict: WRONG ANSWER
input |
---|
VGAHMMMXMMVXAAMMMOMMMXVMMMYMXT... |
correct output |
---|
500 MH MH MH MH ... |
user output |
---|
-6434886614535457125 MG MJ HJ MJ ... Truncated |
Test 13
Group: 2, 3
Verdict: WRONG ANSWER
input |
---|
KKKKUUAKKAUKKKKFKKSVKCWKKKCVOJ... |
correct output |
---|
500 KI KI KI KI ... |
user output |
---|
-6219835325792604255 KY IY KE IE ... Truncated |
Test 14
Group: 2, 3
Verdict: WRONG ANSWER
input |
---|
VVVVVVVVVVVVVVVVVVVVVVVVVVVVVV... |
correct output |
---|
100 VP VP VP VP ... |
user output |
---|
-6293312432342454894 VG VE PE VN ... Truncated |
Test 15
Group: 3
Verdict: RUNTIME ERROR
input |
---|
FKKJJBWTSFCDEKFPOKIPWZSVKHACMC... |
correct output |
---|
100000 CK CK CK CK ... |
user output |
---|
(empty) |
Test 16
Group: 3
Verdict: RUNTIME ERROR
input |
---|
RRRRRRRRRRRRRRRRRRRRRRRRRRRRRR... |
correct output |
---|
0 |
user output |
---|
(empty) |
Test 17
Group: 3
Verdict: RUNTIME ERROR
input |
---|
WVKKVVADNVCVKLVYVVZVKVCTNKVLVV... |
correct output |
---|
99925 VC VC VC VC ... |
user output |
---|
(empty) |
Test 18
Group: 3
Verdict: RUNTIME ERROR
input |
---|
BBBBBDNXDZQXBBYBBWBSBTMADXBBVZ... |
correct output |
---|
99999 BE BE BE BE ... |
user output |
---|
(empty) |
Test 19
Group: 3
Verdict: RUNTIME ERROR
input |
---|
FBRDPLUMLZMLLLUFUCLEMCMULLZLFL... |
correct output |
---|
100000 LU LU LU LU ... |
user output |
---|
(empty) |
Test 20
Group: 3
Verdict: RUNTIME ERROR
input |
---|
UUBUBUTUJSLUVBUXTUUMUXUXTMXUXS... |
correct output |
---|
100000 UX UX UX UX ... |
user output |
---|
(empty) |
Test 21
Group: 3
Verdict: RUNTIME ERROR
input |
---|
PPPPPPPPPPEPPPPPPPPPPBOPPPPPPP... |
correct output |
---|
20000 PB PB PB PB ... |
user output |
---|
(empty) |