提交时间:2021-12-11 14:30:58
运行 ID: 27207
#include<bits/stdc++.h> using namespace std; int n,p,a,b,c,ans; int main(){ cin>>n; for(int i=1;i<=n;i++){ cin>>p; if(p==1){ cin>>a>>b; ans=ans+2*(a+b); }else if(p==2){ cin>>a; ans+=4*a; }else if(p==3){ cin>>a>>b>>c; ans=ans+a+b+c; } } cout<<ans; return 0; }