게임 개발 메모장
21. 마라톤 본문
#include <iostream>
using namespace std;
int main()
{
int n,m;
cin >> n;
int ResultArray[10000] = {0,};
int PlayerArray[10000] = {0,};
for (int i = 0; i < n; ++i)
{
cin >> m;
PlayerArray[i] = m;
ResultArray[i] = 1;
}
int Max = 0;
bool IsCount = true;
cout << "1 ";
for (int i = 2; PlayerArray[i] != 0; ++i)
{
Max = PlayerArray[i];
for (int j = i - 1; j >= 0; --j)
{
if (Max < PlayerArray[j])
{
ResultArray[i]++;
}
}
}
for (int i = 1; ResultArray[i] != 0; ++i)
{
cout << ResultArray[i] << " ";
}
}
'문제 해결력 훈련' 카테고리의 다른 글
23. N!에서 0의 개수 (0) | 2024.01.09 |
---|---|
22. N!의 표현법 (0) | 2024.01.09 |
20. 석차 구하기 (0) | 2024.01.09 |
19. Jolly Jumpers (0) | 2024.01.09 |
18. 연속 부분 증가 수열 (0) | 2024.01.09 |