結果

問題 No.2590 100000 Days of Christmas
ユーザー ldsybldsyb
提出日時 2023-12-24 19:46:32
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 259 ms / 2,000 ms
コード長 524 bytes
コンパイル時間 4,591 ms
コンパイル使用メモリ 271,492 KB
実行使用メモリ 15,232 KB
最終ジャッジ日時 2023-12-24 19:46:41
合計ジャッジ時間 7,771 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,676 KB
testcase_01 AC 2 ms
6,676 KB
testcase_02 AC 2 ms
6,676 KB
testcase_03 AC 2 ms
6,676 KB
testcase_04 AC 2 ms
6,676 KB
testcase_05 AC 2 ms
6,676 KB
testcase_06 AC 192 ms
14,336 KB
testcase_07 AC 31 ms
6,676 KB
testcase_08 AC 254 ms
15,232 KB
testcase_09 AC 36 ms
8,064 KB
testcase_10 AC 2 ms
6,676 KB
testcase_11 AC 2 ms
6,676 KB
testcase_12 AC 2 ms
6,676 KB
testcase_13 AC 2 ms
6,676 KB
testcase_14 AC 2 ms
6,676 KB
testcase_15 AC 2 ms
6,676 KB
testcase_16 AC 2 ms
6,676 KB
testcase_17 AC 2 ms
6,676 KB
testcase_18 AC 2 ms
6,676 KB
testcase_19 AC 2 ms
6,676 KB
testcase_20 AC 259 ms
15,232 KB
testcase_21 AC 251 ms
15,232 KB
testcase_22 AC 236 ms
14,592 KB
testcase_23 AC 254 ms
15,232 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using namespace chrono;
#if __has_include(<atcoder/all>)
#include <atcoder/all>
using namespace atcoder;
#endif

int main()
{
    int64_t n;
    cin >> n;
    cin.ignore();
    vector<string> ss(n);
    for (auto &&s : ss)
    {
        getline(cin, s);
    }

    map<string, int64_t> ans;

    for (int64_t i = 0; i < n; i++)
    {
        ans[ss[i]] += (i + 1) * (n - i);
    }

    for (auto [p, c] : ans)
    {
        cout << c << ' ' << p << endl;
    }

    return 0;
}
0