답안 #586931

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
586931 2022-07-01T05:27:50 Z 반딧불(#8396) Olympiads (BOI19_olympiads) C++17
13 / 100
9 ms 976 KB
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

int n, k, c;
int mat[502][10];
vector<int> vec;

int main(){
    scanf("%d %d %d", &n, &k, &c);
    for(int i=1; i<=n; i++) for(int j=0; j<k; j++) scanf("%d", &mat[i][j]);
    if(k==1){
        for(int i=1; i<=n; i++) vec.push_back(mat[i][0]);
    }
    else{
        for(int i=1; i<=n; i++) for(int j=i+1; j<=n; j++)
            vec.push_back(max(mat[i][0], mat[j][0]) + max(mat[i][1], mat[j][1]));
    }
    sort(vec.rbegin(), vec.rend());
    printf("%d", vec[c-1]);
}

Compilation message

olympiads.cpp: In function 'int main()':
olympiads.cpp:12:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 |     scanf("%d %d %d", &n, &k, &c);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
olympiads.cpp:13:57: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   13 |     for(int i=1; i<=n; i++) for(int j=0; j<k; j++) scanf("%d", &mat[i][j]);
      |                                                    ~~~~~^~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 9 ms 976 KB Output is correct
2 Correct 8 ms 848 KB Output is correct
3 Correct 6 ms 976 KB Output is correct
4 Correct 4 ms 948 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 5 ms 976 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 9 ms 976 KB Output is correct
2 Correct 8 ms 848 KB Output is correct
3 Correct 6 ms 976 KB Output is correct
4 Correct 4 ms 948 KB Output is correct
5 Incorrect 1 ms 212 KB Output isn't correct
6 Halted 0 ms 0 KB -