提交时间:2021-12-18 15:11:30

运行 ID: 27796

#include<bits/stdc++.h> using namespace std; int n,m,ans,a,b,c; int main(){ cin>>n; for(int i=1;i<=n;i++){ cin>>m; if(m==1){ cin>>a>>b; ans+=2*a+2*b; }else if(m==2){ cin>>a; ans+=4*a; }else if(m==3){ cin>>a>>b>>c; ans+=a+b+c; } } cout<<ans; return 0; }