GCD nyoj 1007 (欧拉函数+欧几里得) GCD 时间限制:1000 ms | 内存限制:65535 KB 难度:3 描述 The greatest common divisor GCD(a,b) of two positive integers a and b,sometimes written (a,b),is the largest divisor common to a and b,For example,(1,2)=1,(12,18)=6.(a,b) can be…
这个题目是个水题目,现在我只管做出来,效率不考虑了. 题目链接: http://acm.nyist.net/JudgeOnline/problem.php?pid=904 我用hashmap 很爽,很简单,但效率很低,别人有的是用二分查找,不管了, package nyoj904; import java.util.HashMap; import java.util.Scanner; public class Main { public static void main(String[] arg…
Design a data structure that supports the following two operations: void addWord(word) bool search(word) search(word) can search a literal word or a regular expression string containing only letters a-z or .. A . means it can represent any one letter…