結果

問題 No.547 未知の言語
コンテスト
ユーザー OlderInvestor
提出日時 2017-09-19 18:55:23
言語 Java
(openjdk 25.0.2)
コンパイル:
javac -encoding UTF8 _filename_
実行:
java -ea -Xmx700m -Xss256M -DONLINE_JUDGE=true _class_
結果
AC  
実行時間 56 ms / 2,000 ms
コード長 756 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,654 ms
コンパイル使用メモリ 86,004 KB
実行使用メモリ 46,400 KB
最終ジャッジ日時 2026-03-12 16:05:16
合計ジャッジ時間 5,395 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

package yukicoder;

import java.util.Scanner;

public class No547 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String tmp;
        String[] s;

        int n = sc.nextInt();
        s = new String[n];
        for(int i = 0; i < n; i++) {
            s[i] = sc.next();
        }

        int resultNum = 0;
        String resultS = null, resultT = null;
        for(int i = 0; i < n; i++) {
            tmp = sc.next();
            if( !s[i].equals(tmp) ) {
                resultNum = i + 1;
                resultS = s[i];
                resultT = tmp;
            }
        }

        System.out.println(resultNum);
        System.out.println(resultS);
        System.out.println(resultT);
    }
}
0