結果

問題 No.2714 Amaou
ユーザー sysnote8main
提出日時 2024-04-11 22:10:16
言語 Java
(openjdk 23)
結果
AC  
実行時間 169 ms / 2,000 ms
コード長 718 bytes
コンパイル時間 2,446 ms
コンパイル使用メモリ 77,664 KB
実行使用メモリ 41,920 KB
最終ジャッジ日時 2024-10-02 21:43:13
合計ジャッジ時間 7,994 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Main {
    private static List<String> amaouPattern = Arrays.asList("akai", "marui", "okii", "umai");
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int cnt = 0;
        for (int i = 0; i < n; i++) {
            List<String> strList = new ArrayList<>();
            for (int j = 0; j < 4; j++) {
                strList.add(sc.next());
            }
            Collections.sort(strList);
            if(strList.equals(amaouPattern)) cnt++;
        }
        System.out.println(cnt);
    }
}
0