摘要: 笔者是 2016 级中山大学计科专业的学生,之前先后学过 Pascal、 C/C++,并有若干年的 OI 经验(虽然成绩不佳)。 根据大二专选课程《高级编程技术》的作业要求,开通了本博客,旨在记录下笔者的 Python 学习之旅。 其实笔者在早些时候就已经有了学习 Python 的念头,最主要原因是 阅读全文
posted @ 2018-03-10 21:42 Efve 阅读(107) 评论(0) 推荐(0) 编辑
摘要: Problem Jamie has recently found undirected weighted graphs with the following properties very interesting: The graph is connected and contains exactl 阅读全文
posted @ 2018-06-19 02:31 Efve 阅读(329) 评论(0) 推荐(0) 编辑
摘要: Problem You have m = n·k wooden staves. The i-th stave has length ai. You have to assemble n barrels consisting of k staves each, you can use any k st 阅读全文
posted @ 2018-06-19 02:20 Efve 阅读(189) 评论(0) 推荐(0) 编辑
摘要: Problem The king is left alone on the chessboard. In spite of this loneliness, he doesn't lose heart, because he has business of national importance. 阅读全文
posted @ 2018-06-19 02:10 Efve 阅读(211) 评论(0) 推荐(0) 编辑
摘要: Problem Vasya has found a strange device. On the front panel of a device there are: a red button, a blue button and a display showing some positive in 阅读全文
posted @ 2018-06-19 02:00 Efve 阅读(214) 评论(0) 推荐(0) 编辑
摘要: Generate matrices A, with random Gaussian entries, B, a Toeplitz matrix, where A ∈Rn×m and B ∈Rm×m, for n = 200, m = 500.Exercise 9.1: Matrix operatio 阅读全文
posted @ 2018-05-23 09:57 Efve 阅读(258) 评论(0) 推荐(0) 编辑
摘要: 中英题面 在未排序的数组中找到第 k 个最大的元素。请注意,你需要找的是数组排序后的第 k 个最大的元素,而不是第 k 个不同的元素。 Find the kth largest element in an unsorted array. Note that it is the kth largest 阅读全文
posted @ 2018-05-20 05:05 Efve 阅读(643) 评论(0) 推荐(0) 编辑
摘要: 中英题面 你是一个专业的小偷,计划偷窃沿街的房屋,每间房内都藏有一定的现金。这个地方所有的房屋都围成一圈,这意味着第一个房屋和最后一个房屋是紧挨着的。同时,相邻的房屋装有相互连通的防盗系统,如果两间相邻的房屋在同一晚上被小偷闯入,系统会自动报警。 After robbing those houses 阅读全文
posted @ 2018-05-20 05:01 Efve 阅读(225) 评论(0) 推荐(0) 编辑
摘要: 中英题面 在 O(n log n) 时间复杂度和常数级空间复杂度下,对链表进行排序。 Sort a linked list in O(n log n) time using constant space complexity. 示例 1: 输入: 4->2->1->3 输出: 1->2->3->4 阅读全文
posted @ 2018-05-20 04:56 Efve 阅读(216) 评论(0) 推荐(0) 编辑
摘要: 中英题面 在一条环路上有 N 个加油站,其中第 i 个加油站有汽油 gas[i] 升。 There are N gas stations along a circular route, where the amount of gas at station i is gas[i]. 你有一辆油箱容量无 阅读全文
posted @ 2018-05-20 04:52 Efve 阅读(262) 评论(0) 推荐(0) 编辑
摘要: 中英题面 给定一个三角形,找出自顶向下的最小路径和。每一步只能移动到下一行中相邻的结点上。 Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbe 阅读全文
posted @ 2018-05-20 04:41 Efve 阅读(489) 评论(0) 推荐(0) 编辑
摘要: 中英题面 给定一个非负整数数组,你最初位于数组的第一个位置。 Given an array of non-negative integers, you are initially positioned at the first index of the array. 数组中的每个元素代表你在该位置可 阅读全文
posted @ 2018-05-20 04:35 Efve 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 中英题面 合并 k 个排序链表,返回合并后的排序链表。请分析和描述算法的复杂度。 Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. 示例: 输入: [ 阅读全文
posted @ 2018-05-20 04:28 Efve 阅读(451) 评论(0) 推荐(0) 编辑
摘要: 中英题面 给定两个大小为 m 和 n 的有序数组 nums1 和 nums2 。 There are two sorted arrays nums1 and nums2 of size m and n respectively. 请找出这两个有序数组的中位数。要求算法的时间复杂度为 O(log (m 阅读全文
posted @ 2018-05-20 04:22 Efve 阅读(1162) 评论(1) 推荐(0) 编辑
摘要: 中英题面 给定两个二叉树,写一个函数来检查它们是否相同。 Given two binary trees, write a function to check if they are the same or not. 如果两棵树在结构上相同并且节点具有相同的值,则认为它们是相同的。 Two binar 阅读全文
posted @ 2018-04-05 17:06 Efve 阅读(221) 评论(0) 推荐(0) 编辑
摘要: 中英题面 你正在爬楼梯。距离顶部还有 n 台阶。 You are climbing a stair case. It takes n steps to reach to the top. 每次你可以爬 1 或 2 个台阶。你有多少种不同的方式可以爬到楼顶呢? Each time you can ei 阅读全文
posted @ 2018-04-05 16:54 Efve 阅读(202) 评论(0) 推荐(0) 编辑
摘要: 中英题面 给定一个排序数组和一个目标值,如果在数组中找到目标值则返回索引。如果没有,返回到它将会被按顺序插入的位置。 Given a sorted array and a target value, return the index if the target is found. If not, r 阅读全文
posted @ 2018-04-05 14:52 Efve 阅读(198) 评论(0) 推荐(0) 编辑
摘要: 中英题面 Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. 合并两 阅读全文
posted @ 2018-04-05 14:36 Efve 阅读(217) 评论(0) 推荐(0) 编辑
摘要: 中英题面 给定一个链表,删除链表的倒数第 n 个节点并返回头结点。 Given a linked list, remove the nth node from the end of list and return its head. 例如, For example, 说明: 给的 n 始终是有效的。 阅读全文
posted @ 2018-04-05 14:22 Efve 阅读(1039) 评论(0) 推荐(0) 编辑
摘要: Problem Write a program which judges wheather given length of three side form a right triangle. Print "YES" if the given sides (integers) form a right 阅读全文
posted @ 2018-03-26 21:24 Efve 阅读(362) 评论(0) 推荐(0) 编辑
摘要: Problem Write a program which computes the digit number of sum of two integers a and b. Input There are several test cases. Each test case consists of 阅读全文
posted @ 2018-03-26 20:59 Efve 阅读(512) 评论(0) 推荐(0) 编辑
摘要: Problem There is a data which provides heights (in meter) of mountains. The data is only for ten mountains. Write a program which prints heights of th 阅读全文
posted @ 2018-03-25 22:29 Efve 阅读(252) 评论(0) 推荐(0) 编辑
摘要: Problem Write a program which prints multiplication tables in the following format: 1x1=1 1x2=2 . . 9x8=72 9x9=81 Input No input. Output 题目大意 输出九九乘法表。 阅读全文
posted @ 2018-03-25 20:56 Efve 阅读(226) 评论(0) 推荐(0) 编辑
摘要: 问题 用 turtle 做一个五环图,并仿照下图标上你的学号、姓名和“I love programming!”字样。 问题解读 搜了一下,奥运五环的距离半径等比例似乎没有标准规定。 在纸上画了画感受感受之后,决定采用圆心之间呈等腰直角三角形,且横向相邻两个环边界的距离与斜向相邻两个环相交的距离相等的 阅读全文
posted @ 2018-03-17 17:46 Efve 阅读(1002) 评论(0) 推荐(0) 编辑
摘要: Problem You have a number of stones with known weights w 1, …, wn. Write a program that will rearrange the stones into two piles such that weight diff 阅读全文
posted @ 2018-03-17 02:10 Efve 阅读(380) 评论(0) 推荐(0) 编辑
摘要: Problem The problem is so easy, that the authors were lazy to write a statement for it! Input The input stream contains a set of integer numbers Ai (0 阅读全文
posted @ 2018-03-11 21:50 Efve 阅读(247) 评论(0) 推荐(0) 编辑
摘要: Problem Calculate a + b Input a and b a and b Output a + b a + b Example Notes Use + operator 题目大意 读入 a 和 b,输出 a + b。 题目解读 许多 OJ 的入门第一题,没啥好说的。 代码 1 s 阅读全文
posted @ 2018-03-10 22:09 Efve 阅读(215) 评论(0) 推荐(0) 编辑