QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#297659#5722. Rainbow StringsjparkTL 0ms0kbC++14574b2024-01-04 21:59:412024-01-04 21:59:42

Judging History

你现在查看的是最新测评结果

  • [2024-01-04 21:59:42]
  • 评测
  • 测评结果:TL
  • 用时:0ms
  • 内存:0kb
  • [2024-01-04 21:59:41]
  • 提交

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

output:


result: