![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
ACM
handongopqwe
这个作者很懒,什么都没留下…
展开
-
螺旋矩阵核心代码
螺旋矩阵核心 顺时针 **i0=0; i1 = N -1; for (k=0;k<=N/2;k++) { j0 = k; for (j=i0;j<=i1;j++) {a[j0][j]=s; s++;}; for (i=j0+1;i<=i1;i++) {a[i][i1]=s; s++;}; for (j=i1-1;j >=i0;j–) {a[i1][j]=s; s++;}; for转载 2015-06-17 20:51:48 · 441 阅读 · 0 评论 -
HDU 1009 FatMouse' Trade
Problem Description FatMouse prepared M pounds of cat food, ready to trade with the cats guarding the warehouse containing his favorite food, JavaBean. The warehouse has N rooms. The i-th room contai原创 2015-07-29 18:01:24 · 229 阅读 · 0 评论 -
HDU 1013 Digital Roots (简单题)
因为数据大,拿long long过不去,所以拿char数组实现。#include <iostream> #include <algorithm> #include <string.h> using namespace std; int main() { char str[10001]; while(cin >> str ){ ...原创 2018-03-12 18:57:27 · 140 阅读 · 0 评论 -
【力扣】16. 最接近的三数之和
AC代码 排序+双指针 public int threeSumClosest(int[] nums, int target) { Arrays.sort(nums); int bestNum = nums[0] + nums[1] + nums[2]; for (int i = 0;i < nums.len...原创 2019-07-10 22:47:47 · 153 阅读 · 0 评论