結果

問題 No.547 未知の言語
ユーザー Ryota EnokidoRyota Enokido
提出日時 2018-12-13 22:07:46
言語 Java21
(openjdk 21)
結果
AC  
実行時間 138 ms / 2,000 ms
コード長 952 bytes
コンパイル時間 4,064 ms
コンパイル使用メモリ 74,792 KB
実行使用メモリ 51,536 KB
最終ジャッジ日時 2023-10-25 09:39:46
合計ジャッジ時間 10,108 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
39,956 KB
testcase_01 AC 129 ms
41,248 KB
testcase_02 AC 129 ms
41,196 KB
testcase_03 AC 133 ms
41,144 KB
testcase_04 AC 133 ms
41,168 KB
testcase_05 AC 134 ms
41,112 KB
testcase_06 AC 131 ms
40,936 KB
testcase_07 AC 136 ms
41,184 KB
testcase_08 AC 132 ms
41,120 KB
testcase_09 AC 133 ms
41,216 KB
testcase_10 AC 132 ms
41,304 KB
testcase_11 AC 123 ms
39,992 KB
testcase_12 AC 132 ms
41,376 KB
testcase_13 AC 135 ms
41,096 KB
testcase_14 AC 135 ms
41,216 KB
testcase_15 AC 133 ms
41,216 KB
testcase_16 AC 135 ms
41,184 KB
testcase_17 AC 132 ms
41,148 KB
testcase_18 AC 136 ms
41,176 KB
testcase_19 AC 134 ms
41,140 KB
testcase_20 AC 134 ms
41,184 KB
testcase_21 AC 135 ms
41,200 KB
testcase_22 AC 135 ms
41,156 KB
testcase_23 AC 132 ms
41,148 KB
testcase_24 AC 138 ms
51,536 KB
testcase_25 AC 134 ms
41,160 KB
testcase_26 AC 132 ms
41,136 KB
testcase_27 AC 132 ms
41,072 KB
testcase_28 AC 131 ms
41,316 KB
testcase_29 AC 131 ms
41,072 KB
testcase_30 AC 132 ms
41,120 KB
testcase_31 AC 133 ms
41,236 KB
testcase_32 AC 130 ms
40,924 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
import java.lang.Math;
import java.lang.StringBuilder;
import java.util.regex.Pattern;
import java.util.Arrays;


    public class Main {
        public static void main(String[] args) {
            Scanner sc = new Scanner(System.in);
  
            int n = sc.nextInt();
            String[] s = new String[n];
            String[] t = new String[n];
            for(int i=0;i<n;i++){
                s[i] = sc.next();
            }
            
            
            for(int j=0;j<n;j++){
                t[j] = sc.next();
            }
            

            int ans = 1;
            for(int k=0; k<n; k++){
                if(s[k].equalsIgnoreCase(t[k])){
                    ans ++;
                }else{
                    break;
                }
            }
            
            System.out.println(ans);
            System.out.println(s[ans-1]);
            System.out.println(t[ans-1]);
        }
    }
0