登录记录/var/run/utmp,/var/log/wtmpwtmp和utmp文件都是二进制文件,他们不能被诸如tail命令剪贴或合并(使用cat命令)。用户需要使用who、w、users、last和ac来使用这两个文件包含的信息。last命令往回搜索wtmp来显示自从文件第一次创建以来登录过的用...
分类:
系统相关 时间:
2014-07-18 14:21:39
阅读次数:
331
感觉动态规划很模糊,怎么办呢???
狂刷题吧!!!!!!!!!!!!!!!!!!!!!!!!!
1.POJ 2479 Maximum sum
首刷水题!!!!
双向统计最大和。
AC代码如下:
#include
#include
#include
#define inf -1000000000
using namespace std;
int main()
{
int ...
分类:
其他好文 时间:
2014-07-18 12:37:39
阅读次数:
228
题目链接:http://poj.org/problem?id=1789
思路:把每一行看成一个一个点,每两行之间不懂得字符个数就看做是权值。然后用kruskal算法计算出最小生成树
我写了两个代码一个是用优先队列写的,但是超时啦,不知道为什么,希望有人可以解答。后面用的数组sort排序然后才AC。
code:
数组sort排序AC代码:
#include
#include
#includ...
分类:
其他好文 时间:
2014-07-18 12:27:55
阅读次数:
242
题意:给你一个棋盘,上面的字母代表机器人要走的方向。如果机器人能走出这个棋盘,则输出机器人所走的步数,否则输出该机器人在走向无限循环前所走的步数,及无限循环所要走的格子数
思路:直接模拟,没有思路(大神可以多考虑些思路)
AC代码:
#include
#include
char str[12][12];
int flag[12][12];
int r,c,s,sum,loop;
void ...
分类:
其他好文 时间:
2014-07-18 12:23:10
阅读次数:
223
#include using namespace std;const int MOD = 1000;//像这样的一个常量就应该专门定义一下int PowMod(int a, int n)//a^n%MOD { int ret = 1; while(n) { ...
分类:
其他好文 时间:
2014-07-18 12:15:38
阅读次数:
190
分治!首先是一大块,贪行刷和竖刷的最小,再转化为小块。。。。。。。。。。。。
AC代码如下:
#include
#include
#include
using namespace std;
int n;
int a[5005];
int solve(int l,int r)
{
int i,j;
int len=r-l+1;
...
分类:
其他好文 时间:
2014-07-18 11:22:29
阅读次数:
229
Evaluate the value of an arithmetic expression in Reverse Polish Notation.
Valid operators are +, -, *, /.
Each operand may be an integer or another expression.
Some examples:
["2", "1", ...
分类:
其他好文 时间:
2014-07-18 11:19:56
阅读次数:
210
题意就是将第一个字符串转化为第二个字符串,支持两个操作,一个是删除,一个是更换字符位置。
简单的字符串操作!!
AC代码如下:
#include
#include
#include
#include
#define M 50010
#define inf 100000000
using namespace std;
char a[1005],b[1005];
int la,lb;
bo...
分类:
其他好文 时间:
2014-07-18 11:03:48
阅读次数:
273
初学者题:1001 1037 1048 1049 1051 1067 1115 1151 1201 1205 1216 1240 1241 1242 1251 1292 1331 1334 1337 1338 1350 1365 1382 1383 1394 1402 1405 1414 1494 ...
分类:
其他好文 时间:
2014-07-18 10:22:36
阅读次数:
556
/*BFS,注意马脚!马脚WA了一次,后来WA了N次,最后发现输入时候将军和马的位置搞反,更改后AC*/1 #include 2 #include 3 #include 5 using namespace std; 6 const int maxn=10000,maxm=25; 7 int vis....
分类:
其他好文 时间:
2014-07-18 09:29:15
阅读次数:
302