結果
問題 | No.447 ゆきこーだーの雨と雪 (2) |
ユーザー | guest |
提出日時 | 2016-11-19 23:34:06 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 15 ms / 2,000 ms |
コード長 | 1,093 bytes |
コンパイル時間 | 1,687 ms |
コンパイル使用メモリ | 186,212 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-05-05 10:21:16 |
合計ジャッジ時間 | 2,820 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
5,248 KB |
testcase_01 | AC | 2 ms
5,376 KB |
testcase_02 | AC | 2 ms
5,376 KB |
testcase_03 | AC | 5 ms
5,376 KB |
testcase_04 | AC | 4 ms
5,376 KB |
testcase_05 | AC | 7 ms
5,376 KB |
testcase_06 | AC | 13 ms
5,376 KB |
testcase_07 | AC | 9 ms
5,376 KB |
testcase_08 | AC | 8 ms
5,376 KB |
testcase_09 | AC | 10 ms
5,376 KB |
testcase_10 | AC | 4 ms
5,376 KB |
testcase_11 | AC | 5 ms
5,376 KB |
testcase_12 | AC | 5 ms
5,376 KB |
testcase_13 | AC | 10 ms
5,376 KB |
testcase_14 | AC | 11 ms
5,376 KB |
testcase_15 | AC | 6 ms
5,376 KB |
testcase_16 | AC | 4 ms
5,376 KB |
testcase_17 | AC | 5 ms
5,376 KB |
testcase_18 | AC | 3 ms
5,376 KB |
testcase_19 | AC | 15 ms
5,376 KB |
testcase_20 | AC | 12 ms
5,376 KB |
testcase_21 | AC | 5 ms
5,376 KB |
testcase_22 | AC | 5 ms
5,376 KB |
testcase_23 | AC | 7 ms
5,376 KB |
testcase_24 | AC | 12 ms
5,376 KB |
testcase_25 | AC | 14 ms
5,376 KB |
testcase_26 | AC | 8 ms
5,376 KB |
testcase_27 | AC | 8 ms
5,376 KB |
ソースコード
#include <bits/stdc++.h> #define rep2(x,fr,to) for(int (x)=(fr);(x)<(to);(x)++) #define rep(x,to) for(int (x)=0;(x)<(to);(x)++) #define repr(x,fr,to) for(int (x)=(fr);(x)>=(to);(x)--) #define all(c) (c).begin(),(c).end() #define sz(v) (int)(v).size() #define dnmin(a,b) (a)=min((a),(b)) using namespace std; typedef long long ll; typedef vector<int> VI; typedef pair<int, int> pii; int main(){ int n, t; cin >>n; VI hs(n); unordered_map<string, VI> mp; map<pii, string> jn; VI nos(n); rep(i,n) cin >>hs[i]; cin >> t; rep(i, t){ string s; char a; cin >> s >> a; int osc=-1, ono=-1; if(!mp.count(s)) mp[s] = VI(n+2, 0); else { osc=mp[s][n+1]; ono=mp[s][n];} mp[s][n] = i+1; int mz= a-'A'; mp[s][mz] = 50 * hs[mz] + (500 * hs[mz]) / (8 + 2* (++nos[mz])); mp[s][n+1] += mp[s][mz]; if(osc !=-1) jn.erase(pii(-osc, ono)); jn[pii(-mp[s][n+1], mp[s][n])] = s; } int ct=1; for(auto zx: jn){ auto nm = zx.second; cout << ct++ <<" " << nm <<" "; rep(i,n) cout << (i? " ":"") << mp[nm][i]; cout << " " << -zx.first.first <<"\n"; } return 0; }