摘要:
统计每个字母出现的次数,然后进行比较就行了。代码如下:View Code 1 #include <cstdio> 2 #include <cstring> 3 #include <algorithm> 4 using namespace std; 5 6 int main() 7 { 8 #ifdef LOCAL 9 freopen("in", "r", stdin);10 #endif11 char alpha[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";12 char s[ 阅读全文
posted @ 2013-04-05 18:33
xiaobaibuhei
阅读(759)
评论(0)
推荐(1)
摘要:
这道题我把它想麻烦了,本来可以按绝对值直接排序的,我却把它们分成两组,再排序然后再从中选数进行合并,不知道怎么想的,不过倒是对sort函数又了解了一些。 下面是最初写的代码: View Code 1 #include <cstdio> 2 #include <algorithm> 3 #include <functional> 4 #include <cstdlib> 5 using namespace std; 6 7 const int maxn = 500000+10; 8 int color[2][maxn]; 9 10 int main 阅读全文
posted @ 2013-04-05 16:02
xiaobaibuhei
阅读(218)
评论(0)
推荐(0)

浙公网安备 33010602011771号