結果
問題 | No.447 ゆきこーだーの雨と雪 (2) |
ユーザー | naimonon77 |
提出日時 | 2016-11-19 11:55:18 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 24 ms / 2,000 ms |
コード長 | 1,798 bytes |
コンパイル時間 | 2,090 ms |
コンパイル使用メモリ | 194,336 KB |
実行使用メモリ | 11,136 KB |
最終ジャッジ日時 | 2024-05-05 04:06:28 |
合計ジャッジ時間 | 3,912 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 5 ms
9,728 KB |
testcase_01 | AC | 5 ms
9,984 KB |
testcase_02 | AC | 5 ms
9,728 KB |
testcase_03 | AC | 9 ms
9,856 KB |
testcase_04 | AC | 8 ms
9,984 KB |
testcase_05 | AC | 18 ms
10,624 KB |
testcase_06 | AC | 21 ms
10,880 KB |
testcase_07 | AC | 14 ms
10,068 KB |
testcase_08 | AC | 14 ms
10,496 KB |
testcase_09 | AC | 21 ms
10,752 KB |
testcase_10 | AC | 7 ms
9,984 KB |
testcase_11 | AC | 10 ms
9,856 KB |
testcase_12 | AC | 10 ms
10,112 KB |
testcase_13 | AC | 19 ms
10,596 KB |
testcase_14 | AC | 23 ms
11,008 KB |
testcase_15 | AC | 10 ms
9,856 KB |
testcase_16 | AC | 9 ms
10,112 KB |
testcase_17 | AC | 10 ms
9,856 KB |
testcase_18 | AC | 6 ms
9,856 KB |
testcase_19 | AC | 24 ms
11,136 KB |
testcase_20 | AC | 23 ms
11,008 KB |
testcase_21 | AC | 10 ms
10,112 KB |
testcase_22 | AC | 10 ms
9,856 KB |
testcase_23 | AC | 11 ms
9,984 KB |
testcase_24 | AC | 17 ms
10,752 KB |
testcase_25 | AC | 22 ms
10,952 KB |
testcase_26 | AC | 13 ms
10,240 KB |
testcase_27 | AC | 13 ms
10,112 KB |
ソースコード
#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]; map<pair<string, int>, int> each_score; struct Pro { int score, time; string name; vector<int> each_score; 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) { solve_pro_cnt[n]++; int res = 50 * l + 50 * l * 10 / (8 + 2 * solve_pro_cnt[n]); 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, Pro> m; rep(i, T) { if (m.count(name[i]) == 0) m[name[i]].each_score.resize(N + 1); int tmp = getscore(L[P[i]], P[i]); m[name[i]].name = name[i]; m[name[i]].each_score[P[i]] = tmp; m[name[i]].score += tmp; m[name[i]].time = i; } vector<Pro> v; for (auto a : m) { v.push_back(a.second); } sort(ALL(v)); rep(i, v.size()) { cout << i + 1; int j = v.size() - 1 - i; cout << " " << v[j].name; rep(i, N) { cout << " " << v[j].each_score[i]; } cout << " " << v[j].score; cout << endl; } return 0; }