結果
問題 | No.2209 Flip and Reverse |
ユーザー | keisuke6 |
提出日時 | 2023-02-10 21:23:22 |
言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 46 ms / 2,000 ms |
コード長 | 335 bytes |
コンパイル時間 | 1,847 ms |
コンパイル使用メモリ | 201,360 KB |
実行使用メモリ | 7,184 KB |
最終ジャッジ日時 | 2024-07-07 15:30:46 |
合計ジャッジ時間 | 4,029 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 30 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define int long long signed main(){ int N; cin>>N; string S,T; cin>>S>>T; int a = 0, b = 0; for(int i=0;i<N;i++){ a += (S[i] != T[i]); b += (S[i] != T[N-i-1]); } int ans = 1e18; if(a%2 == 0) ans = min(ans,a); if(b%2) ans = min(ans,b); cout<<ans<<endl; }