SWEA 5431 민석이의 과제 체크하기

1 개요[ | ]

SWEA 5431 민석이의 과제 체크하기
SW Expert 아카데미
# 문제 풀이

틀:SWEA 난이도 3-2

2 C++[ | ]

3 Java[ | ]

import java.io.*;
import java.util.*; 
class Solution 
{
    static int T, tc;
    static int N, K;
    static int i;
    static int[] submit;
    public static void main (String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
        T = sc.nextInt();
        for(tc=1; tc<=T; tc++) {
            bw.write(String.format("#%d", tc));
            N = sc.nextInt();
            K = sc.nextInt();
            submit = new int[N+1];
            for(i=1; i<=K; i++) {
                submit[sc.nextInt()] = 1;
            }
            for(i=1; i<=N; i++) {
                if( submit[i] == 1 ) continue;
                bw.write(String.format(" %d", i));
            }
            bw.newLine();
        }
        bw.flush();
        sc.close();
    } 
}
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}