結果
| 問題 | No.224 文字列変更(easy) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-12-06 08:21:55 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 54 ms / 5,000 ms |
| コード長 | 1,016 bytes |
| 記録 | |
| コンパイル時間 | 2,446 ms |
| コンパイル使用メモリ | 76,660 KB |
| 実行使用メモリ | 43,708 KB |
| 最終ジャッジ日時 | 2025-12-06 08:22:01 |
| 合計ジャッジ時間 | 4,499 ms |
|
ジャッジサーバーID (参考情報) |
judge6 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 22 |
ソースコード
import java.io.*;
class Process {
private String S;
private String T;
Process(String S, String T) {
this.S = S;
this.T = T;
}
int getResult() {
int count = 0;
for(int i = 0; i < S.length(); i++) {
if(S.charAt(i) != T.charAt(i)) {
count++;
}
}
return count;
}
}
public class Main {
public static void main(String[] args) throws IOException {
var bufferedReader = new BufferedReader(new InputStreamReader(System.in));
var printWriter = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
// 入力
int n = Integer.parseInt(bufferedReader.readLine().trim());
String S = bufferedReader.readLine().trim();
String T = bufferedReader.readLine().trim();
// 処理および出力
printWriter.println((new Process(S, T)).getResult());
bufferedReader.close();
printWriter.close();
}
}