結果
問題 |
No.2209 Flip and Reverse
|
ユーザー |
|
提出日時 | 2024-03-15 05:05:50 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 486 bytes |
コンパイル時間 | 1,499 ms |
コンパイル使用メモリ | 167,932 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-09-29 23:58:04 |
合計ジャッジ時間 | 3,042 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 17 WA * 13 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define endl '\n' void solve(){ int n; cin>>n; string s,t; cin>>s>>t; int cnt1 = 0; int cnt2 = 0; for(int i=0;i<n;i++){ cnt1 += s[i] != t[i]; cnt2 += s[n-i-1] != t[i]; } cout<<min(cnt1,cnt2)<<endl; } int main(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int t=1; //cin>>t; while(t--){ solve(); } return 0; }