結果
| 問題 |
No.447 ゆきこーだーの雨と雪 (2)
|
| ユーザー |
|
| 提出日時 | 2016-11-27 19:51:08 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 37 ms / 2,000 ms |
| コード長 | 1,056 bytes |
| コンパイル時間 | 2,225 ms |
| コンパイル使用メモリ | 200,932 KB |
| 実行使用メモリ | 7,936 KB |
| 最終ジャッジ日時 | 2024-11-27 12:17:41 |
| 合計ジャッジ時間 | 3,423 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 25 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
signed main(){
int N; cin >> N;
vector< int > L( N );
for( int i = 0; i < N; ++i )
cin >> L[ i ];
int T; cin >> T;
vector< int > p_ac_cnt( N );
map< string, int > scr;
map< string, map< int, int > > scr_breakdown;
map< string, int > last_sub;
for( int i = 0; i < T; ++i ){
string name; string p; cin >> name >> p;
int P = p[ 0 ];
int pnt = 50 * L[ P - 'A' ] + ( 50 * L[ P - 'A' ] ) / ( 0.8 + 0.2 * ++p_ac_cnt[ P - 'A' ] );
scr_breakdown[ name ][ P - 'A' ] = pnt;
scr[ name ] += pnt;
last_sub[ name ] = i;
}
priority_queue< tuple< int, int, string > > pq;
for( auto it = scr.begin(); it != scr.end(); ++it )
pq.emplace( scr[ it->first ], -last_sub[ it->first ], it->first );
for( int rank = 1; not pq.empty(); ++rank ){
cout << rank << " ";
string name = get< 2 >( pq.top() ); pq.pop();
cout << name << " ";
for( int i = 0; i < N; ++i )
cout << scr_breakdown[ name ][ i ] << " ";
cout << scr[ name ] << endl;
}
return 0;
}