結果
| 問題 |
No.2209 Flip and Reverse
|
| コンテスト | |
| ユーザー |
chro_96
|
| 提出日時 | 2023-02-10 21:31:42 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 20 ms / 2,000 ms |
| コード長 | 433 bytes |
| コンパイル時間 | 529 ms |
| コンパイル使用メモリ | 29,568 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-07 15:42:44 |
| 合計ジャッジ時間 | 2,374 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 30 |
ソースコード
#include <stdio.h>
int main () {
int n = 0;
char s[1000001] = "";
char t[1000001] = "";
int res = 0;
int ans = 0;
int tmp = 0;
res = scanf("%d", &n);
res = scanf("%s", s);
res = scanf("%s", t);
for (int i = 0; i < n; i++) {
if (s[i] != t[i]) {
ans++;
}
if (s[i] != t[n-i-1]) {
tmp++;
}
}
if (ans%2 == 1) {
ans = tmp;
}
printf("%d\n", ans);
return 0;
}
chro_96