Task: | Sulut |
Sender: | Username* |
Submission time: | 2024-01-20 15:28:39 +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 | 1, 2, 3 | details |
#9 | WRONG ANSWER | 0.00 s | 1, 2, 3 | details |
#10 | WRONG ANSWER | 0.00 s | 1, 2, 3 | details |
#11 | WRONG ANSWER | 0.00 s | 1, 2, 3 | details |
#12 | WRONG ANSWER | 0.00 s | 1, 2, 3 | details |
#13 | WRONG ANSWER | 0.00 s | 1, 2, 3 | details |
#14 | WRONG ANSWER | 0.00 s | 1, 2, 3 | details |
#15 | WRONG ANSWER | 0.00 s | 1, 2, 3 | details |
#16 | WRONG ANSWER | 0.00 s | 1, 2, 3 | details |
#17 | WRONG ANSWER | 0.00 s | 1, 2, 3 | details |
#18 | WRONG ANSWER | 0.00 s | 1, 2, 3 | details |
#19 | WRONG ANSWER | 0.00 s | 1, 2, 3 | details |
#20 | WRONG ANSWER | 0.00 s | 2, 3 | details |
#21 | WRONG ANSWER | 0.00 s | 2, 3 | details |
#22 | WRONG ANSWER | 0.00 s | 2, 3 | details |
#23 | WRONG ANSWER | 0.00 s | 2, 3 | details |
#24 | WRONG ANSWER | 0.00 s | 2, 3 | details |
#25 | WRONG ANSWER | 0.00 s | 3 | details |
#26 | WRONG ANSWER | 0.00 s | 3 | details |
#27 | WRONG ANSWER | 0.00 s | 3 | details |
#28 | WRONG ANSWER | 0.00 s | 3 | details |
#29 | WRONG ANSWER | 0.00 s | 3 | details |
Compiler report
input/code.cpp: In function 'int main()': input/code.cpp:61:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<char, char> >::size_type' {aka 'long unsigned int'} [-Wsign-compare] 61 | for (int i = 0; i < combs.size(); ++i) { | ~~^~~~~~~~~~~~~~
Code
#include "bits/stdc++.h" typedef long long ll; using namespace std; int main() { string in; cin >> in; //ll size = in.size(); //cout << size << endl; deque<pair<char, int>> q; map<char, int> mp; for (char& c : in) { if(c) mp[c] += 1; } for (auto a : mp) { q.push_back(a); } vector<pair<char, char>> combs; while (!q.empty()) { pair<char, int> p = q.front(); char c = p.first; int n = p.second; //cout << c << ": " << n << endl; /*if(n >= floor(size/2)) { max = floor(mp.size()-1); }*/ q.pop_front(); bool front = false; while (n > 0) { if(q.empty()) { break; } front = !front; auto b = front ? q.front() : q.back(); int j = b.second; //cout << "g " << b.first << ": " << b.second << endl; combs.push_back(make_pair(c, b.first)); n -= 1; j -= 1; front ? q.pop_front() : q.pop_back(); if(j >= 0) { front ? q.push_front(make_pair(b.first, j)) : q.push_back(make_pair(b.first, j)); } if(q.empty()) { break; } } } cout << (combs.size()) << endl; for (int i = 0; i < combs.size(); ++i) { cout << combs[i].first << combs[i].second << endl; } //cout << max << endl; return 0; }
Test details
Test 1
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
2 0 |
correct output |
---|
() () |
user output |
---|
0 |
Test 2
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
4 0 |
correct output |
---|
()() ()() |
user output |
---|
0 |
Test 3
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
4 2 |
correct output |
---|
()() (()) |
user output |
---|
0 |
Test 4
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
6 0 |
correct output |
---|
()()() ()()() |
user output |
---|
0 |
Test 5
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
6 2 |
correct output |
---|
()()() ()(()) |
user output |
---|
0 |
Test 6
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
6 4 |
correct output |
---|
()()() (()()) |
user output |
---|
0 |
Test 7
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
8 0 |
correct output |
---|
()()()() ()()()() |
user output |
---|
0 |
Test 8
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
8 2 |
correct output |
---|
()()()() ()()(()) |
user output |
---|
0 |
Test 9
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
8 4 |
correct output |
---|
()()()() ()(()()) |
user output |
---|
0 |
Test 10
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
8 6 |
correct output |
---|
()()()() (()()()) |
user output |
---|
0 |
Test 11
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
10 0 |
correct output |
---|
()()()()() ()()()()() |
user output |
---|
1 01 |
Test 12
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
10 2 |
correct output |
---|
()()()()() ()()()(()) |
user output |
---|
1 01 |
Test 13
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
10 4 |
correct output |
---|
()()()()() ()()(()()) |
user output |
---|
1 01 |
Test 14
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
10 6 |
correct output |
---|
()()()()() ()(()()()) |
user output |
---|
1 01 |
Test 15
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
10 8 |
correct output |
---|
()()()()() (()()()()) |
user output |
---|
1 01 |
Test 16
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
4 1 |
correct output |
---|
IMPOSSIBLE |
user output |
---|
0 |
Test 17
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
4 4 |
correct output |
---|
IMPOSSIBLE |
user output |
---|
0 |
Test 18
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
5 1 |
correct output |
---|
IMPOSSIBLE |
user output |
---|
0 |
Test 19
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
5 2 |
correct output |
---|
IMPOSSIBLE |
user output |
---|
0 |
Test 20
Group: 2, 3
Verdict: WRONG ANSWER
input |
---|
100 0 |
correct output |
---|
()()()()()()()()()()()()()()()... |
user output |
---|
2 01 01 |
Test 21
Group: 2, 3
Verdict: WRONG ANSWER
input |
---|
100 10 |
correct output |
---|
()()()()()()()()()()()()()()()... |
user output |
---|
2 01 01 |
Test 22
Group: 2, 3
Verdict: WRONG ANSWER
input |
---|
100 42 |
correct output |
---|
()()()()()()()()()()()()()()()... |
user output |
---|
2 01 01 |
Test 23
Group: 2, 3
Verdict: WRONG ANSWER
input |
---|
100 80 |
correct output |
---|
()()()()()()()()()()()()()()()... |
user output |
---|
2 01 01 |
Test 24
Group: 2, 3
Verdict: WRONG ANSWER
input |
---|
100 98 |
correct output |
---|
()()()()()()()()()()()()()()()... |
user output |
---|
2 01 01 |
Test 25
Group: 3
Verdict: WRONG ANSWER
input |
---|
1000000 0 |
correct output |
---|
()()()()()()()()()()()()()()()... |
user output |
---|
2 01 01 |
Test 26
Group: 3
Verdict: WRONG ANSWER
input |
---|
1000000 42 |
correct output |
---|
()()()()()()()()()()()()()()()... |
user output |
---|
2 01 01 |
Test 27
Group: 3
Verdict: WRONG ANSWER
input |
---|
1000000 4242 |
correct output |
---|
()()()()()()()()()()()()()()()... |
user output |
---|
2 01 01 |
Test 28
Group: 3
Verdict: WRONG ANSWER
input |
---|
1000000 424242 |
correct output |
---|
()()()()()()()()()()()()()()()... |
user output |
---|
2 01 01 |
Test 29
Group: 3
Verdict: WRONG ANSWER
input |
---|
1000000 999998 |
correct output |
---|
()()()()()()()()()()()()()()()... |
user output |
---|
2 01 01 |