結果

問題 No.2590 100000 Days of Christmas
ユーザー siro53
提出日時 2023-12-18 02:50:02
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 104 ms / 2,000 ms
コード長 396 bytes
コンパイル時間 2,112 ms
コンパイル使用メモリ 199,820 KB
最終ジャッジ日時 2025-02-18 12:02:28
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N;
    cin >> N;
    cin.ignore();
    map<string, long long> sum;
    for(int i = 0; i < N; i++) {
        string s;
        getline(cin, s);
        sum[s] += (long long)(i + 1) * (N - i);
    }
    for(const auto& [k, v] : sum) {
        cout << v << ' ' << k << '\n';
    }
}
0