Submission #1341119


Source Code Expand

#include <algorithm>
#include <cassert>
#include <cfloat>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <vector>
 
#define FOR(i,k,n) for (int (i)=(k); (i)<(n); ++(i))
#define rep(i,n) FOR(i,0,n)
#define all(v) begin(v), end(v)
#define debug(x) cerr<< #x <<": "<<x<<endl
#define debug2(x,y) cerr<< #x <<": "<< x <<", "<< #y <<": "<< y <<endl
 
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vector<int> > vvi;
typedef vector<ll> vll;
typedef vector<vector<ll> > vvll;
typedef deque<bool> db;
template<class T> using vv=vector<vector< T > >;

int main() {
  int n;
  scanf("%d", &n);
  vi acc(9, 0);
  int b;
  rep (i, n) {
    scanf("%d", &b);
    acc[min(8, b / 400)] += 1;
  }
  int mi = 0;
  int ma = 0;
  rep (i, 7) {
    if (acc[i] > 0) {
      mi += 1;
    }
  }
  if (acc[7] > 0 || acc[8] > 0) {
    mi += 1;
  }

  rep (i, 7) {
    if (acc[i] > 0) {
      ma += 1;
    } else if (acc[8] > 0) {
      ma += 1;
      acc[8] -= 1;
    }
  }
  if (acc[7] > 0 || acc[8] > 0) {
    ma += 1;
  }

  printf("%d %d\n", mi, ma);
  
  return 0;
}

Submission Info

Submission Time
Task C - Colorful Leaderboard
User tspcx
Language C++14 (Clang 3.8.0)
Score 0
Code Size 1399 Byte
Status WA
Exec Time 3 ms
Memory 504 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 3 ms 504 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