結果

問題 No.1795 AtCoder Heuristic Rating coloring
ユーザー ninoinuininoinui
提出日時 2021-12-26 10:54:48
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 124 ms / 2,000 ms
コード長 3,340 bytes
コンパイル時間 2,615 ms
コンパイル使用メモリ 209,988 KB
実行使用メモリ 14,648 KB
最終ジャッジ日時 2023-10-24 01:03:15
合計ジャッジ時間 10,702 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,372 KB
testcase_01 AC 2 ms
4,372 KB
testcase_02 AC 2 ms
4,372 KB
testcase_03 AC 2 ms
4,372 KB
testcase_04 AC 3 ms
4,372 KB
testcase_05 AC 4 ms
4,372 KB
testcase_06 AC 3 ms
4,372 KB
testcase_07 AC 3 ms
4,372 KB
testcase_08 AC 4 ms
4,372 KB
testcase_09 AC 4 ms
4,372 KB
testcase_10 AC 4 ms
4,372 KB
testcase_11 AC 4 ms
4,372 KB
testcase_12 AC 2 ms
4,372 KB
testcase_13 AC 2 ms
4,372 KB
testcase_14 AC 2 ms
4,372 KB
testcase_15 AC 2 ms
4,372 KB
testcase_16 AC 2 ms
4,372 KB
testcase_17 AC 2 ms
4,372 KB
testcase_18 AC 2 ms
4,372 KB
testcase_19 AC 1 ms
4,372 KB
testcase_20 AC 2 ms
4,372 KB
testcase_21 AC 2 ms
4,372 KB
testcase_22 AC 2 ms
4,372 KB
testcase_23 AC 2 ms
4,372 KB
testcase_24 AC 2 ms
4,372 KB
testcase_25 AC 2 ms
4,372 KB
testcase_26 AC 2 ms
4,372 KB
testcase_27 AC 2 ms
4,372 KB
testcase_28 AC 2 ms
4,372 KB
testcase_29 AC 2 ms
4,372 KB
testcase_30 AC 2 ms
4,372 KB
testcase_31 AC 2 ms
4,372 KB
testcase_32 AC 37 ms
6,660 KB
testcase_33 AC 26 ms
6,088 KB
testcase_34 AC 59 ms
7,772 KB
testcase_35 AC 48 ms
7,268 KB
testcase_36 AC 56 ms
8,100 KB
testcase_37 AC 31 ms
6,276 KB
testcase_38 AC 29 ms
6,420 KB
testcase_39 AC 63 ms
8,104 KB
testcase_40 AC 41 ms
6,968 KB
testcase_41 AC 57 ms
7,804 KB
testcase_42 AC 36 ms
6,692 KB
testcase_43 AC 38 ms
7,108 KB
testcase_44 AC 49 ms
7,840 KB
testcase_45 AC 37 ms
6,708 KB
testcase_46 AC 68 ms
8,364 KB
testcase_47 AC 17 ms
5,120 KB
testcase_48 AC 36 ms
6,904 KB
testcase_49 AC 69 ms
8,456 KB
testcase_50 AC 35 ms
6,336 KB
testcase_51 AC 32 ms
6,172 KB
testcase_52 AC 86 ms
10,836 KB
testcase_53 AC 85 ms
10,812 KB
testcase_54 AC 114 ms
14,648 KB
testcase_55 AC 117 ms
14,648 KB
testcase_56 AC 124 ms
14,648 KB
testcase_57 AC 114 ms
14,648 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#ifndef _DEBUG
#define _DEBUG
#include __FILE__

int main() {
    long N, M;
    cin >> N >> M;

    map<string, long> MA;
    string S;
    long A;
    while (cin >> S >> A) {
        cmax(MA[S], A);
    }
    for (const auto& [a, b] : MA) cout << a << " " << b << '\n';
}

#else
// #undef _DEBUG
#include <bits/stdc++.h>
using namespace std;

template <typename T, typename T2>
bool cmin(T& a, const T2& b) {
    return a > b ? a = b, true : false;
}

template <typename T, typename T2>
bool cmax(T& a, const T2& b) {
    return a < b ? a = b, true : false;
}

__attribute__((constructor)) void ios_setup() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
}

template <typename T>
ostream& operator<<(ostream& os, const vector<T>& vec);

template <typename T>
ostream& operator<<(ostream& os, const vector<vector<T> >& vec);

template <typename T>
ostream& operator<<(ostream& os, const vector<vector<vector<T> > >& vec);

template <typename T, typename U>
ostream& operator<<(ostream& os, const pair<T, U>& p) {
    return os << "(" << p.first << ", " << p.second << ")";
}

template <typename A, typename B, typename C>
ostream& operator<<(ostream& os, const tuple<A, B, C>& t) {
    const auto& [a, b, c] = t;
    return os << "(" << a << ", " << b << ", " << c << ")";
}

template <typename A, typename B, typename C, typename D>
ostream& operator<<(ostream& os, const tuple<A, B, C, D>& t) {
    const auto& [a, b, c, d] = t;
    return os << "(" << a << ", " << b << ", " << c << ", " << d << ")";
}

template <typename T>
ostream& operator<<(ostream& os, priority_queue<T> pq) {
    os << "{";
    while (!pq.empty()) os << pq.top() << (pq.size() > 1 ? " " : ""), pq.pop();
    return os << "}";
}

#define FOREACH(it, a) for (auto it = (a).begin(); it != (a).end(); it++)

template <typename T>
ostream& operator<<(ostream& os, const set<T>& se) {
    os << "{";
    FOREACH (it, se) { os << (it == se.begin() ? "" : " ") << *it; }
    return os << "}";
}

template <typename T>
ostream& operator<<(ostream& os, const multiset<T>& ms) {
    os << "{";
    FOREACH (it, ms) { os << (it == ms.begin() ? "" : " ") << *it; }
    return os << "}";
}

template <typename T, typename U>
ostream& operator<<(ostream& os, const map<T, U>& ma) {
    os << "{";
    FOREACH (it, ma) { os << (it == ma.begin() ? "" : " ") << *it; }
    return os << "}";
}

template <typename T>
ostream& operator<<(ostream& os, const vector<T>& vec) {
    os << "{";
    FOREACH (it, vec) { os << (it == vec.begin() ? "" : " ") << *it; }
    return os << "}";
}

template <typename T>
ostream& operator<<(ostream& os, const vector<vector<T> >& vec) {
    os << "{\n";
    FOREACH (it, vec) { os << (it == vec.begin() ? " " : "\n ") << *it; }
    return os << "\n}";
}

template <typename T>
ostream& operator<<(ostream& os, const vector<vector<vector<T> > >& vec) {
    os << "{\n";
    FOREACH (it, vec) {
        os << (it == vec.begin() ? "" : "\n") << "(" << it - vec.begin() << ") " << *it;
    }
    return os << "\n}";
}

void dump() {}
template <typename Head, typename... Tail>
void dump(const Head& head, const Tail&... tail) {
    cout << head << (sizeof...(tail) ? ", " : "\n"), dump(tail...);
}

#ifdef _DEBUG
#define DUMP(...) cout << "[" << (#__VA_ARGS__) << "] ", dump(__VA_ARGS__)
#else
#define DUMP(...) (void)0
#endif

#endif
0