結果

問題 No.2209 Flip and Reverse
ユーザー shirokamishirokami
提出日時 2023-02-10 21:32:44
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,693 bytes
コンパイル時間 3,118 ms
コンパイル使用メモリ 247,812 KB
実行使用メモリ 5,648 KB
最終ジャッジ日時 2023-09-21 22:36:05
合計ジャッジ時間 5,106 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 WA -
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 1 ms
4,376 KB
testcase_12 AC 2 ms
4,376 KB
testcase_13 WA -
testcase_14 AC 17 ms
5,448 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 17 ms
5,408 KB
testcase_19 AC 17 ms
5,452 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 17 ms
5,376 KB
testcase_24 AC 15 ms
5,588 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 8 ms
5,352 KB
testcase_29 AC 8 ms
5,404 KB
testcase_30 AC 9 ms
5,452 KB
testcase_31 WA -
testcase_32 AC 9 ms
5,412 KB
testcase_33 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
// #include<ext/pb_ds/assoc_container.hpp>
// #include<ext/pb_ds/tree_policy.hpp>
// #include<ext/pb_ds/tag_and_trait.hpp>
// using namespace __gnu_pbds;
// #include <boost/math/tools/minima.hpp>
// #include <boost/multiprecision/cpp_int.hpp>
// namespace mp = boost::multiprecision;
// #include <atcoder/all>
// using namespace atcoder;
// https://atcoder.github.io/ac-library/production/document_ja/
typedef long long int ll;
typedef long double ld;
const ll mod = 1e9+7;
const ll INF = 922337203685477580;
#define rep(i,n) for (ll i = 0; i < (n); ++i)
#define Rep(i,a,n) for (ll i = (a); i < (n); ++i)
#define All(a) (a).begin(),(a).end()
#define Pi acos(-1)
using V = vector<ll>;
using P = pair<ll,ll>;
vector<ll> dx = {1, 0, -1, 0, 1, 1, -1, -1};
vector<ll> dy = {0, 1, 0, -1, 1, -1, 1, -1};
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; }
struct edge{ll to, cost;};
using graph = vector<vector<edge> >;
struct IoSetup {
  IoSetup() {
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout << setprecision(15) << fixed;
  }
} iosetup;
void printvec(vector<ll> a) {
  for(ll i = 0; i < a.size(); i++) {
    cout << a[i] << ' ';
  }
  cout << '\n';
}
void printgrid(vector<vector<ll>> g) {
  for (ll i = 0; i < g.size(); i++) {
    printvec(g[i]);
  }
}

int main() {
  ll n;
  cin >> n;
  string s, t;
  cin >> s >> t;
  ll ans = 0;
  rep(i,n) {
    if (s[i] != t[i]) ans++;
  }
  reverse(All(s));
  ll tmp = 0;
  rep(i,n) {
    if (s[i] != t[i]) tmp++;
  }
  chmin(ans, tmp);
  cout << ans << '\n';
}
0