摘要: 一道简单的比较查找题,刚开始数组开得不够大,RE。 代码如下:View Code 1 #include 2 #include 3 using namespace std; 4 5 const int maxn = 1000000; 6 char s[maxn], t[maxn]; 7 int main() 8 { 9 #ifdef LOCAL10 freopen("in", "r", stdin);11 #endif12 int slen, tlen;13 while(scanf("%s%s", s, t) != EOF)14 {15 阅读全文
posted @ 2013-04-15 17:20 xiaobaibuhei 阅读(150) 评论(0) 推荐(0)
摘要: 用栈进行模拟就行了,不过要考虑空行的情况,该开始就没考虑数据有空行的情况,认为不可能,WA了一次,果然没什么理所当然啊。 代码如下:View Code 1 #include <cstdio> 2 #include <stack> 3 #include <cstring> 4 using namespace std; 5 6 const int maxn = 150; 7 8 int main() 9 {10 #ifdef LOCAL11 freopen("in", "r", stdin);12 #endif13 int 阅读全文
posted @ 2013-04-15 14:53 xiaobaibuhei 阅读(234) 评论(0) 推荐(0)