QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#317490 | #7559. Bocchi the Rock | qaqaqaq# | WA | 0ms | 3688kb | C++14 | 1.1kb | 2024-01-29 02:22:25 | 2024-01-29 02:22:25 |
Judging History
answer
#include <iostream>
#include <stdio.h>
using namespace std;
typedef long long ll;
ll a[200005][26];
string s;
int main(int argc, const char * argv[]) {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
ll t;
cin>>t;
while(t--){
ll n;
cin>>n;
cin>>s;
for(ll i=0;i<n;i++){
for(ll j=0;j<26;j++) a[i][j]=0;
a[i][s[i]-'a']++;
if(i!=0){
for(ll j=0;j<26;j++){
a[i][j]+=a[i-1][j];
}
}
}
// for(ll i=0;i<n;i++){
// for(ll j=0;j<26;j++){
// cout<<a[i][j]<<" ";
// }cout<<"\n";
// }
ll ans=0;
for(ll i=0;i+1<n;i++){
ll l1=0;
for(ll j=0;j<26;j++){
if(a[i][j]) l1++;
}
for(ll j=0;j<26;j++){
if(a[i][j]!=a[n-1][j]) l1++;
}
ans=max(ans,l1);
}
cout<<ans<<"\n";
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3688kb
input:
2 ????
output:
0 0
result:
wrong answer 1st numbers differ - expected: '12', found: '0'