标签:
心情不好,刷道水题.
#include<iostream> #include<cmath> using namespace std; int main() { int t; cin>>t; while(t--) { int m,n; cin>>m>>n; int flag=-1; int sum=0,t=0; if(m==0) flag++; for(int i=1;i<=n;i++) { int x; cin>>x; if(x==1||i==m||flag!=-1) flag++; if(flag>0) sum+=1*pow(2,t),t++; } if(sum==0) cout<<"0 RMB"<<endl; else cout<<sum<<"0000 RMB"<<endl; } return 0; }
标签:
原文地址:http://blog.csdn.net/zafkiel_nightmare/article/details/44939715