31 条题解
- 
  1lrj124 LV 10 @ 2017-02-17 20:50:44 #include <algorithm> #include <iostream> #include <string> #include <cstdio> using namespace std; int main() { string str = ""; const unsigned int no = str.npos; int n,m,k = 1,now; scanf("%d%d",&n,&m); for (int i = 1;i <= n;i++) str += 'B'; str += '_'; for (int i = 1;i <= m;i++) str += 'W'; printf("STEP%5d:",0); cout << str << endl; now = str.find("B_W"); swap(str[now],str[now+1]); printf("STEP%5d:",1); cout << str << endl; do { if (str.find("B_WB") != no) { now = str.find("B_WB"); swap(str[now],str[now+1]); } else if (str.find("_BW") != no) { now = str.find("_BW"); swap(str[now],str[now+2]); } else if (str.find("B_W") != no) { now = str.find("B_W"); swap(str[now+1],str[now+2]); } else if (str.find("BW_") != no) { now = str.find("BW_"); swap(str[now],str[now+2]); } else if (str.find("WB_") != no) { now = str.find("WB_"); swap(str[now+1],str[now+2]); } else if (str.find("_WB") != no) { now = str.find("_WB"); swap(str[now],str[now+1]); } printf("STEP%5d:",++k); cout << str << endl; } while (str.find("BW_") != no || str.find("_BW") != no || str.find("W_B") == no); return 0; }
- 
  0@ 2022-04-19 20:42:21orz......................................................... 
- 
  0@ 2015-10-14 17:58:16星际青蛙 
- 
  0@ 2015-08-16 21:29:25STEP后面不是5个空格,而是宽度为5 
 我也是醉了
- 
  0@ 2009-11-04 18:47:15编译通过... 
 ├ 测试数据 01:答案正确... 0ms
 ├ 测试数据 02:答案正确... 0ms
 ├ 测试数据 03:答案正确... 0ms
 ├ 测试数据 04:答案正确... 0ms
 ├ 测试数据 05:答案正确... 0ms
 ├ 测试数据 06:答案正确... 0ms
 ├ 测试数据 07:答案正确... 0ms
 ├ 测试数据 08:答案正确... 0ms
 ├ 测试数据 09:答案正确... 0ms
 ├ 测试数据 10:答案正确... 0ms
 ├ 测试数据 11:答案正确... 0ms
 ├ 测试数据 12:答案正确... 0ms
 ├ 测试数据 13:答案正确... 0ms
 ├ 测试数据 14:答案正确... 0ms
 ├ 测试数据 15:答案正确... 0ms
 ├ 测试数据 16:答案正确... 0ms
 ├ 测试数据 17:答案正确... 0ms
 ├ 测试数据 18:答案正确... 0ms
 ├ 测试数据 19:答案正确... 0ms
 ├ 测试数据 20:答案正确... 0ms
 ---|---|---|---|---|---|---|---|-
 Accepted 有效得分:100 有效耗时:0ms
- 
  0@ 2009-11-01 22:04:17第10个,庆祝一下 - -|||
 
- 
  0@ 2009-11-01 21:52:37第9个AC.... 
 有志者事竟成
 没有A的慢慢改吧
- 
  0@ 2009-11-01 20:37:25第7个AC,庆祝下。。 
- 
  0@ 2009-11-01 18:25:40好歹偶还有个75分…… 
- 
  0@ 2009-11-01 17:11:56厉害的标程 得了65分啊 voyagec2神牛得了70分! 
- 
  0@ 2009-11-01 16:08:09输出都够超时了。。 
- 
  0@ 2009-11-01 15:51:39史上输出最庞大,通过率最低的难度1.....囧。 
- 
  0@ 2009-11-01 15:28:52通过率0...orz... 
- 
  0@ 2009-11-01 11:50:38Flag Unaccepted 
 题号 P1649
 类型(?) 字符串处理
 通过 0人
 提交 91次
 通过率 0%
 难度 1
- 
  0@ 2009-11-01 11:03:30膜拜此题... 
 至今0人通过...
- 
  0@ 2009-10-31 20:23:07题号 P1649 
 类型(?) 字符串处理
 通过 0人
 提交 80次
 通过率 0%
 难度 1
- 
  0@ 2009-11-08 13:54:42
- 
  0@ 2009-10-31 15:38:45怎么都是格式错误? 
- 
  0@ 2009-11-02 09:33:53还是要改了数据才能过~~~ 
- 
  0@ 2009-10-31 15:06:51_