結果

問題 No.2209 Flip and Reverse
ユーザー achapiachapi
提出日時 2023-02-11 00:39:00
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 44 ms / 2,000 ms
コード長 895 bytes
コンパイル時間 4,660 ms
コンパイル使用メモリ 260,632 KB
実行使用メモリ 7,252 KB
最終ジャッジ日時 2023-09-22 01:19:42
合計ジャッジ時間 6,538 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,384 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 40 ms
6,936 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 1 ms
4,376 KB
testcase_12 AC 2 ms
4,380 KB
testcase_13 AC 1 ms
4,380 KB
testcase_14 AC 44 ms
7,004 KB
testcase_15 AC 44 ms
6,928 KB
testcase_16 AC 44 ms
6,928 KB
testcase_17 AC 44 ms
7,068 KB
testcase_18 AC 44 ms
7,072 KB
testcase_19 AC 44 ms
6,996 KB
testcase_20 AC 44 ms
6,984 KB
testcase_21 AC 44 ms
7,056 KB
testcase_22 AC 44 ms
6,928 KB
testcase_23 AC 44 ms
6,924 KB
testcase_24 AC 43 ms
6,936 KB
testcase_25 AC 43 ms
7,064 KB
testcase_26 AC 43 ms
6,924 KB
testcase_27 AC 43 ms
7,000 KB
testcase_28 AC 40 ms
6,928 KB
testcase_29 AC 40 ms
6,988 KB
testcase_30 AC 40 ms
7,052 KB
testcase_31 AC 40 ms
6,984 KB
testcase_32 AC 40 ms
6,932 KB
testcase_33 AC 40 ms
7,252 KB
権限があれば一括ダウンロードができます

ソースコード

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++;
	}
	if(a%2==0){
		cout<<a<<endl;
	}else{
		cout<<b<<endl;
	}
}
0