結果

問題 No.2209 Flip and Reverse
ユーザー AsahiAsahi
提出日時 2023-02-10 23:03:17
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,273 bytes
コンパイル時間 3,199 ms
コンパイル使用メモリ 78,040 KB
実行使用メモリ 65,608 KB
最終ジャッジ日時 2023-09-22 00:10:33
合計ジャッジ時間 14,816 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
55,740 KB
testcase_01 AC 130 ms
55,584 KB
testcase_02 AC 129 ms
55,816 KB
testcase_03 AC 127 ms
55,748 KB
testcase_04 AC 128 ms
55,828 KB
testcase_05 AC 125 ms
55,580 KB
testcase_06 AC 127 ms
55,832 KB
testcase_07 AC 126 ms
56,012 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 127 ms
55,712 KB
testcase_11 WA -
testcase_12 AC 136 ms
56,036 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 364 ms
64,460 KB
testcase_33 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.io.*;
import java.math.*;
import java.util.stream.Stream;

public class Main{

    static  PrintWriter output;
    static  Scanner sc;

    static void solve(){
        int n = ni();
        String s = ns();
        String t = ns();
        int ans = 0;
        for(int i=0;i<n;i++) {
            if(s.charAt(i) != t.charAt(i)) {
                ans++;
                if(s.charAt(i) != t.charAt(n-i-1)) {
                    ans++;
                }
            }
        }
        output.print(ans/2);
    }

    public static void main(String[] args) throws IOException{
        output = new PrintWriter(System.out);
        sc = new Scanner(System.in);
        solve();
        output.flush();
    }
    static int ni(){ return sc.nextInt();}
    static long nl(){ return sc.nextLong();}
    static String ns(){return sc.next();}
    static BigInteger bi(){return sc.nextBigInteger();}
    static BigDecimal bd(){return sc.nextBigDecimal();}
    static Map<Long,Integer> counter(long [] A) {
        HashMap<Long,Integer> count = new HashMap<>();
        for(int i=0;i<A.length;i++) {
            if(!count.containsKey(A[i])) count.put(A[i],1);
            else count.put(A[i],count.get(A[i])+1);
        }
        return count;
    }
}
0