Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. /*
  2. 사람들이 매일 어떤 순서에 따라 줄을 선다. 이 사람들은 자신의 왼쪽에 서는 사람의 수 만을 알고 있다.
  3. 사람들의 수가 N일 때, 키는 1 ~ N까지로 각자 다르다. 여기서 각 사람들의 기억이 주어질 때 줄을 서는 순서를 구하라.
  4. */
  5.  
  6. /*아직 풀지 못했다.*/
  7.  
  8. #include <iostream>
  9. using namespace std;
  10.  
  11. int main(void)
  12. {
  13. int num; //인원 수
  14. int memory[10]; //기억하는 왼쪽 사람의 수
  15. int order[10];
  16.  
  17. for (int i = 0; i < num; i++) {
  18. int index = i;
  19.  
  20. while ()
  21. if (order[memory[index] + 1] != NULL) {
  22. index++;
  23. }
  24. order[memory[i] + 1] = memory[i];
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement