/ SeriousOJ /

Record Detail

Memory Exceeded


  
# Status Time Cost Memory Cost
#1 Wrong Answer 1ms 320.0 KiB
#2 Memory Exceeded ≥1092ms ≥256.016 MiB

Code

#include<bits/stdc++.h>
using namespace std;
const long long M=1e7+1,MOD=1000000007;
typedef long long ll;
#define double long double
#define debug(x) cout<<x<<endl

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int t;
    cin>>t;
    while(t--)
    {
       int n;
       cin>>n;
       vector<int>v;
       for(int i=1;i<=n*n;i++){
        int a;
        cin>>a;
        v.push_back(a);
       }
       sort(v.begin(),v.end());
       n*=n;
       cout<<v[0]+v[n-2]<<"\n";
    }


    return 0;
 
}

Information

Submit By
Type
Submission
Problem
P1065 Matrix Sum
Language
C++20 (G++ 13.2.0)
Submit At
2024-05-30 17:55:57
Judged At
2024-11-11 03:29:10
Judged By
Score
0
Total Time
≥1092ms
Peak Memory
≥256.016 MiB