結果

問題 No.3774 Minimum Cost For Palindrome
コンテスト
ユーザー かかし
提出日時 2026-10-23 22:03:09
言語 C++23(gcc16)
(gcc 16.2.0 + boost 1.92.0 + ACL)
コンパイル:
g++-16 -O2 -lm -std=c++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 19 ms / 2,000 ms
+ 38µs
コード長 1,519 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,205 ms
コンパイル使用メモリ 232,324 KB
実行使用メモリ 9,856 KB
最終ジャッジ日時 2026-10-23 22:04:49
合計ジャッジ時間 4,781 ms
ジャッジサーバーID
(参考情報)
judge6_0 / judge4_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <numeric>
#include <functional>
#include <tuple>
#include <limits>
#include <deque>
#include <unordered_set>
#include <unordered_map>
#include <cstring>
#include <sstream>
#include <utility>
#include <bitset>
#include <array>
#include <cstdint>
#include <cassert>
#include <cmath>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);++i)
#define REP(i,l,r) for(int i=l;i<(r);++i)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define el "\n"
using ll = long long;
using lb = long double;
using vi = vector<int>;
using vll = vector<ll>;
using vb = vector<bool>;
using vs = vector<string>;
const ll INF = (1LL<<60);
template<class T> using pq=priority_queue<T>;
template<class T> using pq_=priority_queue<T,vector<T>,greater<T>>;
template<class T> inline bool chmin(T&a,T b){if(a>=b){a=b;return true;}return false;};
template<class T> inline bool chmax(T&a,T b){if(a<=b){a=b;return true;}return false;};
const int dr4[4]={-1,0,1,0};const int dc4[4]={0,1,0,-1};
const int dr8[8]={-1,-1,-1,0,1,1,1,0};const int dc8[8]={-1,0,1,1,1,0,-1,-1};
//上右下左//左上上右上右右下下左下左



int main(){


    string s;cin >> s;
    int ans=0;
    for(int i=0;i<s.size()/2;i++){
            if(s[i]!=s[s.size()-1-i]){
                ans++;
            }
        }
    cout<< ans <<el;
    
    return 0;
}
0