Task: | Sukat |
Sender: | vgtcross |
Submission time: | 2024-01-20 13:10:16 +0200 |
Language: | C++ (C++20) |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
#2 | WRONG ANSWER | 0 |
#3 | WRONG ANSWER | 0 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | WRONG ANSWER | 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 | WRONG ANSWER | 0.03 s | 3 | details |
#16 | WRONG ANSWER | 0.01 s | 3 | details |
#17 | WRONG ANSWER | 0.04 s | 3 | details |
#18 | WRONG ANSWER | 0.03 s | 3 | details |
#19 | WRONG ANSWER | 0.03 s | 3 | details |
#20 | WRONG ANSWER | 0.03 s | 3 | details |
#21 | WRONG ANSWER | 0.01 s | 3 | details |
Compiler report
input/code.cpp: In function 'void solve()': input/code.cpp:16:26: warning: array subscript has type 'char' [-Wchar-subscripts] 16 | for (char c : s) ++f[c]; | ^ input/code.cpp:19:62: warning: array subscript has type 'char' [-Wchar-subscripts] 19 | for (char c = 'A'; c <= 'Z'; ++c) cout << c << ": " << f[c] << endl; | ^ input/code.cpp:22:45: warning: array subscript has type 'char' [-Wchar-subscripts] 22 | for (char c = 'A'; c <= 'Z'; ++c) if (f[c] != 0) st.insert({f[c], c}); | ^ input/code.cpp:22:67: warning: array subscript has type 'char' [-Wchar-subscripts] 22 | for (char c = 'A'; c <= 'Z'; ++c) if (f[c] != 0) st.insert({f[c], c}); | ^ input/code.cpp: In lambda function: input/code.cpp:25:21: warning: array subscript has type 'char' [-Wch...
Code
#include <bits/stdc++.h> #define fi first #define se second using namespace std; using ll = long long; using pic = pair<int, char>; void solve() { string s; cin >> s; int n = s.size(); int f[128] = {}; for (char c : s) ++f[c]; for (char c = 'A'; c <= 'Z'; ++c) cout << c << ": " << f[c] << endl; set<pic> st; for (char c = 'A'; c <= 'Z'; ++c) if (f[c] != 0) st.insert({f[c], c}); auto remove = [&](char c) { st.erase({f[c], c}); if (--f[c] > 0) st.insert({f[c], c}); }; vector<pair<char, char>> ans; while (st.size() >= 2) { auto it = st.end(); --it; auto it2 = it; --it2; char c = it->se; char d = it2->se; ans.push_back({c, d}); remove(c); remove(d); } cout << ans.size() << '\n'; for (auto &s : ans) cout << s.fi << s.se << '\n'; } int main() { cin.tie(0) -> sync_with_stdio(0); solve(); return 0; }
Test details
Test 1
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
QBAXGXJZJS |
correct output |
---|
5 XJ ZX SQ JG ... |
user output |
---|
A: 1 B: 1 C: 0 D: 0 E: 0 ... Truncated |
Test 2
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
SSSSSSSSSS |
correct output |
---|
0 |
user output |
---|
A: 0 B: 0 C: 0 D: 0 E: 0 ... Truncated |
Test 3
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
SETTSESEEE |
correct output |
---|
5 ES ET ES ET ... |
user output |
---|
A: 0 B: 0 C: 0 D: 0 E: 5 ... Truncated |
Test 4
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
SSMRSSSSKR |
correct output |
---|
4 SR SR SM SK |
user output |
---|
A: 0 B: 0 C: 0 D: 0 E: 0 ... Truncated |
Test 5
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
BIIILIIRRL |
correct output |
---|
5 IR IL IR IL ... |
user output |
---|
A: 0 B: 1 C: 0 D: 0 E: 0 ... Truncated |
Test 6
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
YYGEYTDSTY |
correct output |
---|
5 YT YT YS YG ... |
user output |
---|
A: 0 B: 0 C: 0 D: 1 E: 1 ... Truncated |
Test 7
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
MMMMMMMMMN |
correct output |
---|
1 MN |
user output |
---|
A: 0 B: 0 C: 0 D: 0 E: 0 ... Truncated |
Test 8
Group: 2, 3
Verdict: WRONG ANSWER
input |
---|
XQQZJQDDJOWXDFVQUIODDJIZIQDQIW... |
correct output |
---|
500 DQ DQ DQ DQ ... |
user output |
---|
A: 0 B: 44 C: 25 D: 253 E: 0 ... Truncated |
Test 9
Group: 2, 3
Verdict: WRONG ANSWER
input |
---|
IIIIIIIIIIIIIIIIIIIIIIIIIIIIII... |
correct output |
---|
0 |
user output |
---|
A: 0 B: 0 C: 0 D: 0 E: 0 ... Truncated |
Test 10
Group: 2, 3
Verdict: WRONG ANSWER
input |
---|
KEOHHYHHAIHLLHEKIHKAHHHHOHEHHE... |
correct output |
---|
493 HA HA HA HA ... |
user output |
---|
A: 65 B: 0 C: 29 D: 24 E: 53 ... Truncated |
Test 11
Group: 2, 3
Verdict: WRONG ANSWER
input |
---|
WNNFXQNODQFSQVQQPNLQNQNNVVNXHN... |
correct output |
---|
499 NQ NQ NQ NQ ... |
user output |
---|
A: 23 B: 0 C: 0 D: 30 E: 6 ... Truncated |
Test 12
Group: 2, 3
Verdict: WRONG ANSWER
input |
---|
VGAHMMMXMMVXAAMMMOMMMXVMMMYMXT... |
correct output |
---|
500 MH MH MH MH ... |
user output |
---|
A: 48 B: 0 C: 27 D: 8 E: 0 ... Truncated |
Test 13
Group: 2, 3
Verdict: WRONG ANSWER
input |
---|
KKKKUUAKKAUKKKKFKKSVKCWKKKCVOJ... |
correct output |
---|
500 KI KI KI KI ... |
user output |
---|
A: 37 B: 12 C: 36 D: 5 E: 3 ... Truncated |
Test 14
Group: 2, 3
Verdict: WRONG ANSWER
input |
---|
VVVVVVVVVVVVVVVVVVVVVVVVVVVVVV... |
correct output |
---|
100 VP VP VP VP ... |
user output |
---|
A: 0 B: 0 C: 0 D: 0 E: 2 ... Truncated |
Test 15
Group: 3
Verdict: WRONG ANSWER
input |
---|
FKKJJBWTSFCDEKFPOKIPWZSVKHACMC... |
correct output |
---|
100000 CK CK CK CK ... |
user output |
---|
A: 5760 B: 6915 C: 28301 D: 16760 E: 4060 ... Truncated |
Test 16
Group: 3
Verdict: WRONG ANSWER
input |
---|
RRRRRRRRRRRRRRRRRRRRRRRRRRRRRR... |
correct output |
---|
0 |
user output |
---|
A: 0 B: 0 C: 0 D: 0 E: 0 ... Truncated |
Test 17
Group: 3
Verdict: WRONG ANSWER
input |
---|
WVKKVVADNVCVKLVYVVZVKVCTNKVLVV... |
correct output |
---|
99925 VC VC VC VC ... |
user output |
---|
A: 3676 B: 2736 C: 20040 D: 5581 E: 1841 ... Truncated |
Test 18
Group: 3
Verdict: WRONG ANSWER
input |
---|
BBBBBDNXDZQXBBYBBWBSBTMADXBBVZ... |
correct output |
---|
99999 BE BE BE BE ... |
user output |
---|
A: 2481 B: 100001 C: 620 D: 8108 E: 18765 ... Truncated |
Test 19
Group: 3
Verdict: WRONG ANSWER
input |
---|
FBRDPLUMLZMLLLUFUCLEMCMULLZLFL... |
correct output |
---|
100000 LU LU LU LU ... |
user output |
---|
A: 199 B: 2452 C: 10571 D: 5258 E: 2356 ... Truncated |
Test 20
Group: 3
Verdict: WRONG ANSWER
input |
---|
UUBUBUTUJSLUVBUXTUUMUXUXTMXUXS... |
correct output |
---|
100000 UX UX UX UX ... |
user output |
---|
A: 314 B: 10092 C: 408 D: 1260 E: 702 ... Truncated |
Test 21
Group: 3
Verdict: WRONG ANSWER
input |
---|
PPPPPPPPPPEPPPPPPPPPPBOPPPPPPP... |
correct output |
---|
20000 PB PB PB PB ... |
user output |
---|
A: 1596 B: 4934 C: 568 D: 1453 E: 945 ... Truncated |