結果

問題 No.447 ゆきこーだーの雨と雪 (2)
ユーザー dohatsutsudohatsutsu
提出日時 2016-11-18 22:42:14
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 48 ms / 2,000 ms
コード長 948 bytes
コンパイル時間 1,925 ms
コンパイル使用メモリ 177,624 KB
実行使用メモリ 7,804 KB
最終ジャッジ日時 2023-08-17 11:10:49
合計ジャッジ時間 3,702 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 6 ms
4,380 KB
testcase_04 AC 5 ms
4,376 KB
testcase_05 AC 17 ms
4,496 KB
testcase_06 AC 35 ms
6,580 KB
testcase_07 AC 14 ms
4,376 KB
testcase_08 AC 19 ms
5,084 KB
testcase_09 AC 31 ms
5,828 KB
testcase_10 AC 5 ms
4,380 KB
testcase_11 AC 7 ms
4,380 KB
testcase_12 AC 11 ms
4,384 KB
testcase_13 AC 25 ms
5,380 KB
testcase_14 AC 31 ms
5,804 KB
testcase_15 AC 8 ms
4,376 KB
testcase_16 AC 8 ms
4,376 KB
testcase_17 AC 6 ms
4,376 KB
testcase_18 AC 4 ms
4,376 KB
testcase_19 AC 48 ms
7,804 KB
testcase_20 AC 34 ms
6,124 KB
testcase_21 AC 10 ms
4,376 KB
testcase_22 AC 7 ms
4,380 KB
testcase_23 AC 11 ms
4,380 KB
testcase_24 AC 31 ms
6,348 KB
testcase_25 AC 43 ms
7,220 KB
testcase_26 AC 16 ms
4,600 KB
testcase_27 AC 15 ms
4,388 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#define MAX_N 26
int N,T;
int a[MAX_N];
int cnt[MAX_N];
map<string,int> mp;
map<string,int> la;
map<string, map< int ,int> > b;

typedef pair<int,int> P;
typedef pair< P , string > PP;

int f(int A,int B){
  return 50*A+(int)( (50*A) / (0.8+0.2*B) +0.000000001);
}

int main(){
  cin>>N;
  for(int i=0;i<N;i++)cin>>a[i];
  cin>>T;
  for(int i=0;i<T;i++){
    string s;
    char p;
    cin>>s>>p;
    int id=p-'A';
    cnt[id]++;
    b[ s ][ id ] = f(a[id], cnt[id]);
    mp[ s ] += f( a[id], cnt[id]);
    la[s]=i;

  }

  vector< PP > vec;
  for( auto p : mp ){
    string s=p.first;
    vec.push_back( PP( P( -p.second, la[s]) , s ) );
  }

  sort( vec.begin(), vec.end() );
  for(int i=0;i<(int)vec.size();i++){
    string s=vec[i].second;
    int sum=0;
    cout<<i+1<<' '<<s;
    for(int j=0;j<N;j++){
      cout<<' '<<b[s][j];
      sum+=b[s][j];
    }
    cout<<' '<<sum<<endl;
  }
  return 0;
}
0