Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- 사람들이 매일 어떤 순서에 따라 줄을 선다. 이 사람들은 자신의 왼쪽에 서는 사람의 수 만을 알고 있다.
- 사람들의 수가 N일 때, 키는 1 ~ N까지로 각자 다르다. 여기서 각 사람들의 기억이 주어질 때 줄을 서는 순서를 구하라.
- */
- /*아직 풀지 못했다.*/
- #include <iostream>
- using namespace std;
- int main(void)
- {
- int num; //인원 수
- int memory[10]; //기억하는 왼쪽 사람의 수
- int order[10];
- for (int i = 0; i < num; i++) {
- int index = i;
- while ()
- if (order[memory[index] + 1] != NULL) {
- index++;
- }
- order[memory[i] + 1] = memory[i];
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement