一、Java之ACM注意点
1. 类名称必须采用public class Main方式命名
2. 在有些OJ系统上,即便是输出的末尾多了一个“ ”,程序可能会输出错误,所以在我看来好多OJ系统做的是非常之垃圾
3. 有些OJ上的题目会直接将OI上的题目拷贝过来,所以即便是题目中有输入和输出文件,可能也不需要,因为在OJ系统中一般是采用标准输入输出,不需要文件
4. 在有多行...
分类:
编程语言 时间:
2014-12-04 15:45:14
阅读次数:
233
/*
*copyright(c) 2014,烟台大学计算机学院
*All rights reserved。
*文件名称:15周(oj 4)
*作者:王忠
*完成日期:2014.12.04
*版本号:v1.0
*
*问题描述:输入2个数,计算和差
*输入描述:随机两个数
*程序输出:输出和差
#include
using namespace std;
void ast(...
分类:
其他好文 时间:
2014-12-04 15:42:52
阅读次数:
182
??
/*
*copyright(c) 2014,烟台大学计算机学院
*All rights reserved。
*文件名称:15周(oj指针当形参)
*作者:王忠
*完成日期:2014.12.04
*版本号:v1.0
*
*问题描述:输入两个数,比较大小,并输出
*输入描述:随机两个数
*程序输出:排序后输出
#include
using namespace s...
分类:
其他好文 时间:
2014-12-04 14:02:24
阅读次数:
142
/*
*copyright(c) 2014,烟台大学计算机学院
*All rights reserved。
*文件名称:15周(oj指针当形参)
*作者:王忠
*完成日期:2014.12.03
*版本号:v1.0
*
*问题描述:输入2个数,前后颠倒后输出
*输入描述:随机两个数
*程序输出:颠倒后输出
#include
using namespace std;
voi...
分类:
其他好文 时间:
2014-12-04 14:00:41
阅读次数:
169
这是LeetCode上的一道题目,需要求二叉树中两点路径的最大和。原题是https://oj.leetcode.com/problems/binary-tree-maximum-path-sum/Given a binary tree, find the maximum path sum.The p...
分类:
其他好文 时间:
2014-12-03 23:05:58
阅读次数:
226
题目链接:https://oj.leetcode.com/problems/intersection-of-two-linked-lists/
分析:题目就是求两个链表的的第一个交点,如果没有交点,那么返回NULL。所谓两个链表有交点,那么两个链表的形状一定是"Y"的形状,不可能是"X"形状。
算法一:暴力遍历(时间复杂度O(m*n),空间复杂度O(1))
对于链表A中的每一...
分类:
其他好文 时间:
2014-12-03 21:26:17
阅读次数:
185
你打我啊Time Limit: 500ms Memory limit: 65536K有疑问?点这里^_^题目描述最近看了一个非常好玩的题,如果有972杯水,其中有971个没有毒的,1个有毒的, 其中有毒的水的毒性需要一周才会发作,那么,我们最少需要多少只小白鼠才能够在一周的时间内确定那一杯水是有毒的...
分类:
其他好文 时间:
2014-12-03 19:04:46
阅读次数:
192
题目网址:https://oj.leetcode.com/problems/two-sum/题目描述:Given an array of integers, find two numbers such that they add up to a specific target number.The ...
分类:
其他好文 时间:
2014-12-03 14:07:05
阅读次数:
161
Clone an undirected graph. Each node in the graph contains alabeland a list of itsneighbors.OJ's undirected graph serialization:Nodes are labeled uniq...
分类:
其他好文 时间:
2014-12-03 13:57:44
阅读次数:
157
Clone an undirected graph. Each node in the graph contains a label and
a list of its neighbors.
OJ's undirected graph serialization:
Nodes are labeled uniquely.
We use # as a separator for each...
分类:
其他好文 时间:
2014-12-03 12:34:14
阅读次数:
113