본문 바로가기
알고리즘/문제풀이

sw expert 1228

by 새싹감자 2022. 8. 8.
package algorithm;

import java.util.ArrayList;
import java.util.Scanner;

public class Solution_1228 {
public static void main(String[] args) {
    Scanner input = new Scanner(System.in);
    for(int test=0; test<10; test++) {


    int N =input.nextInt();
    ArrayList<Integer> originPassword = new ArrayList<>();

    for(int i=0; i<N; i++) {
        originPassword.add(input.nextInt());
        }

    int G = input.nextInt();
    char in=' ';
    int x=0;
    int y=0;
    int num=0;
    ArrayList<Integer> put = new ArrayList<>();
    for(int i=0; i<G; i++) {
        in=input.next().charAt(0);
        x=input.nextInt();
        y=input.nextInt();
        for(int j=0; j<y; j++) {
            num=input.nextInt();
            originPassword.add(x,num);
            x++;
            }
        }

    System.out.printf("#%d ",test+1);
    for(int i=0; i<10; i++) {
        System.out.print(originPassword.get(i)+" ");
    }
    System.out.println();
    originPassword.clear();
    }
}
}

'알고리즘 > 문제풀이' 카테고리의 다른 글

백준 17406  (0) 2022.08.11
백준 2493  (0) 2022.08.09
백준 11650 좌표 정렬하기  (0) 2022.08.03
백준 10826 피보나치 수 4  (0) 2022.08.02
백준 1929 소수 구하기  (0) 2022.08.02

댓글