You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ArrayList<Integer> persons = new ArrayList();
int cur =K-1;
while (persons.size() >1) {
builder.append(persons.get(cur).toString()+", ");
persons.remove(cur);
int cnt =0;
int pos = cur -1;
while (cnt <K) { // K 만큼 움직인다
cnt++;
// 범위를 벗어나면 다시 0으로 pos 를 옮긴다if (pos >= persons.size() -1) {
pos =0;
} else pos++;
}
cur = pos;
}
The text was updated successfully, but these errors were encountered:
백준 11866 요세푸스 문제 0
[문제유형] 자료구조
https://www.acmicpc.net/problem/11866
주요 로직
The text was updated successfully, but these errors were encountered: