Created
August 28, 2021 05:17
-
-
Save yeopgi/592f52ac1ef97a0b2f78c759229633dc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <vector> | |
| using namespace std; | |
| int main(void) | |
| { | |
| ios_base::sync_with_stdio(false); | |
| cin.tie(nullptr); | |
| int manCnt; | |
| cin >> manCnt; | |
| vector<pair<int, int>> manData(manCnt); | |
| int rank[manData.size()]; | |
| for (int i = 0; i < manCnt; i++) { | |
| cin >> manData[i].first >> manData[i].second; | |
| rank[i] = 1; | |
| } | |
| for (int i = 0; i < manCnt; i++) { | |
| for (int j = 0; j < manCnt; j++) { | |
| if (manData[i].first < manData[j].first && manData[i].second < manData[j].second) { | |
| rank[i]++; | |
| } | |
| } | |
| } | |
| for (int i = 0; i < manCnt; i++) { | |
| cout << rank[i] << ' '; | |
| } | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment