diff --git a/UVA/11488_zhouworld16.cpp b/UVA/11488_zhouworld16.cpp new file mode 100644 index 0000000..52b586d --- /dev/null +++ b/UVA/11488_zhouworld16.cpp @@ -0,0 +1,46 @@ +#include +#include +#include +#include +using namespace std; + +const int maxn=500000; +int tree[maxn][2]; +int val[maxn],cnt; +int n,ans; + +void insert(string st){ + int s=0; + for(int i=0;ians) ans=(i+1)*val[s]; + } +} + +void initial(){ + cnt=ans=0; + memset(val,0,sizeof(val)); + memset(tree,0,sizeof(tree)); +} + +void solve(){ + cin>>n; + for(int i=0;i>st; + insert(st); + } + cout<>t; + while(t-- >0){ + initial(); + solve(); + } + return 0; +}