题目链接:http://poj.org/problem?id=3751 题目大意:按照要求的格式将输入的时间日期进行转化. #include <iostream> #include <cstdio> using namespace std; int main () { int t; cin>>t; while (t--) { int y,m,d,xs,fz,ms; char ch1,ch2,ch3,ch4,ch5; //scanf("%d/%d/%d-%d:%…
POJ 3468 (Java,c++实现) Java import java.io.*; import java.util.*; public class Main { static int n, m; static final int N = 100005; static int ls[] = new int[N << 2]; static int rs[] = new int[N << 2]; static long M[] = new long[N << 2];…
这里指的java速成,只限于java语法,包括输入输出,运算处理,字符串和高精度的处理,进制之间的转换等,能解决OJ上的一些高精度题目. 1. 输入: 格式为:Scanner cin = new Scanner (new BufferedInputStream(System.in)); 例程: import java.io.*; import java.math.*; import java.util.*; import java.text.*; public class Main { publ…
Bridge over a rough river Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 4143 Accepted: 1703 Description A group of N travelers (1 ≤ N ≤ 50) has approached an old and shabby bridge and wishes to cross the river as soon as possible. Ho…
Implement wildcard pattern matching with support for '?' and '*'. '?' Matches any single character. '*' Matches any sequence of characters (including the empty sequence). The matching should cover the entire input string (not partial). The function p…
Question: Given a sorted array of n integers that has been rotated an unknown number of times, write code to find an element in the array. You may assume that the array was originally sorted in increasing order. package POJ; import java.util.Arrays;…
Question: Write a method to sort an array of strings so that all the anagrams are next to each other. package POJ; import java.util.Arrays; import java.util.Comparator; import java.util.Hashtable; import java.util.LinkedList; import java.util.List; p…