AtCoder Beginner Contest 064

Submission #1591737

Source codeソースコード

#include <bits/stdc++.h>

#define REP(i, n) for(int i = 0; i < (int)(n); ++i)
#define FOR(i, m, n) for(int i = (m); i < (int)(n); ++i)
#define ALL(x) (x).begin(), (x).end()
#define INF 2000000000

#ifdef LOCAL
  #define eprintf(...) fprintf(stdout, __VA_ARGS__)
#else
  #define eprintf(...) 0
#endif

using namespace std;

typedef long long LL;
typedef unsigned long long ULL;
typedef unsigned int uint;

int main() {
  int n;
  cin >> n;
  vector<int> v(9, 0);
  int a;
  REP(i, n) {
    cin >> a;
    if(a <= 399) v[0]++;
    else if(a <= 799) v[1]++;
    else if(a <= 1199) v[2]++;
    else if(a <= 1599) v[3]++;
    else if(a <= 1999) v[4]++;
    else if(a <= 2399) v[5]++;
    else if(a <= 2799) v[6]++;
    else if(a <= 3199) v[7]++;
    else v[8]++;
  }

  int colors = 0;
  int zero = 0;
  REP(i, v.size()-1) {
    if(v[i] > 0) colors++;
    else zero++;
  }
  int free = v[8];
  int maxc = colors + free;
  int minc = colors == 0 ? 1 : colors;
  eprintf("col,zero,free:%d,%d,%d\n", colors,zero,free);

  printf("%d %d\n", minc, maxc);

  return 0;
}

Submission

Task問題 C - Colorful Leaderboard
User nameユーザ名 yoshi_k
Created time投稿日時
Language言語 C++14 (GCC 5.4.1)
Status状態 AC
Score得点 300
Source lengthソースコード長 1111 Byte
File nameファイル名
Exec time実行時間 1 ms
Memory usageメモリ使用量 256 KB

Test case

Set

Set name Score得点 / Max score Cases
Sample - s1.txt,s2.txt,s3.txt
All 300 / 300 in1.txt,in2.txt,in3.txt,in4.txt,in5.txt,s1.txt,s2.txt,s3.txt

Test case

Case name Status状態 Exec time実行時間 Memory usageメモリ使用量
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