上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 20 下一页
摘要: public class Solution { public ListNode addTwoNumbers(ListNode l1, ListNode l2) { ListNode dummy = new ListNode(-1); ListNode cur = dummy; int carry = 阅读全文
posted @ 2017-01-26 23:54 王坤1993 阅读(152) 评论(0) 推荐(0) 编辑
摘要:  public class Solution { public int[] twoSum(int[] numbers, int target) { HashMap<Integer, Integer> map = new HashMap<Integer, Integer>(); int[] 阅读全文
posted @ 2017-01-26 00:03 王坤1993 阅读(139) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> using namespace std; __int64 gcd(__int64 a,__int64 b) { return b?gcd(b,a%b):a; } __int64 lcm(__int64 a,__int64 b) { return a/gcd(a, 阅读全文
posted @ 2017-01-25 00:14 王坤1993 阅读(143) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> int calc(int a, int b) { if(a==0 || a==1 || a==5 || a==6) return a; if(a==2) { if(b%4==1) return 2; if(b%4==2) return 4; if(b%4==3) 阅读全文
posted @ 2017-01-25 00:13 王坤1993 阅读(177) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> int main() { int k, a, i, flag; while(~scanf("%d", &k)) { for(i=0; i<66; i++) { if((18+k*i)%65==0) break; } if(i<66) printf("%d\n", 阅读全文
posted @ 2017-01-25 00:13 王坤1993 阅读(146) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> using namespace std; int main() { int n,m,a,sum=0; while(cin>>n) { while (n--) { cin>>m; sum=0; while (m--) { cin>>a; sum=sum+a; } 阅读全文
posted @ 2017-01-25 00:12 王坤1993 阅读(231) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> using namespace std; int main() { int b,a; while(cin>>a>>b) { cout<<a+b<<endl<<endl; } return 0; } 阅读全文
posted @ 2017-01-25 00:11 王坤1993 阅读(179) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>using namespace std;int main(){ int n; while(cin>>n){ int sum=0; int i,m; for(i=1;i<=n;++i){ cin>>m; sum+=m; } cout<<sum<<endl; } re 阅读全文
posted @ 2017-01-25 00:09 王坤1993 阅读(227) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> using namespace std; int main() { int n,m,a,sum=0; while(cin>>n) { while (n--) { cin>>m; sum=0; while(m--) { cin>>a; sum=sum+a; } 阅读全文
posted @ 2017-01-25 00:08 王坤1993 阅读(184) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> using namespace std; int main() { int n,a,sum=0; while(cin>>n&&n!=0) { while (n--) { cin>>a; sum=sum+a; } cout<<sum<<endl; sum=0; 阅读全文
posted @ 2017-01-25 00:07 王坤1993 阅读(205) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 20 下一页