結果

問題 No.273 回文分解
ユーザー moti
提出日時 2015-08-31 15:20:34
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 420 bytes
コンパイル時間 563 ms
コンパイル使用メモリ 56,644 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-12-23 11:54:47
合計ジャッジ時間 1,534 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 2
other AC * 7 WA * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;
int main() {
int a[128]={};
string s; cin >> s;
if(s.size() == 2 && s[0] == s[1]) { cout << 1 << endl; return 0; }
for(int i=0; i<s.size(); i++) {
if(s[i] >= 'A' && s[i] <= 'Z') { a[s[i]]++; }
}
int cnt = 0;
for(int i=0; i<128; i++) {
cnt += a[i] / 2 * 2;
}
for(int i=0; i<128; i++) {
if(a[i] % 2 == 1) {
cnt++; cout << cnt << endl; return 0;
}
}
cout << cnt << endl;
return 0;
}
0