提出 #73487228


ソースコード 拡げる

import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner k = new Scanner(System.in);
        int N = k.nextInt();
        int M = k.nextInt();
        StringBuilder sb = new StringBuilder();
        Set<Integer>set = new HashSet<>();
        for(int i=0;i<N;i++){
            int n = k.nextInt();
            int ans = 0;
            for(int j=0;j<n;j++){
                int val = k.nextInt();
                if(!set.contains(val)&& ans==0){
                    ans = val;
                    set.add(val);
                }
            }
            sb.append(ans).append("\n");
        }
        System.out.print(sb.toString());
    }
}

提出情報

提出日時
問題 B - Greedy Draft
ユーザ Madhavan13
言語 Java24 (OpenJDK 24.0.2)
得点 200
コード長 710 Byte
結果 AC
実行時間 133 ms
メモリ 49928 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 200 / 200
結果
AC × 2
AC × 20
セット名 テストケース
Sample 00-sample-01.txt, 00-sample-02.txt
All 00-sample-01.txt, 00-sample-02.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt, 01-10.txt, 01-11.txt, 01-12.txt, 01-13.txt, 01-14.txt, 01-15.txt, 01-16.txt, 01-17.txt, 01-18.txt
ケース名 結果 実行時間 メモリ
00-sample-01.txt AC 79 ms 40420 KiB
00-sample-02.txt AC 71 ms 40320 KiB
01-01.txt AC 70 ms 40624 KiB
01-02.txt AC 72 ms 40172 KiB
01-03.txt AC 105 ms 42780 KiB
01-04.txt AC 115 ms 44900 KiB
01-05.txt AC 114 ms 43980 KiB
01-06.txt AC 128 ms 47896 KiB
01-07.txt AC 114 ms 44744 KiB
01-08.txt AC 133 ms 49928 KiB
01-09.txt AC 76 ms 40136 KiB
01-10.txt AC 75 ms 40788 KiB
01-11.txt AC 91 ms 40928 KiB
01-12.txt AC 127 ms 47864 KiB
01-13.txt AC 125 ms 48084 KiB
01-14.txt AC 114 ms 46852 KiB
01-15.txt AC 128 ms 47920 KiB
01-16.txt AC 94 ms 41248 KiB
01-17.txt AC 77 ms 40440 KiB
01-18.txt AC 102 ms 43108 KiB