Submission #1036039

# Submission time Handle Problem Language Result Execution time Memory
1036039 2024-07-27T02:41:13 Z vjudge1 Med (COCI22_med) C++17
50 / 50
8 ms 552 KB
#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 time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 508 KB Output is correct
4 Correct 0 ms 392 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 508 KB Output is correct
4 Correct 0 ms 392 KB Output is correct
5 Correct 2 ms 348 KB Output is correct
6 Correct 4 ms 348 KB Output is correct
7 Correct 3 ms 348 KB Output is correct
8 Correct 8 ms 552 KB Output is correct
9 Correct 2 ms 348 KB Output is correct