Submission #2410082


Source Code Expand

#include <bits/stdc++.h>
#include <algorithm>
using namespace std;

int main(){
  int n;
  cin >> n;
  vector<int> a(n);
  vector<int> b(9);
  for(int i = 0; i < n; i++){
    cin >> a.at(i);
    if(a.at(i) < 400){
      b.at(0)++;
    }else if(a.at(i) >= 400 && a.at(i) < 800){
      b.at(1)++;
    }else if(a.at(i) >= 800 && a.at(i) < 1200){
      b.at(2)++;
    }else if(a.at(i) >= 1200 && a.at(i) < 1600){
      b.at(3)++;
    }else if(a.at(i) >= 1600 && a.at(i) < 2000){
      b.at(4)++;
    }else if(a.at(i) >= 2000 && a.at(i) < 2400){
      b.at(5)++;
    }else if(a.at(i) >= 2400 && a.at(i) < 2800){
      b.at(6)++;
    }else if(a.at(i) >= 2800 && a.at(i) < 3200){
      b.at(7)++;
    }else if(a.at(i) >= 3200){
      b.at(8)++;
    }
  }
  int c = 0;
  for(int i = 0; i < 8; i++){
    if(b.at(i) >= 1){
      c++;
    }
  }
  int comin, comax;
  if(c == 0 && b.at(8) >= 1){
    comin = 1;
    comax = min(8, b.at(8));
  }else if(c >= 1 && b.at(8) == 0){
    comin = c;
    comax = c;
  }else{
    comin = c;
    comax = min(8, c + b.at(8));
  }
  cout << comin << " " << comax << endl;
}

Submission Info

Submission Time
Task C - Colorful Leaderboard
User Pellier
Language C++14 (GCC 5.4.1)
Score 0
Code Size 1148 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