Task: | Anagrams |
Sender: | niketin |
Submission time: | 2020-09-26 13:29:02 +0300 |
Language: | C++ (C++17) |
Status: | READY |
Result: | WRONG ANSWER |
test | verdict | time | |
---|---|---|---|
#1 | WRONG ANSWER | 0.12 s | details |
#2 | WRONG ANSWER | 0.60 s | details |
#3 | WRONG ANSWER | 0.21 s | details |
#4 | WRONG ANSWER | 0.63 s | details |
#5 | WRONG ANSWER | 0.60 s | details |
#6 | WRONG ANSWER | 0.60 s | details |
#7 | WRONG ANSWER | 0.01 s | details |
#8 | WRONG ANSWER | 0.01 s | details |
#9 | WRONG ANSWER | 0.01 s | details |
Compiler report
input/code.cpp: In function 'int main()': input/code.cpp:22:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (llu j = 0;j<s.size(); ++j){ ~^~~~~~~~~
Code
#include <iostream> #include <algorithm> #include <string> #include <bits/stdc++.h> #define N 1000000 using namespace std; using llu = long long signed; map<llu, vector<string>> m; int main() { llu n; string s; cin >> n; for (llu i = 0;i<n;++i){ cin >> s; llu sum = 0; for (llu j = 0;j<s.size(); ++j){ sum += s[j]; } if (m.find(sum) == m.end()) { m[sum] = vector<string>(); } m[sum].push_back(s); } for (auto const& x : m) { std::cout << x.second.size() << endl; for (auto const& y : x.second) { std::cout << y << endl; } } return 0; }
Test details
Test 1
Verdict: WRONG ANSWER
input |
---|
68760 aakkonen aakkosellinen aakkosellisesti aakkosellisuus ... |
correct output |
---|
3076 2 haaraantua raahaantua 2 ... |
user output |
---|
2 ah ha 1 ai ... Truncated |
Test 2
Verdict: WRONG ANSWER
input |
---|
370099 a aa aaa aah ... |
correct output |
---|
30178 2 basiparachromatin marsipobranchiata 2 ... |
user output |
---|
1 a 1 b 1 ... Truncated |
Test 3
Verdict: WRONG ANSWER
input |
---|
100000 cnhmuewgnum dxkmhzhetnmxadtcy hfjqwavsiguwpludsketibe xwxolrmvkz ... |
correct output |
---|
0 |
user output |
---|
1 a 1 b 1 ... Truncated |
Test 4
Verdict: WRONG ANSWER
input |
---|
400000 vlcsa eltwde wdcwwkubs tmuxbirj ... |
correct output |
---|
0 |
user output |
---|
1 a 1 b 1 ... Truncated |
Test 5
Verdict: WRONG ANSWER
input |
---|
400000 ebhfigdacjlk aecfdijlhkgb jfekhbidacgl cehajbidfklg ... |
correct output |
---|
1 400000 abcdeighjlfk abcdeiglhfjk abcdfkilejgh ... |
user output |
---|
400000 ebhfigdacjlk aecfdijlhkgb jfekhbidacgl cehajbidfklg ... Truncated |
Test 6
Verdict: WRONG ANSWER
input |
---|
400000 cbaabghadefb hbbgfaeabdac abaedcbgfbha hcfadbbbeaag ... |
correct output |
---|
1 400000 aaabbbcfegdh aaabbbcfghed aaabbbdcgfhe ... |
user output |
---|
400000 cbaabghadefb hbbgfaeabdac abaedcbgfbha hcfadbbbeaag ... Truncated |
Test 7
Verdict: WRONG ANSWER
input |
---|
1 a |
correct output |
---|
0 |
user output |
---|
1 a |
Test 8
Verdict: WRONG ANSWER
input |
---|
2 ab ba |
correct output |
---|
1 2 ab ba |
user output |
---|
2 ab ba |
Test 9
Verdict: WRONG ANSWER
input |
---|
2 aa ab |
correct output |
---|
0 |
user output |
---|
1 aa 1 ab |