Skip to content

[Week 6] SORTGAME self review - Yunhyunjo #189

Description

@Yunhyunjo

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를 수행해야할지 몰라 막혔습니다. 더 고민해봐야할 것 같습니다.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    2기스터디 2기WAWrong Answer

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions