Skip to content

Instantly share code, notes, and snippets.

@yeopgi
Created August 28, 2021 05:17
Show Gist options
  • Select an option

  • Save yeopgi/592f52ac1ef97a0b2f78c759229633dc to your computer and use it in GitHub Desktop.

Select an option

Save yeopgi/592f52ac1ef97a0b2f78c759229633dc to your computer and use it in GitHub Desktop.
#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