#include<iostream>#include<string>#include<cstdio>using namespace std;int main(){ int t; cin>>t; int a = t; getchar(); while(t--){ string s; int n; cin>>n; getchar(); getline(cin,s,'\n'); int len = s.length(); string s…
这道题我觉得是除1000(A-B)外最简单的题了……不过还是提出一个小问题:在本机用gcc编译的时候我没包括string.h头文件,通过编译,为什么在sicily上却编译失败? 1510. Mispelling 限制条件 时间限制: 1 秒, 内存限制: 32 兆 题目描述 Misspelling is an art form that students seem to excel at. Write a program that removes the n <tex2html_verbatim…
这个题目很好,变形的题目也很多.简单DP. /* 1510 */ #include <cstdio> #include <cstring> #include <cstdlib> #define MAXN 105 char map[MAXN][MAXN]; int dp[MAXN][MAXN]; int min(int a, int b) { return a<b ? a:b; } int main() { int n; int i, j, k, tmp; int…
1510: Happy Robot Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 19 Solved: 7 Description Input There will be at most 1000 test cases. Each case contains a command sequence with no more than 1000 characters. Output For each test case, print the case…
Contest02-4 Spiral Time Limit: 1000ms Memory limit: 65536K 有疑问?点这里^_^ 题目描述 Given an odd number n, we can arrange integers from 1 to n*n in the shape of a spiral. The Figure 1 below illustrates the spiral made by integers from 1 to 25. As we see ab…
[it-ebooks]电子书列表 [2014]: Learning Objective-C by Developing iPhone Games || Leverage Xcode and Objective-C to develop iPhone games http://it-ebooks.info/book/3544/Learning Web App Development || Build Quickly with Proven JavaScript Techniques http:…
1226: [SDOI2009]学校食堂Dining Description 小F 的学校在城市的一个偏僻角落,所有学生都只好在学校吃饭.学校有一个食堂,虽然简陋,但食堂大厨总能做出让同学们满意的菜肴.当然,不同的人口味也不一定相同,但每个人的口味都可以用一个非负整数表示.由于人手不够,食堂每次只能为一个人做菜.做每道菜所需的时间是和前一道菜有关的,若前一道菜的对应的口味是a,这一道为b,则做这道菜所需的时间为(a or b)-(a and b),而做第一道菜是不需要计算时间的.其中,or 和a…