摘要: https://www.hackerrank.com/contests/w3/challenges/sam-and-substringsDP。注意到以N[i]结尾的每个字符串的子数字和有规律:53125 | 3 53 | 1 31 531 | 2 12 312 5312sd[2] = 1 + 31 ... 阅读全文
posted @ 2014-08-14 18:19 阿牧遥 阅读(409) 评论(0) 推荐(1)
摘要: https://www.hackerrank.com/contests/w3/challenges/the-love-letter-mystery简单题。#include #include #include using namespace std;int main() { int N; cin >>... 阅读全文
posted @ 2014-08-14 15:46 阿牧遥 阅读(206) 评论(0) 推荐(0)
摘要: https://www.hackerrank.com/contests/w4/challenges/crush第一眼觉得要用线段树,但据说会超时。其实这个可以通过生成pair排序来做。#include #include #include #include using namespace std;in... 阅读全文
posted @ 2014-08-14 15:20 阿牧遥 阅读(339) 评论(0) 推荐(0)
摘要: 简单题。#include #include using namespace std;int main() { int T; cin >> T; while (T--) { string s; cin >> s; int l = 0; ... 阅读全文
posted @ 2014-08-14 00:08 阿牧遥 阅读(225) 评论(0) 推荐(0)