Submission #124953

# Submission time Handle Problem Language Result Execution time Memory
124953 2019-07-04T08:03:22 Z 임유진(#3051) Olympiads (BOI19_olympiads) C++14
13 / 100
12 ms 1016 KB
#include<stdio.h>
#include<algorithm>
#include<vector>

using namespace std;

int A[505][6];

int main() {
	int N, K, C;
	vector<int> v;

	scanf("%d%d%d", &N, &K, &C);
	for(int i = 0; i < N; i++) for(int j = 0; j < K; j++) scanf("%d", &A[i][j]);

	if(K == 1) {
		for(int i = 0; i < N; i++) v.push_back(A[i][0]);
	}
	else {
		for(int i = 0; i < N; i++) for(int j = i + 1; j < N; j++)
			v.push_back(max(A[i][0], A[j][0]) + max(A[i][1], A[j][1]));
	}
	sort(v.begin(), v.end());
	printf("%d", v[v.size() - C]);
	return 0;
}

Compilation message

olympiads.cpp: In function 'int main()':
olympiads.cpp:13:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d%d%d", &N, &K, &C);
  ~~~~~^~~~~~~~~~~~~~~~~~~~~~
olympiads.cpp:14:61: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  for(int i = 0; i < N; i++) for(int j = 0; j < K; j++) scanf("%d", &A[i][j]);
                                                        ~~~~~^~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 12 ms 1012 KB Output is correct
2 Correct 10 ms 1012 KB Output is correct
3 Correct 8 ms 1012 KB Output is correct
4 Correct 5 ms 1012 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 7 ms 1016 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 12 ms 1012 KB Output is correct
2 Correct 10 ms 1012 KB Output is correct
3 Correct 8 ms 1012 KB Output is correct
4 Correct 5 ms 1012 KB Output is correct
5 Incorrect 2 ms 256 KB Output isn't correct
6 Halted 0 ms 0 KB -