-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
Description
SORTGAME self review 
1. ํด๊ฒฐ ์๋ ๊ณผ์
๋ฌธ์ ํ์ด๋ฅผ ์ํ ์ผ๋ฐํ๋ฅผ ๋จผ์ ์๋ํ์์ต๋๋ค.
2. ์์ฑํ ์ฝ๋์ ์ค๋ช
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
int c, n;
cin >> c;
while (c--) {
cin >> n;
vector <int> v(n);
string s = "";
for (int i = 0; i < n; i++) {
cin >> v[i];
}
for (int i = 0; i < n; i++) {
int cnt = 1;
for (int j = 0; j < n; j++) {
if (i == j) break;
if (v[i] > v[j]) cnt++;
}
char c = cnt + 65;
s += c;
}
}
}์บ์ฑ์ ํ๋ ค๋ฉด ๋ฌธ์์ด๋ก ํ๋ ๊ฒ์ด ์ข์ ๊ฒ ๊ฐ์์ ๋ฌธ์์ด๋ก ์ผ๋ฐํ๋ฅผ ์งํํ์์ต๋๋ค.
3. ๋งํ ์ ๋ฐ ๊ฐ์ ์ฌํญ
์ผ๋ฐํ๋ฅผ ์งํ ํ ํ ์ด๋ค์์ผ๋ก bfs๋ฅผ ์ํํด์ผํ ์ง ๋ชฐ๋ผ ๋งํ์ต๋๋ค. ๋ ๊ณ ๋ฏผํด๋ด์ผํ ๊ฒ ๊ฐ์ต๋๋ค.