QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#565274#9320. Find the Easiest ProblembigJCompile Error//C++231.1kb2024-09-15 20:48:282024-09-15 20:48:29

Judging History

This is the latest submission verdict.

  • [2024-09-15 20:48:29]
  • Judged
  • [2024-09-15 20:48:28]
  • Submitted

answer

#include <bits/stdc++.h>

namespace stdv = std::views;
namespace stdr = std::ranges;

using i64 = long long;

template<typename A, typename B>
constexpr bool chmax(A& a, const B& b) {
    a = (a > b) ? a : b;
    return a == b;
}
template<typename A, typename B>
constexpr bool chmin(A& a, const B& b) {
    a = (a < b) ? a : b;
    return a == b;
}

void Find() {
    int n;
    std::cin >> n;

    int cnt[26]{};
    std::map<std::string, std::array<bool, 26>> vis;

    for (int i = 0; i < n; i++) {
        std::string name;
        char c;
        std::string res;
        std::cin >> name >> c >> res;
        if (res != "accepted") {
            continue;
        }
        name = name.substr(4);
        c -= 'A';
        if (!vis[name][c]) {
            vis[name][c] = true;
            cnt[c]++;
        }
    }

    std::println("{}", char(stdr::max_element(cnt) - cnt + 'A'));
}

int main(int argc, const char* argv[]) {
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);

    int t;
    std::cin >> t;
    
    while (t--) {
        Find();
    }
    
    return 0;
}

Details

answer.code: In function ‘void Find()’:
answer.code:42:10: error: ‘println’ is not a member of ‘std’; did you mean ‘rintl’?
   42 |     std::println("{}", char(stdr::max_element(cnt) - cnt + 'A'));
      |          ^~~~~~~
      |          rintl