上一页 1 ··· 26 27 28 29 30
摘要: Tangled in CablesYou are the owner of SmallCableCo and have purchased the franchise rights for a small town. Unfortunately, you lack enough funds to start your business properly and are relying on parts you have found in an old warehouse you bought. Among your finds is a single spool of cable and a 阅读全文
posted @ 2012-02-29 22:11 yejinru 阅读(214) 评论(0) 推荐(0) 编辑
摘要: 题目: A到B地,要有B到A地才行得通分析: 初始化 a[i] = i,然後讀入x,y,交換a[x],a[y]。最後判斷是否a[i]==i#include <set>#include <map>#include <cmath>#include <queue>#include <stack>#include <string>#include <vector>#include <cstdio>#include <cstring>#include <iostream>#includ 阅读全文
posted @ 2012-02-29 22:10 yejinru 阅读(233) 评论(5) 推荐(0) 编辑
摘要: 题目: 输入一串数字,求用这些数字能组成最大的整数分析: 可以用sort()函数比较排序,比较方式为 int cmp(string a,string b){return a+b>b+a;}即可#include <iostream>#include <algorithm>#include <string>using namespace std;string s[52];int cmp(string a,string b){ return a+b>b+a;}int main(){ freopen("sum.in","r& 阅读全文
posted @ 2012-02-22 19:09 yejinru 阅读(131) 评论(0) 推荐(0) 编辑
上一页 1 ··· 26 27 28 29 30