Language: C++

#pragma once
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>

typedef long long ll;
#define all(x) (x).begin(), (x).end()  // sortなどの引数を省略
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define max3(x, y, z) max(x, max(y, z))

#ifdef _MSC_FULL_VER  //デバッグ出力
#define dout cout
#define debug() if (true)
#define check(x) std::cout << "★" << #x << "の値:" << (x) << endl
#define pass(x) std::cout << "☆" << x << endl
#else
#define dout \
  if (false) cout
#define debug() if (false)
#define check(x) \
  if (false) cout << "★" << #x << "の値:" << (x) << endl
#define pass(x) \
  if (false) cout << "☆" << x << endlhttps:  // stopwatch.onl.jp/#
#endif
using namespace std;
int main() {
  int N;
  string tmp;
  int ans = 0;
  cin >> N;
  int flag = 0;
  int used = 0;
  int max = 0;
  int answerused = 0;
  int ax = 0;
  vector<string> list(N);
  vector<int> count(N);

  for (int i = 0; i < N; i++) {
    cin >> tmp;
    flag = 0;  //過去に入力があったか？
    for (int j = 0; j < N; j++) {
      dout << "☆え(" << j << ":" << list[j] << ")" << endl;
      if (list[j] == tmp) {
        count[j]++;
        if (count[j] > max) {
          pass("あ");
          max = count[j];
          ax = 0;
        } else if (count[j] == max) {
          pass("い");
          ax++;
        }
        pass("う");
        flag = 1;
      }
    }
    if (flag == 0) {
      pass("お");
      if (max == 0) {
        pass("か");
        max = 1;
        ax = 1;
      }
    }
    list[used] = tmp;
    count[used] = 1;
    used++;
  }
  check(ax);
  dout << "-------集計結果--------\n";
  rep(i, used) dout << count[i] << "\t" << list[i] << "\n";
  dout << "-------end debug-------\n";

  check(ax);
  vector<string> answer(ax + 1);

  string qwe;
  for (int i = 0; i < N; i++) {
    dout << i << endl;
    if (count[i] == max) {
      dout << i << "-" << answerused << endl;
      qwe = list[i];
      pass("=");
      answer[answerused] = qwe;
      answerused++;
    }
  }
  dout << "-------answerの現状----------\n";
  check(answerused);
  rep(i, answerused) dout << answer[i] << "\n";
  dout << "-------end debug-------\n";
  sort(all(answer));
  dout << "-------answerの現状----------\n";
  check(answerused);
  rep(i, answerused) dout << answer[i] << "\n";
  dout << "-------end debug-------\n";
  for (int i = 0; i < answerused; i++) {
    cout << answer[i] << endl;
  }
  return 0;
}
/*
//よく使うやつ
int N;
cin >> N;
vector<int> list(N);
for (int i = 0; i < N; i++) {
  cin >> list[i];
}
// for文
for (int i = 0; i < N; i++) {
}
//配列
vector<int> vec;
vec.at(i)
vector<vector<int>> vec(10, vector<int>(10));
sort(all(vec));
sort(all(vec), greater<int>());
    //配列の内容表示
dout << "====vecの内容====\n";
for (int i = 0; i < N; i++) dout << vec[i] << endl;
dout << "====ここまで====\n";
*/

Compiler output:
a.cc:1:9: warning: #pragma once in main file
    1 | #pragma once
      |         ^~~~
a.cc: In function 'int main()':
a.cc:24:34: error: 'endlhttps' was not declared in this scope
   24 |   if (false) cout << "☆" << x << endlhttps:  // stopwatch.onl.jp/#
      |                                  ^~~~~~~~~
a.cc:48:11: note: in expansion of macro 'pass'
   48 |           pass("あ");
      |           ^~~~
a.cc:24:34: error: 'endlhttps' was not declared in this scope
   24 |   if (false) cout << "☆" << x << endlhttps:  // stopwatch.onl.jp/#
      |                                  ^~~~~~~~~
a.cc:52:11: note: in expansion of macro 'pass'
   52 |           pass("い");
      |           ^~~~
a.cc:24:34: error: 'endlhttps' was not declared in this scope
   24 |   if (false) cout << "☆" << x << endlhttps:  // stopwatch.onl.jp/#
      |                                  ^~~~~~~~~
a.cc:55:9: note: in expansion of macro 'pass'
   55 |         pass("う");
      |         ^~~~
a.cc:24:34: error: 'endlhttps' was not declared in this scope
   24 |   if (false) cout << "☆" << x << endlhttps:  // stopwatch.onl.jp/#
      |                                  ^~~~~~~~~
a.cc:60:7: note: in expansion of macro 'pass'
   60 |       pass("お");
      |       ^~~~
a.cc:24:34: error: 'endlhttps' was not declared in this scope
   24 |   if (false) cout << "☆" << x << endlhttps:  // stopwatch.onl.jp/#
      |                                  ^~~~~~~~~
a.cc:62:9: note: in expansion of macro 'pass'
   62 |         pass("か");
      |         ^~~~
a.cc:24:34: error: 'endlhttps' was not declared in this scope
   24 |   if (false) cout << "☆" << x << endlhttps:  // stopwatch.onl.jp/#
      |                                  ^~~~~~~~~
a.cc:85:7: note: in expansion of macro 'pass'
   85 |       pass("=");
      |       ^~~~