Submission #1341118


Source Code Expand

#include <stdio.h>
#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define ld long double
#define pb push_back
#define mp make_pair
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pdd pair<ld, ld>
#define all(x) (x).begin(), (x).end()
#define fi first
#define se second

int main() {
  cin.sync_with_stdio(false);

  int n;
  cin >> n;

  map<int, int> a;
  map<int, int> b;

  for (; n; n--) {
    int x;
    cin >> x;

    if (x < 400) {
      a[0]++;
      b[0]++;
    } else if (x < 800) {
      a[1]++;
      b[1]++;
    } else if (x < 1200) {
      a[2]++;
      b[2]++;
    } else if (x < 1600) {
      a[3]++;
      b[3]++;
    } else if (x < 2000) {
      a[4]++;
      b[4]++;
    } else if (x < 2400) {
      a[5]++;
      b[5]++;
    } else if (x < 2800) {
      a[6]++;
      b[6]++;
    } else if (x < 3200) {
      a[7]++;
      b[7]++;
    } else {
      for (int i = 0; i < 8; i++) {
        if (a[i] == 0) {
          a[i]++;
          break;
        }
      }

      bool found = 0;
      for (int i = 0; i < 8; i++) {
        if (b[i]) {
          b[i]++;
          found = 1;
          break;
        }
      }
      if (!found) {
        b[0]++;
      }
    }
  }

  int mini = 0;
  int maxi = 0;
  for (int i = 0; i < 8; i++) {
    if (a[i]) {
      mini++;
    }
    if (b[i]) {
      maxi++;
    }
  }


  cout << maxi << " " << mini << '\n';

  return 0;
}

Submission Info

Submission Time
Task C - Colorful Leaderboard
User Al3ks1002
Language C++14 (GCC 5.4.1)
Score 0
Code Size 1507 Byte
Status WA
Exec Time 1 ms
Memory 256 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 300
Status
AC × 3
AC × 6
WA × 2
Set Name Test Cases
Sample s1.txt, s2.txt, s3.txt
All in1.txt, in2.txt, in3.txt, in4.txt, in5.txt, s1.txt, s2.txt, s3.txt
Case Name Status Exec Time Memory
in1.txt AC 1 ms 256 KB
in2.txt AC 1 ms 256 KB
in3.txt WA 1 ms 256 KB
in4.txt WA 1 ms 256 KB
in5.txt AC 1 ms 256 KB
s1.txt AC 1 ms 256 KB
s2.txt AC 1 ms 256 KB
s3.txt AC 1 ms 256 KB