結果

問題 No.447 ゆきこーだーの雨と雪 (2)
ユーザー 0w10w1
提出日時 2016-11-27 19:51:08
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 43 ms / 2,000 ms
コード長 1,056 bytes
コンパイル時間 2,485 ms
コンパイル使用メモリ 198,288 KB
実行使用メモリ 7,792 KB
最終ジャッジ日時 2023-08-18 08:30:27
合計ジャッジ時間 4,075 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 6 ms
4,380 KB
testcase_04 AC 6 ms
4,380 KB
testcase_05 AC 17 ms
4,596 KB
testcase_06 AC 32 ms
6,532 KB
testcase_07 AC 13 ms
4,620 KB
testcase_08 AC 17 ms
5,104 KB
testcase_09 AC 29 ms
5,732 KB
testcase_10 AC 5 ms
4,376 KB
testcase_11 AC 7 ms
4,376 KB
testcase_12 AC 11 ms
4,380 KB
testcase_13 AC 24 ms
5,360 KB
testcase_14 AC 30 ms
5,780 KB
testcase_15 AC 8 ms
4,376 KB
testcase_16 AC 7 ms
4,376 KB
testcase_17 AC 6 ms
4,376 KB
testcase_18 AC 3 ms
4,380 KB
testcase_19 AC 43 ms
7,792 KB
testcase_20 AC 32 ms
6,092 KB
testcase_21 AC 9 ms
4,376 KB
testcase_22 AC 7 ms
4,376 KB
testcase_23 AC 10 ms
4,380 KB
testcase_24 AC 27 ms
6,096 KB
testcase_25 AC 37 ms
7,200 KB
testcase_26 AC 16 ms
4,660 KB
testcase_27 AC 13 ms
4,420 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
}
0