Submission #921530

# Submission time Handle Problem Language Result Execution time Memory
921530 2024-02-04T05:46:47 Z vjudge1 Safety (NOI18_safety) C++17
0 / 100
19 ms 1372 KB
#include <bits/stdc++.h>
#define ll long long
using namespace std;

void solve(){
    ll a,h,count=0;
    cin>>a>>h;
    ll b[a+1];
    for(ll i=1;i<=a;i++){
        cin>>b[i];
    }
    sort(b+1,b+a+1);
    if(b[1]==b[a]){
        cout<<0;
        return ;
    }
    for(ll i=1;i<=a;i++){
        count+=b[i];
    }
    //cout<<"\n";
    cout<<count;
}

int main()
{
    ios_base::sync_with_stdio(0),cin.tie(0);
    ll t=1,i=1;
    //cin>>t;
    while(t--){
        //cout<<"Case ";
        //cout<<i<<':'<<"\n";
        //i++;
        solve();
    }
    return 0;
}

Compilation message

safety.cpp: In function 'int main()':
safety.cpp:27:12: warning: unused variable 'i' [-Wunused-variable]
   27 |     ll t=1,i=1;
      |            ^
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 19 ms 1372 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -