輸入的最小按鍵次數
摘要:
題目:http://acm.hdu.edu.cn/showproblem.php?pid=2577用動態規劃角。on[i]表示在lock為開的時候輸入第i個字符時的最小按鍵次數。off[i]表示在lock為關的時候輸入第i個字符時的最小按鍵次數。View Code #include "iostream"#include "string"using namespace std;#define MAX 105int on[MAX], off[MAX];int main(){ int n; string str; cin>>n; while(n-- 閱讀全文
posted @ 2012-05-13 23:03 More study needed. 閱讀(337) 評論(0) 推薦(0)
浙公網安備 33010602011771號