Submission #1244152

#TimeUsernameProblemLanguageResultExecution timeMemory
1244152lovrotTeam Contest (JOI22_team)C++20
8 / 100
35 ms328 KiB
#include <cstdio>
#include <algorithm>

using namespace std;

const int N = 310;

int x[N], y[N], z[N];

int main() { 
	int n;
	scanf("%d", &n);
	for(int i = 0; i < n; ++i) { 
		scanf("%d%d%d", x + i, y + i, z + i);
	}

	int ans = -1;
	for(int i = 0; i < n; ++i) { 
		for(int j = 0; j < n; ++j) { 
			for(int k = 0; k < n; ++k) { 
				if(x[i] > x[j] && x[i] > x[k] && 
				   y[j] > y[i] && y[j] > y[k] &&
				   z[k] > z[i] && z[k] > z[j]) { 
					ans = max(ans, x[i] + y[j] + z[k]);
				}
			}
		}
	}

	printf("%d\n", ans);
	return 0;
}

Compilation message (stderr)

team.cpp: In function 'int main()':
team.cpp:12:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 |         scanf("%d", &n);
      |         ~~~~~^~~~~~~~~~
team.cpp:14:22: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   14 |                 scanf("%d%d%d", x + i, y + i, z + i);
      |                 ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#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...