偶尔写写ACM水题还是挺好玩的。(好吧其实是老婆求助我才看滴) 题目链接:http://acm.hdu.edu.cn/showproblem.

今天心情好,刷了两到ACM水题,思路很简单都在注释里,所以直接贴代码: /** * @file 龟兔赛跑.cpp * @brief 龟兔赛跑 AC代码 (DP) * DP方程式: [到第i的充

题目: http://acm.hdu.edu.cn/showproblem.php?pid=3336 水题一道,主要是测试数据很水 不解释,贴代码: #include <iostream> #include <cstdio> #include <vector> #include <cstring> using namespace std; char str[200005]; vector<long>glo_Pos; int main() { int t; long output,i,n,j; scanf("%d",&t); while(t --) { output = 0; glo_Pos.clear(); scanf("%ld %s", &n, str); for(i = 0; i < n; i ++) { if(str[i] ==