結果
問題 | No.2590 100000 Days of Christmas |
ユーザー |
|
提出日時 | 2023-11-23 15:23:55 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 145 ms / 2,000 ms |
コード長 | 434 bytes |
コンパイル時間 | 2,000 ms |
コンパイル使用メモリ | 175,092 KB |
実行使用メモリ | 11,264 KB |
最終ジャッジ日時 | 2024-09-27 08:10:12 |
合計ジャッジ時間 | 4,344 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 22 |
ソースコード
#include <bits/stdc++.h>using namespace std;using ll = long long;int main(void) {ll N;cin >> N;string S; getline(cin, S); // 最初の改行を取り除くmap<string, ll> presents;for (ll i = 0; i < N; i++) {string S;getline(cin, S);presents[S] += (i + 1) * (N - i);}for (auto &item : presents) {cout << item.second << " " << item.first << "\n";}}