QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#273063 | #5422. Perfect Palindrome | Ycfhnnd | Compile Error | / | / | C++20 | 438b | 2023-12-02 21:04:10 | 2023-12-02 21:05:02 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
void solve(){
string s;
cin >> s;
vector<int>cnt(26);
for (auto c : s){
cnt[c - 'a'] ++;
}
cout << n - *max_element(cnt.begin(), cnt.end()) << "\n";
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int T = 1;
cin >> T;
while (T --){
solve();
}
return 0;
}
Details
answer.code: In function ‘void solve()’: answer.code:14:13: error: ‘n’ was not declared in this scope 14 | cout << n - *max_element(cnt.begin(), cnt.end()) << "\n"; | ^