小明上学(CCF认证2018-12-1 )

 

 

#include<bits/stdc++.h>
using namespace std;
int main(){
    int red,yellow,green,N,a,b,ans=0;
    cin>>red>>yellow>>green>>N;
    while(~scanf("%d%d",&a,&b))
        if(a==0||a==1)
            ans+=b;
        else if(a==2)
            ans+=b+red;
    cout<<ans<<endl;
    return 0;
}

 

posted @ 2019-09-03 23:09  __MEET  阅读(243)  评论(0编辑  收藏  举报