S t3 特殊性质B求调
  • 板块灌水区
  • 楼主Cuiyi_SAI
  • 当前回复0
  • 已保存回复0
  • 发布时间2023/10/22 09:30
  • 上次更新2023/11/2 12:01:06
查看原帖
S t3 特殊性质B求调
488775
Cuiyi_SAI楼主2023/10/22 09:30

全部RE了

#include <bits/stdc++.h>
using namespace std;
int T;
unordered_map<string,pair<long long,long long> > m;
int main(){
//	freopen("struct.in","r",stdin);
//	freopen("struct.out","w",stdout);
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	cin>>T;
	m["byte"]=make_pair(1ll,1ll);
	m["int"]=make_pair(4ll,4ll);
	m["short"]=make_pair(2ll,2ll);
	m["long"]=make_pair(8ll,8ll);
	while(T--){
		long long opt,k,lst=0ll,maxn=0ll;
		string s,name,tmp;
		cin>>opt>>s>>k;
		cin>>name>>tmp;
		lst=m[name].first;
		maxn=m[name].second;
		for(int i=2;i<=k;i++){
			cin>>name>>tmp;
			lst=(lst/m[name].second+(lst%m[name].second!=0))*m[name].second;
			lst+=m[name].first;
			maxn=max(maxn,m[name].second);
		}
		lst=(lst/maxn+(lst%maxn!=0))*maxn;
		m[s]=make_pair(lst,maxn); 
		cout<<lst<<' '<<maxn<<'\n';
	}
	return 0;
} 


2023/10/22 09:30
加载中...