結果

問題 No.2209 Flip and Reverse
ユーザー daiotadaiota
提出日時 2023-02-11 08:54:19
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 17 ms / 2,000 ms
コード長 485 bytes
コンパイル時間 1,578 ms
コンパイル使用メモリ 165,080 KB
実行使用メモリ 6,180 KB
最終ジャッジ日時 2023-09-22 07:50:24
合計ジャッジ時間 4,061 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 8 ms
6,084 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 1 ms
4,384 KB
testcase_12 AC 1 ms
4,376 KB
testcase_13 AC 1 ms
4,380 KB
testcase_14 AC 17 ms
6,088 KB
testcase_15 AC 17 ms
6,152 KB
testcase_16 AC 17 ms
6,096 KB
testcase_17 AC 17 ms
6,176 KB
testcase_18 AC 12 ms
6,172 KB
testcase_19 AC 12 ms
6,168 KB
testcase_20 AC 17 ms
6,088 KB
testcase_21 AC 17 ms
6,160 KB
testcase_22 AC 17 ms
6,096 KB
testcase_23 AC 12 ms
6,180 KB
testcase_24 AC 11 ms
6,172 KB
testcase_25 AC 15 ms
6,104 KB
testcase_26 AC 12 ms
6,164 KB
testcase_27 AC 11 ms
6,152 KB
testcase_28 AC 9 ms
6,148 KB
testcase_29 AC 8 ms
6,092 KB
testcase_30 AC 8 ms
6,104 KB
testcase_31 AC 9 ms
6,148 KB
testcase_32 AC 8 ms
6,156 KB
testcase_33 AC 8 ms
6,096 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<ll,ll> P;
#define REP(i,n) for(ll i=0;i<ll(n);i++)

int a[110];

int main(void){
	cin.tie(nullptr);  ios_base::sync_with_stdio(false);
	int i,j,k;

	int N;
	string S,T,t;
	cin >> N >> S >> T;

	t=T;
	reverse(t.begin(),t.end());

	int c=0,d=0,ans=0;
	for(i=0;i<N;i++) if(S[i]!=T[i]) c++;

	if(c%2==0) ans=c;
	else{
		for(i=0;i<N;i++) if(S[i]!=t[i]) d++;
		ans=d;
	}

	cout << ans << endl;

	return 0;
}
0