Submission #10333614


Source Code Expand

Copy
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;

int main()
{
  i64 N, X;
  cin >> N >> X;
  vector<i64> a(N);
  for (i64 i = 0; i < N; i++)
    cin >> a[i];
  i64 ans = 0;
  i64 m = *max_element(a.begin(), a.end()) - X;
  for (i64 i = 0; i < N; i++)
    if (m <= a[i])
      ans++;
  cout << ans << endl;
  return 0;
}

Submission Info

Submission Time
Task A - November Festival
User ecto0310
Language C++14 (GCC 5.4.1)
Score 200
Code Size 360 Byte
Status
Exec Time 1 ms
Memory 256 KB

Test Cases

Set Name Score / Max Score Test Cases
All 200 / 200 hand1, hand2, hand3, random0, random1, random2, random3, random4, random5, random6, random7, random8, random9, sample_01, sample_02
Sample 0 / 0 sample_01, sample_02
Case Name Status Exec Time Memory
hand1 1 ms 256 KB
hand2 1 ms 256 KB
hand3 1 ms 256 KB
random0 1 ms 256 KB
random1 1 ms 256 KB
random2 1 ms 256 KB
random3 1 ms 256 KB
random4 1 ms 256 KB
random5 1 ms 256 KB
random6 1 ms 256 KB
random7 1 ms 256 KB
random8 1 ms 256 KB
random9 1 ms 256 KB
sample_01 1 ms 256 KB
sample_02 1 ms 256 KB