提交时间:2021-12-11 14:40:02

运行 ID: 27246

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