Submission #1768164


Source Code Expand

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<ctime>
#include<cctype>
#include<climits>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<memory>
#include<functional>
#include<set>
 
using namespace std;
 
#define ALL(g) (g).begin(),(g).end()
#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i,n) REP(i,0,n)
#define P(p) cout<<(p)<<endl;
#define p(p) cout<<(p)<<" ";
#define pb push_back
#define mp make_pair
#define INF 1<<25

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int, int> pi;
typedef long long ll;

//int dy[8]={1,1,1,0,0,-1,-1,-1};
//int dx[8]={-1,0,1,-1,1,-1,0,1};
int dx[4]={0,1,0,-1};
int dy[4]={1,0,-1,0};
struct S{
	int a,b,c;
};
bool asc(const S& left,const S& right){
	return left.c > right.c;
}
int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int N;
	cin>>N;
	vi a(N),color(8,0);
	int r=0;
	rep(i,N){
		cin>>a[i];
		if(a[i]<400)color[0]++;
		else if(a[i]<800)color[1]++;
		else if(a[i]<1200)color[2]++;
		else if(a[i]<1600)color[3]++;
		else if(a[i]<2000)color[4]++;
		else if(a[i]<2400)color[5]++;
		else if(a[i]<2800)color[6]++;
		else if(a[i]<3200)color[7]++;
		else r++;
	}
	int cnt=0;
	rep(i,8){
		if(color[i]>0)cnt++;
	}
	if(cnt!=0){
		p(cnt)P(cnt+r);
	}
	else {
		p("1")P(cnt+r);
	}
	return 0;
}

Submission Info

Submission Time
Task C - Colorful Leaderboard
User ke_to
Language C++14 (GCC 5.4.1)
Score 300
Code Size 1546 Byte
Status AC
Exec Time 1 ms
Memory 256 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 3
AC × 8
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 AC 1 ms 256 KB
in4.txt AC 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