QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#297659 | #5722. Rainbow Strings | jpark | TL | 0ms | 0kb | C++14 | 574b | 2024-01-04 21:59:41 | 2024-01-04 21:59:42 |
answer
#include<iostream>
#include<string>
using namespace std;
int main(){
string s; cin >> s;
long long ans = 0;
int charc[200];
for(int i=0; i<200; ++i){
charc[i] = 0;
}
for(int i=0; i<s.size(); ++i){
++charc[s[i]];
}
for(int i=0; i<(1<<26); ++i){
long long prod = 1;
for(int j=0; j<26; ++j){
if(i&(1<<j)){
prod *= charc[j+'a'];
prod %= 11092019;
}
}
ans += prod;
ans %= 11092019;
}
cout << ans;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Time Limit Exceeded
input:
aab