Submission #7449629


Source Code Expand

Copy
#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> m;
  map<int,int> a;
  for(int i = 1;i < 5;i++) {
    a[i] = 0;
  }
  char c;
  for(int i = 0;i < n;i++) {
    cin >> c;
    a.at(c)++;
  }
  int max = 0;
  int min = n;
  for(auto p : a) {
    auto value = p.second;
    if(max < value) {
      max = value;
    }
    if(min > value) {
      min = value;
    }
  }
  cout << max << " " << min << endl;
}

Submission Info

Submission Time
Task A - センター採点
User yusayukio
Language C++14 (GCC 5.4.1)
Score 0
Code Size 456 Byte
Status

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:5:10: error: ‘m’ was not declared in this scope
   cin >> m;
          ^