Submission #9783372


Source Code Expand

#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
//#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
template<class T>bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }
//---------------------------------------------------------------------------------------------------
/*---------------------------------------------------------------------------------------------------
            ∧_∧
      ∧_∧  (´<_` )  Welcome to My Coding Space!
     ( ´_ゝ`) /  ⌒i     @hamayanhamayan0
    /   \     | |
    /   / ̄ ̄ ̄ ̄/  |
  __(__ニつ/     _/ .| .|____
     \/____/ (u ⊃
---------------------------------------------------------------------------------------------------*/














int N, K, H[201010];
//---------------------------------------------------------------------------------------------------
void _main() {
	cin >> N >> K;
	rep(i, 0, N) cin >> H[i];

	sort(H, H + N);
	ll ans = 0;
	rep(i, 0, N - K) ans += H[i];
	cout << ans << endl;
}





Submission Info

Submission Time
Task C - Fennec vs Monster
User hamayanhamayan
Language C++14 (GCC 5.4.1)
Score 300
Code Size 1565 Byte
Status AC
Exec Time 34 ms
Memory 1024 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 3
AC × 21
Set Name Test Cases
Sample sample_01, sample_02, sample_03
All max_01, max_02, max_03, random_01, random_02, random_03, random_04, random_05, random_06, random_07, random_08, random_09, random_10, random_11, random_12, random_13, random_14, random_15, sample_01, sample_02, sample_03
Case Name Status Exec Time Memory
max_01 AC 34 ms 1024 KiB
max_02 AC 34 ms 1024 KiB
max_03 AC 24 ms 1024 KiB
random_01 AC 11 ms 512 KiB
random_02 AC 18 ms 640 KiB
random_03 AC 4 ms 384 KiB
random_04 AC 29 ms 896 KiB
random_05 AC 8 ms 384 KiB
random_06 AC 10 ms 512 KiB
random_07 AC 16 ms 640 KiB
random_08 AC 30 ms 896 KiB
random_09 AC 23 ms 896 KiB
random_10 AC 10 ms 512 KiB
random_11 AC 13 ms 512 KiB
random_12 AC 6 ms 384 KiB
random_13 AC 34 ms 1024 KiB
random_14 AC 34 ms 1024 KiB
random_15 AC 34 ms 1024 KiB
sample_01 AC 1 ms 256 KiB
sample_02 AC 1 ms 256 KiB
sample_03 AC 1 ms 256 KiB