結果
問題 |
No.447 ゆきこーだーの雨と雪 (2)
|
ユーザー |
![]() |
提出日時 | 2017-02-02 03:04:51 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 51 ms / 2,000 ms |
コード長 | 1,425 bytes |
コンパイル時間 | 1,375 ms |
コンパイル使用メモリ | 104,412 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-12-24 02:22:37 |
合計ジャッジ時間 | 3,056 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 25 |
ソースコード
#include <algorithm> #include <cstdio> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <string.h> #include <vector> using namespace std; #define ll long long #define INF (1 << 30) #define INFLL (1LL << 60) #define FOR(i,a,b) for(ll i = (a);i<(b);i++) #define REP(i,a) FOR(i,0,(a)) #define MP make_pair int n, m, star[30] = {}, howSolved[30] = {}; map<string, pair<int, int> > mp; map<pair<string, int>, int> score; int main() { cin >> n; for(int i = 0;i < n;i++){ cin >> star[i]; } cin >> m; string name; char solved; for(int i = 0;i < m;i++){ cin >> name >> solved; int num = solved - 'A'; howSolved[num]++; double nowSco = 50.0 * star[num] + 50.0 * star[num] / (0.8 + 0.2 * howSolved[num]); // cout << ";" << nowSco << endl; mp[name].first += nowSco; mp[name].second = i; score[MP(name, num)] = nowSco; } vector<pair<int, pair<int, string> > > data; map<string, pair<int, int> >::iterator it = mp.begin(); for(;it != mp.end();it++){ data.push_back(MP(-it->second.first, MP(it->second.second, it->first))); } sort(data.begin(), data.end()); for(int i = 0;i < data.size();i++){ string nowName = data[i].second.second; cout << i + 1 << " " << nowName << " "; for(int j = 0;j < n;j++){ cout << score[MP(nowName, j)] << " "; } cout << -data[i].first << endl; } return 0; }