단순한 구현문제, 별 다른 기술이 필요한 것이 아니고 문제를 잘 이해하고 구현하는게 핵심인 듯하다.
각 칸의 hp를 저장할 배열 하나, 각 칸에 로봇이 있는지 없는지 나타낼 배열 하나, 컨베이어 벨트 위에 올라간 로봇의 위치 정보를 차례대로 담을 큐 하나를 활용한다.
로봇을 옮기는 과정 순서를 보면
벨트가 각 칸 위에 있는 로봇과 함께 한 칸 회전한다.
           for (int i = 0; i < len; i++) {
               int cur = q.poll();
               int next_pos = 0;
               is_robot[cur] = 0;
               if (cur + 1 == 2 * n)
                   next_pos = 0;
               else
                   next_pos = cur + 1;
               if(next_pos == n-1)
                   continue;
               q.add(next_pos);
               is_robot[next_pos] = 1;
           }```가장 먼저 벨트에 올라간 로봇부터, 벨트가 회전하는 방향으로 한 칸 이동할 수 있다면 이동한다. 만약 이동할 수 없다면 가만히 있는다.
※내가 한 실수
    import java.io.*;
    import java.util.*;
    public class Main {
        static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        static BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
        public static void main(String[] args) throws IOException {
            StringTokenizer st = new StringTokenizer(br.readLine());
            int n = Integer.parseInt(st.nextToken());
            int k = Integer.parseInt(st.nextToken());
            int []hp=  new int [2*n];
            int []is_robot=  new int [2*n];
            st = new StringTokenizer(br.readLine());
            for(int i=0;i<2*n;i++)
            {
                hp[i] = Integer.parseInt(st.nextToken());
            }
            Queue<Integer> q = new LinkedList<>();
            int cnt = 0;
            while(k>=1) {
                cnt++;
                int tmp = hp[2 * n - 1];
                for (int i = 2 * n - 1; i >= 1; i--) {
                    hp[i] = hp[i - 1];
                }
                hp[0] = tmp;
                int len = q.size();
                for (int i = 0; i < len; i++) {
                    int cur = q.poll();
                    int next_pos = 0;
                    is_robot[cur] = 0;
                    if (cur + 1 == 2 * n)
                        next_pos = 0;
                    else
                        next_pos = cur + 1;
                    if(next_pos == n-1)
                        continue;
                    q.add(next_pos);
                    is_robot[next_pos] = 1;
                }
                len = q.size();
                for (int i = 0; i < len; i++) {
                    int cur = q.poll();
                    is_robot[cur] = 0;
                    int next_pos = 0;
                    if (cur + 1 != 2 * n)
                        next_pos = cur + 1;
                    if (is_robot[next_pos] != 1 && hp[next_pos] >= 1) {
                        hp[next_pos]--;
                        if(hp[next_pos]==0)
                            k--;
                        if(next_pos == n-1)
                            continue;
                        q.add(next_pos);
                        is_robot[next_pos] = 1;
                    }
                    else
                    {
                        is_robot[cur] =1;
                        q.add(cur);
                    }
                }
                if (hp[0] != 0) {
                    q.add(0);
                    is_robot[0] = 1;
                    hp[0]--;
                    if(hp[0] == 0)
                        k--;
                }
                int check = 0;
            }
            bw.write(Integer.toString(cnt));
            bw.flush();
        }
    }