Submission #1036039

#TimeUsernameProblemLanguageResultExecution timeMemory
1036039vjudge1Med (COCI22_med)C++17
50 / 50
8 ms552 KiB
#include<bits/stdc++.h>

using namespace std;

int main()
{
  int n;
  cin >> n;
  string s[n];
  int sc[n] = {};
  for(int i = 0; i < n; i ++)
    {
      cin >> s[i];
      for(int j = 0; j < 5; j++)
	{
	  int x;
	  cin >> x;
	  sc[i] += x;
	}
    }

  for(int i = 0; i < n; i ++)
    {
      pair<int, string> p1 = {-sc[i], s[i]};
      pair<int, string> p2 = {-sc[i] - 500, s[i]};

      int c1 = 0, c2 = 0;
      for(int j = 0; j < n; j ++)
	{
	  if(j == i) continue;
	  if(p1 < make_pair(-sc[j] - 500, s[j]))
	    c1++;
	  if(p2 < make_pair(-sc[j], s[j]))
	    c2++;

	}
      cout << n - c2 << ' ' << n - c1 << endl;
    }
  return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...