結果
| 問題 |
No.447 ゆきこーだーの雨と雪 (2)
|
| ユーザー |
|
| 提出日時 | 2016-11-18 23:12:09 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 58 ms / 2,000 ms |
| コード長 | 1,775 bytes |
| コンパイル時間 | 2,370 ms |
| コンパイル使用メモリ | 196,452 KB |
| 実行使用メモリ | 17,604 KB |
| 最終ジャッジ日時 | 2024-11-26 08:30:45 |
| 合計ジャッジ時間 | 3,755 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 25 |
ソースコード
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include "bits/stdc++.h"
#define REP(i,a,b) for(int i=a;i<b;++i)
#define rep(i,n) REP(i,0,n)
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define ALL(a) begin(a),end(a)
#define ifnot(a) if(not (a))
#define dump(x) cerr << #x << " = " << (x) << endl
using namespace std;
// #define int ll
#ifdef _MSC_VER
const bool test = true;
#else
const bool test = false;
#endif
int dx[] = { 0,1,0,-1 };
int dy[] = { 1,0,-1,0 };
#define INF (1 << 28)
ull mod = (int)1e9 + 7;
//.....................
const int MAX = (int)2e5 + 5;
int N;
int L[MAX];
int T;
string name[MAX];
char P[MAX];
int solve_pro_cnt[MAX];
int pro_score[100][100];
map<pair<string, int>, int> each_score;
struct Pro {
int score, time;
string name;
bool operator < (const Pro& p) const {
if (score < p.score) return true;
if (score > p.score) return false;
if (time < p.time) return false;
if (time > p.time) return true;
return false;
}
};
int getscore(int l, int n, string name) {
solve_pro_cnt[n]++;
int res = 50 * l + 50 * l * 10 / (8 + 2 * solve_pro_cnt[n]);
each_score[{name, n}] = res;
return res;
}
int main() {
cin >> N;
rep(i, N) cin >> L[i];
cin >> T;
rep(i, T) {
cin >> name[i] >> P[i];
P[i] -= 'A';
}
map<string, pair<int, int>> m;
rep(i, T) {
int tmp = getscore(L[P[i]], P[i], name[i]);
m[name[i]].first += tmp;
m[name[i]].second = i;
}
vector<Pro> v;
for (auto a : m) {
v.push_back({ a.second.first, a.second.second ,a.first });
}
sort(ALL(v));
rep(i, v.size()) {
cout << i + 1;
int j = v.size() - 1 - i;
cout << " " << v[j].name;
rep(i, N) {
cout << " " << each_score[{v[j].name, i}];
}
cout << " " << v[j].score;
cout << endl;
}
return 0;
}