一个未排序整数数组,有正负数,重新排列使负数排在正数前面,并且要求不改变原来的 相对顺序 比如: input:
1,7,-5,9,-12,15 ans: -5,-12,1,7,9,15 要求时间复杂度O(N),空间O(1) 。
一个未排序整数数组,有正负数,重新排列使负数排在正数前面
分类:
其他好文 时间:
2014-06-07 00:17:16
阅读次数:
350
Description这里有一个n*m的矩阵,请你选出其中k个子矩阵,使得这个k个子矩阵分值之和最大。注意:选出的k个子矩阵不能相互重叠。Input第一行为n,m,k(1≤n≤100,1≤m≤2,1≤k≤10),接下来n行描述矩阵每行中的每个元素的分值(每个元素的分值的绝对值不超过32767)。Ou...
分类:
其他好文 时间:
2014-06-04 16:57:55
阅读次数:
178
Help Me with the GameDescriptionYour task is to
read a picture of a chessboard position and print it in the chess
notation.InputThe input consists of ...
分类:
其他好文 时间:
2014-06-04 16:41:58
阅读次数:
226
Implementatoito convert a string to an
integer.Hint:Carefully consider all possible input cases. If you want a
challenge, please do not see below and ...
分类:
其他好文 时间:
2014-06-02 08:51:43
阅读次数:
233
Reverse Words in a String
Total Accepted: 15012 Total
Submissions: 108513My Submissions
Given an input string, reverse the string word by word.
For example,
Given s = "the sky is blue",...
分类:
其他好文 时间:
2014-06-02 05:34:14
阅读次数:
214
第一种:#!/bin/bash service vsftpd start &>
/dev/null if[ $? -eq 0 ]thenecho "ftp is start"elseservice vsftpd
startfi第二种:#!/bin/bash read -p "input your f...
分类:
其他好文 时间:
2014-06-02 00:41:38
阅读次数:
332
importjava.util.Scanner;
publicclassA02{
/**
*@paramargs
*/
publicstaticvoidmain(String[]args){
//TODOAuto-generatedmethodstub
Scannerinput=newScanner(System.in);
System.out.println("请输入月份:1~12");
intchoice=input.nextInt();
System.out.p..
分类:
编程语言 时间:
2014-06-01 16:40:54
阅读次数:
507
importjava.util.Scanner;
publicclassA05{
/**
*@paramargs
*/
publicstaticvoidmain(String[]args){
//TODOAuto-generatedmethodstub
Scannerinput=newScanner(System.in);
System.out.println("请输入消费金额:");
intmoney=input.nextInt();
if(money>=..
分类:
编程语言 时间:
2014-06-01 16:34:23
阅读次数:
649
importjava.util.Scanner;
publicclassA03{
/**
*@paramargs
*/
publicstaticvoidmain(String[]args){
//TODOAuto-generatedmethodstub
Scannerinput=newScanner(System.in);
System.out.println("请输入会员积分:");
intIntegral=input.nextInt();
Stringshow..
分类:
编程语言 时间:
2014-06-01 16:33:46
阅读次数:
1777
importjava.util.Scanner;
publicclassA02{
/**
*@paramargs
*/
publicstaticvoidmain(String[]args){
//TODOAuto-generatedmethodstub
Scannerinput=newScanner(System.in);
System.out.println("请输入是否是会员(y/n):");
Stringchoice=input.next();
Syst..
分类:
编程语言 时间:
2014-06-01 16:32:26
阅读次数:
303