답안 #124953

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
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]);
                                                        ~~~~~^~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 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
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 7 ms 1016 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 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 -