上一页 1 2 3 4 5 6 7 ··· 18 下一页
摘要: 12. Integer to Romanchar s[100];char* intToRoman(int num) { char rs[] = "MDCLXVI"; int ts[] = { 1000,500,100,50,10,5,1 }; int... 阅读全文
posted @ 2018-08-26 23:33 ACLJW 阅读(86) 评论(0) 推荐(0) 编辑
摘要: 13. Roman to Integerint romanToInt(char* s) { int dic[26]; dic['I'-'A'] = 1; dic['V'-'A'] = 5; dic['X'-'A'] = 10; dic['... 阅读全文
posted @ 2018-08-26 22:32 ACLJW 阅读(76) 评论(0) 推荐(0) 编辑
摘要: Parentheses Balance之前脑子可能坏掉了。。。简单的栈的应用,要注意的一个地方是一定要用 fgets ,因为如果是空串的话 scanf 会直接读下一行。#includeusing namespace std;const int maxn = 128 +... 阅读全文
posted @ 2018-08-21 16:22 ACLJW 阅读(108) 评论(0) 推荐(0) 编辑
摘要: Tree Reconstruction#includeusing namespace std;const int maxn = 1000 + 5;int n,x,root;int pos[maxn];vectorA[maxn];int main(){ // fr... 阅读全文
posted @ 2018-08-20 23:13 ACLJW 阅读(117) 评论(0) 推荐(0) 编辑
摘要: Bandwidth注意节点不一定是按字母表顺序从前到后用的,也有可能是A C 却没用B,因为这个TLE了好几次。。#includeusing namespace std;const int maxn = 26;int L,w;char s[100];int seq[m... 阅读全文
posted @ 2018-08-18 22:48 ACLJW 阅读(126) 评论(0) 推荐(0) 编辑
摘要: Krypton Factor注意 && 别写成 & 了。。。#includeusing namespace std;const int maxn = 80 + 5;int n,L,cnt;int A[maxn];int dfs(int cur){ if(cnt+... 阅读全文
posted @ 2018-08-17 00:39 ACLJW 阅读(107) 评论(0) 推荐(0) 编辑
摘要: Prime Ring Problem#includeusing namespace std;const int maxn = 17;int n;int A[maxn],vis[maxn],p[2*maxn];int isPrime(int n){ for(int... 阅读全文
posted @ 2018-08-16 00:13 ACLJW 阅读(86) 评论(0) 推荐(0) 编辑
摘要: Fractions Again?!x 要用 long long。#includeusing namespace std;const int maxk = 10000;int k;long long x[2*maxk];int y[2*maxk];int judge(i... 阅读全文
posted @ 2018-08-14 12:35 ACLJW 阅读(228) 评论(0) 推荐(0) 编辑
摘要: Maximum Product#includeusing namespace std;const int maxn = 20;int n;int seq[maxn];int main(){ // freopen("data.in","r",stdin); ... 阅读全文
posted @ 2018-08-14 11:50 ACLJW 阅读(116) 评论(0) 推荐(0) 编辑
摘要: Division#includeusing namespace std;const int maxn = 64 + 5;int n,a[30240][6];int num,kase = 0,cnt = 0;int Pow(int a,int b){ int n ... 阅读全文
posted @ 2018-08-14 00:07 ACLJW 阅读(114) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 18 下一页