提出 #73489263
ソースコード 拡げる
import java.util.*;
import java.lang.*;
import java.io.*;
public class Main
{
public static boolean check(int[] arr ,int t){
for (int i=0;i<arr.length;i++){
if (arr[i]== t) return false;}
return true;
}
public static void main (String[] args) throws java.lang.Exception
{
Scanner sc = new Scanner(System.in);
int n= sc.nextInt();
int m= sc.nextInt();
int[] order= new int[n];
int q=0;
for (int i=0;i<n;i++){
int l = sc.nextInt();
int[] lu = new int[l];
for(int k=0;k<l;k++) lu[k]= sc.nextInt();
int f=0;
for (int j=0;j<l;j++){
if (check(order,lu[j])){
order[q++]= lu[j];
f++;
break;
}
}
if(f==0) order[q++]= 0;
}
for (int h: order)System.out.println(h);
}
}
提出情報
| 提出日時 | |
|---|---|
| 問題 | B - Greedy Draft |
| ユーザ | Krr1ssh_ |
| 言語 | Java24 (OpenJDK 24.0.2) |
| 得点 | 200 |
| コード長 | 858 Byte |
| 結果 | AC |
| 実行時間 | 151 ms |
| メモリ | 50064 KiB |
ジャッジ結果
| セット名 | Sample | All | ||||
|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 200 / 200 | ||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| 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 | 89 ms | 40324 KiB |
| 00-sample-02.txt | AC | 78 ms | 40668 KiB |
| 01-01.txt | AC | 77 ms | 40268 KiB |
| 01-02.txt | AC | 88 ms | 40192 KiB |
| 01-03.txt | AC | 122 ms | 42692 KiB |
| 01-04.txt | AC | 124 ms | 44988 KiB |
| 01-05.txt | AC | 128 ms | 44504 KiB |
| 01-06.txt | AC | 146 ms | 47988 KiB |
| 01-07.txt | AC | 117 ms | 45264 KiB |
| 01-08.txt | AC | 151 ms | 50064 KiB |
| 01-09.txt | AC | 90 ms | 40736 KiB |
| 01-10.txt | AC | 88 ms | 40640 KiB |
| 01-11.txt | AC | 102 ms | 41352 KiB |
| 01-12.txt | AC | 141 ms | 48052 KiB |
| 01-13.txt | AC | 140 ms | 48200 KiB |
| 01-14.txt | AC | 136 ms | 47048 KiB |
| 01-15.txt | AC | 137 ms | 48228 KiB |
| 01-16.txt | AC | 102 ms | 41604 KiB |
| 01-17.txt | AC | 86 ms | 40928 KiB |
| 01-18.txt | AC | 105 ms | 42452 KiB |