結果
| 問題 | No.3774 Minimum Cost For Palindrome |
| コンテスト | |
| ユーザー |
👑 |
| 提出日時 | 2026-10-23 22:12:19 |
| 言語 | C++23 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 4 ms / 2,000 ms |
| + 382µs | |
| コード長 | 745 bytes |
| 記録 | |
| コンパイル時間 | 5,234 ms |
| コンパイル使用メモリ | 377,384 KB |
| 実行使用メモリ | 9,872 KB |
| 最終ジャッジ日時 | 2026-10-23 22:12:27 |
| 合計ジャッジ時間 | 7,355 ms |
|
ジャッジサーバーID (参考情報) |
judge5_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 20 |
ソースコード
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using ll = long long;
#define rep(i, a, b) for (ll i = a; i < b; ++i)
#define rrep(i, a, b) for (ll i = a; i >= b; --i)
// --- 初期設定(入出力の高速化と小数15桁出力) ---
struct Init {
Init() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout << fixed << setprecision(15);
}
} init;
// ------------------------------------------------
int main() {
string s;
cin >> s;
ll front = 0;
ll back = s.size() - 1;
ll ans = 0;
while(front < back){
if(s[front] != s[back]){
++ans;
}
++front;
--back;
}
cout << ans << "\n";
return 0;
}
// Pre-written library: https://github.com/ssmbc2929bartok/cp-env