답안 #957615

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
957615 2024-04-04T05:50:12 Z ezzzay Olympiads (BOI19_olympiads) C++14
0 / 100
3 ms 8540 KB
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define ff first
#define ss second
#define pb push_back
const int N=2e3+4;
int a[N][N];
signed main(){
    int n,k,c;
    cin>>n>>k>>c;
    vector<int>vc;
    for(int i=1;i<=n;i++){
        for(int j=1;j<=k;j++){
            cin>>a[i][j];
        }
    }
    int s=0;
    for(int i=1;i<=n;i++){
        int tmp[N];
        for(int l=0;l<=k;l++)tmp[l]=0;
        for(int l=0;l<=n;l++){
            if(i==l)continue;
            for(int j=1;j<=k;j++){
                tmp[j]=max(tmp[j],a[l][j]);
            }
        }
        int h=0;
        for(int j=1;j<=k;j++)h+=tmp[j];
        vc.pb(h);
    }
    sort(vc.begin(),vc.end(), greater<int>());
    cout<<vc[k-1];
}

Compilation message

olympiads.cpp: In function 'int main()':
olympiads.cpp:18:9: warning: unused variable 's' [-Wunused-variable]
   18 |     int s=0;
      |         ^
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 8540 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 2396 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 8540 KB Output is correct
2 Correct 3 ms 8540 KB Output is correct
3 Incorrect 3 ms 8540 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 8540 KB Output isn't correct
2 Halted 0 ms 0 KB -