Submission #1243910

#TimeUsernameProblemLanguageResultExecution timeMemory
1243910repmannTeam Contest (JOI22_team)C++20
0 / 100
1 ms328 KiB
#include <bits/stdc++.h>
using namespace std;
int N;
int X[150006], Y[150006], Z[150006];
int main()
{
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> N;
  for(int i = 1; i <= N; i++) cin >> X[i] >> Y[i] >> Z[i];
  int x, y, z, sol = 0;
  for(int i = 1; i <= N; i++)
  {
    for(int j = i + 1; j <= N; j++)
    {
      for(int k = j + 1; k <= N; k++)
      {
        x = y = z = 0;
        if(X[i] > X[x]) x = i;
        if(X[j] > X[x]) x = j;
        if(X[k] > X[x]) x = k;
        if(Y[i] > Y[y]) y = i;
        if(Y[j] > Y[y]) y = j;
        if(Y[k] > Y[y]) y = k;
        if(Z[i] > Z[z]) z = i;
        if(Z[j] > Z[z]) z = j;
        if(Z[k] > Z[z]) z = k;
        if((x != y) && (x != z) && (y != z)) sol = max(X[x] + Y[y] + Z[z], sol);
      }
    }
  }
  cout << sol << '\n';

  return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...