結果

問題 No.449 ゆきこーだーの雨と雪 (4)
ユーザー guestguest
提出日時 2016-11-21 12:36:35
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 890 bytes
コンパイル時間 1,954 ms
コンパイル使用メモリ 186,224 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-23 15:58:40
合計ジャッジ時間 10,004 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 4 ms
4,348 KB
testcase_04 AC 4 ms
4,348 KB
testcase_05 AC 3 ms
4,348 KB
testcase_06 AC 3 ms
4,348 KB
testcase_07 AC 3 ms
4,348 KB
testcase_08 AC 4 ms
4,348 KB
testcase_09 AC 3 ms
4,348 KB
testcase_10 AC 3 ms
4,348 KB
testcase_11 AC 3 ms
4,348 KB
testcase_12 AC 904 ms
4,348 KB
testcase_13 TLE -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>


#define rep(x,to) for(int (x)=0;(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 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> jun;
	rep(i,n) cin >>hs[i];
	cin >> t;
	VI nos(n);
	rep(i, t){
		string s; char a;
		cin >> s >> a;
		if(!mp.count(s)) mp[s] = VI{ 0,0,0};
		if(a != '?'){
			if(mp[s][0] !=0){
				auto it = jun.find(pii(-mp[s][0],mp[s][1]));
				jun.erase(it);
			}
			mp[s][1] = i+1;
			int mz= a-'A';
			mp[s][0] += 50 * hs[mz] + (500 * hs[mz]) / (8 + 2* (++nos[mz]));
			jun[pii(-mp[s][0],mp[s][1])] = s;
		}else{
			auto it = jun.find(pii(-mp[s][0],mp[s][1]));
			int ans = distance(jun.begin(), it);
			cout << ans  + 1 <<"\n";
		}
	}
	
	return 0;
}
 
0