Submission #1992043


Source Code Expand

#include <iostream>
#include <string>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <map>
#include <cmath>
#include <queue>
#include <utility>
#include <functional>
#include <numeric>
#include <limits>
#include <stdlib.h>

const long long int Z = 1000000007;
const long long int INF = 1 << 30;
const int V = 10;
struct edge { int to, cost; };
std::vector<edge>v[100];
typedef std::pair<int, int>p;

int main() {
	int n, b[9] = {0};
	std::cin >> n;
	for (int i = 0;i < n;i++) {
		int a;
		std::cin >> a;
		if (a < 400) {
			b[0]+=1;
		}
		if (400 <= a && a < 800) {
			b[1]+=1;
		}
		if (800 <= a && a < 1200) {
			b[2]+=1;
		}
		if (1200 <= a && a < 1600) {
			b[3]+=1;
		}
		if (1600 <= a && a < 2000) {
			b[4]+=1;
		}
		if (2000 <= a && a < 2400) {
			b[5]+=1;
		}
		if (2400 <= a && a < 2800) {
			b[6]+=1;
		}
		if (2800 <= a && a < 3200) {
			b[7]+=1;
		}
		if (3200 <= a) {
			b[8]+=1;
		}
}
	int min = 0, max = 0, sum = 0;
	for (int i = 0;i < 8;i++) {
		if (b[i] != 0) {
			min+=1;
			max+=1;
		}
		else {
			sum+=1;
		}
	}
	if (b[8] != 0) {
		if (sum == 8) {
			min = 1;
			if (b[8] < 9)
				max = b[8];
			else
				max = 8;
		}
		else {
			while (true) {
				b[8] -= 1;
				if (b[8] < 0)break;
				sum -= 1;
				if (sum < 0)break;
				max += 1;
				if (max == 8)break;
			}
		}
	}
	std::cout << min << ' ' << max << std::endl;
	return 0;
}

Submission Info

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