Task: | Ositus |
Sender: | Nikedi |
Submission time: | 2021-10-11 19:27:01 +0300 |
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.01 s | 1, 2, 3 | details |
#2 | WRONG ANSWER | 0.01 s | 1, 2, 3 | details |
#3 | WRONG ANSWER | 0.01 s | 1, 2, 3 | details |
#4 | WRONG ANSWER | 0.01 s | 1, 2, 3 | details |
#5 | WRONG ANSWER | 0.01 s | 2, 3 | details |
#6 | WRONG ANSWER | 0.08 s | 3 | details |
#7 | WRONG ANSWER | 0.03 s | 3 | details |
Compiler report
input/code.cpp: In function 'int main()': input/code.cpp:17:24: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int i=0; i < x.size()-1;++i){ ~~^~~~~~~~~~~~ input/code.cpp:26:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int k=0;k<vv.size()-1;++k){ ~^~~~~~~~~~~~
Code
#include <iostream> #include <cmath> #include <vector> #include <set> using namespace std; int main(){ //cin.sync_with_stdio(false); //cin.tie(0); vector<vector<string>> v; string x; long long m = pow(10,9)+7; //10^9+7 cin >> x; for (long long joukko = 0; joukko < (1<<(x.size()-1)); ++joukko){ v.push_back({}); vector<long long> vv; for(int i=0; i < x.size()-1;++i){ if(joukko&(1<<i)) vv.push_back(i); } if(vv.size()>0) { //cout << "|" << joukko << "|" << endl; // cout << x.substr(0,vv[0]+1) <<"."; v[joukko].push_back(x.substr(0,vv[0]+1)); for(int k=0;k<vv.size()-1;++k){ //cout << vv[k] << endl; // cout << x.substr(vv[k]+1,vv[k+1]-vv[k]) <<"#"; v[joukko].push_back(x.substr(vv[k]+1,vv[k+1]-vv[k])); } // cout << x.substr(vv[vv.size()-1]+1,x.size()-vv[vv.size()-1]) <<","; v[joukko].push_back(x.substr(vv[vv.size()-1]+1,x.size()-vv[vv.size()-1])); // cout << endl; // for(auto y:vv) // cout << y << " " << vv.size()<<endl; // cout << endl; } } /* for(auto z:v) { for(auto c:z) cout << c << " " <<endl; cout << endl; }*/ int totalCount = 0; bool breaking = false; for(auto jako:v) { for(auto sana:jako) { multiset<char> setti; for(auto kirjain:sana){ setti.insert(kirjain); } for(auto kirjain:setti){ if(setti.count(kirjain)>1) { totalCount--; breaking = true; break; } } //cout <<endl; if(breaking) continue; } totalCount++; } if(x.size() > 1) totalCount--; cout << totalCount % m; }
Test details
Test 1
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
a |
correct output |
---|
1 |
user output |
---|
1 |
Test 2
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
abcdefghij |
correct output |
---|
512 |
user output |
---|
511 |
Test 3
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
abcabaacbc |
correct output |
---|
120 |
user output |
---|
32 |
Test 4
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
aaxxxxxxaa |
correct output |
---|
4 |
user output |
---|
-640 |
Test 5
Group: 2, 3
Verdict: WRONG ANSWER
input |
---|
mfyzvoxmppoxcvktmcjkryyocfweub... |
correct output |
---|
643221148 |
user output |
---|
-14 |
Test 6
Group: 3
Verdict: WRONG ANSWER
input |
---|
weinscqmmpgbrlboocvtbptgbahmwv... |
correct output |
---|
831644159 |
user output |
---|
-21898 |
Test 7
Group: 3
Verdict: WRONG ANSWER
input |
---|
sxaoxcyrjoeieyinaqxwukgzdnhhsw... |
correct output |
---|
816016015 |
user output |
---|
-1 |