結果

問題 No.2209 Flip and Reverse
ユーザー achapi
提出日時 2023-02-11 00:22:41
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 860 bytes
コンパイル時間 3,621 ms
コンパイル使用メモリ 251,244 KB
最終ジャッジ日時 2025-02-10 13:48:09
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 17 WA * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
typedef long long ll;
//using mint = modint998244353;
//using mint = modint1000000007;
#define all(...) std::begin(__VA_ARGS__), std::end(__VA_ARGS__)
#define rall(...) std::rbegin(__VA_ARGS__), std::rend(__VA_ARGS__)
#define debug(x) cerr << "\033[33m(line:" << __LINE__ << ") " << #x << ": " << x << "\033[m" << endl;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
template<class T>bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }

int main() {
	int n;cin>>n;
	string s,t;cin>>s>>t;
	int a=0,b=0;
	for(int i=0;i<n;i++){
		if(s[i]!=t[i])a++;
		if(s[n-i-1]!=t[i])b++;
	}
	cout<<min(a,b)<<endl;
}
0