結果
| 問題 | No.2590 100000 Days of Christmas | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2023-12-19 02:07:39 | 
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 105 ms / 2,000 ms | 
| コード長 | 391 bytes | 
| コンパイル時間 | 2,266 ms | 
| コンパイル使用メモリ | 200,664 KB | 
| 最終ジャッジ日時 | 2025-02-18 12:10:37 | 
| ジャッジサーバーID (参考情報) | judge2 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 22 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll n;
    cin >> n;
    string s;
    getline(cin, s);
    map<string, ll> mp;
    for(int i = 0; i < n; i++){
        getline(cin, s);
        mp[s] += (i + 1) * (n - i);
    }
    for(auto &&[key, v] : mp){
        cout << v << ' ' << key << '\n';
    }
}
            
            
            
        