結果
問題 | No.447 ゆきこーだーの雨と雪 (2) |
ユーザー |
![]() |
提出日時 | 2016-11-19 00:24:48 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 17 ms / 2,000 ms |
コード長 | 1,072 bytes |
コンパイル時間 | 2,363 ms |
コンパイル使用メモリ | 193,500 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-26 09:56:55 |
合計ジャッジ時間 | 3,206 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 25 |
ソースコード
#include <bits/stdc++.h>using namespace std;typedef long long ll;struct S {string name;vector<int> score;int sum;int last;bool operator < (const S& s) const {if(this->sum != s.sum) return this->sum > s.sum;return this->last < s.last;}};int L[26];int R[26];int main() {cin.tie(0);ios::sync_with_stdio(false);int N, T;cin >> N;for(int i = 0; i < N; i++) {cin >> L[i];}cin >> T;map<string, S> m;for(int t = 0; t < T; t++) {string name;char c;int p;cin >> name >> c;p = c - 'A';if(!m.count(name)) {m[name].name = name;m[name].score = vector<int>(N, 0);m[name].sum = 0;m[name].last = t;}R[p]++;int score = 50 * L[p] + 50 * L[p] / (0.8 + 0.2 * R[p]);m[name].score[p] = score;m[name].sum += score;m[name].last = t;}vector<S> v;for(auto a : m) {v.push_back(a.second);}sort(v.begin(), v.end());for(int i = 0; i < v.size(); i++) {cout << i + 1 << " " << v[i].name;for(auto s : v[i].score) {cout << " " << s;}cout << " " << v[i].sum << endl;}}