UC Browser
来源:互联网 发布:玻璃排版优化软件 编辑:程序博客网 时间:2024/04/27 14:02
You can get 10 experiences after using UC Browser one day in a row, 20 experiences for two days in a row, 30 experiences for three days in a row, 40 experiences for four days in a row, 50 experiences for five days in a row. If you use UC Browser six days in a row, the experiences you can get will be equal 10, like your using UC Browser one day in a row. It’s come back to the starting of your using UC Browser. It’s a circle.
Now you have known the Xi’s record of using UC Browser, I’ll hope you calculate the level of Xi’s account.
The first line of the input contains a single integer T (0<T<120) which is the number of test cases, followed by 2*T lines. For each test case, the first line is the number of days n (0<n<=100), the second line is a series of 0 and 1. 0 stands for not using UC browser on that day and 1 stands for using UC browser on that day.
For each test case, output the corresponding level of Xi’s account in one line.
2611010112111111110101
1
2
#include <iostream>#include <string>using namespace std;int c,sum;void run(int a){if (a==0) c=0;else{c++; c=c%5;}if ((c==0)&&(a==1)) sum=sum+50; else if (a==1) sum=sum+c*10;} int judge(int a){if (a<50) return 0;else if (a<150) return 1;else if (a<250) return 2;else if (a<350) return 3;else if (a<450) return 4;else if (a<550) return 5;else if (a<650) return 6;else if (a<750) return 7;else return 8;}int main(){ string s; int n,i,j,a,l; cin>>n; for (i=0;i<n;i++) { sum=0; c=0; cin>>l; cin>>s; for (j=0;j<l;j++) { a=s[j]-'0'; run(a); } cout<<judge(sum)<<endl; } return 0;}
- UC browser
- UC Browser
- UC Browser
- CSU 1003 UC Browser
- 1003: UC Browser
- CSU 1003: UC Browser
- ACM:H: UC Browser
- COJ 1003: UC Browser
- CSU-ACM 1003: UC Browser
- 隐藏比较深的模拟题1003: UC Browser
- browser
- browser
- Browser
- browser
- UC
- UC
- Google Browser, Firefox Browser?
- Free MIB Browser / MIB Browser / SNMP Browser.
- Android ANR总结
- SDCC 2017互联网应用架构实战峰会(上海站)嘉宾名单!
- nodejs中http协议的客户端请求
- HIVE和HBASE区别
- python编码问题
- UC Browser
- xslt的document能不能使用变量 ?该如何处理
- BZOJ 1006 最大势算法(完美消除序列求最小染色)
- transform变形和transform-origun变形原点
- 说说& 和&& 的区别
- Google Guava 教程
- Linux学习笔记2 shebang,ls,pwd,cd,type
- 96. Spring Boot之静态资源版本映射(解决js/css缓存问题)
- yum远程仓库有repodata.xml,报找不到repodata.xml