- 博客(8)
- 收藏
- 关注
原创 1015 Reversible Primes (20分)
Areversible primein any number system is a prime whose "reverse" in that number system is also a prime. For example in the decimal system 73 is a reversible prime because its reverse 37 is also a prime.Now given any two positive integersN(<105)...
2020-12-04 10:21:06
114
原创 1010 Radix (25分)
Given a pair of positive integers, for example, 6 and 110, can this equation 6 = 110 be true? The answer isyes, if 6 is a decimal number and 110 is a binary number.Now for any pair of positive integersN1andN2, your task is to find the radix of ...
2020-12-01 11:55:25
100
原创 十进制,十六进制转二进制
import java.util.Scanner;public class ListTest { public static void main(String[] args) { Scanner in = new Scanner(System.in); String num1 = in.next(); changeTo2Binary(16, num1)) } private static int[] radixs = new.
2020-11-25 20:24:57
146
原创 PAT优化输入超时
1007Maximum Subsequence Sum(25分)Scanner输入效率太低,改用BufferedReader,再将字符串转化为intBufferedReader sc = new BufferedReader(new InputStreamReader(System.in));import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;publi..
2020-11-23 10:29:08
160
原创 dijkstra算法的应用
使用dijkstra算法计算最短路径数和最短路径长度例1:1003Emergency:Input Specification:Each input file contains one test case. For each test case, the first line contains 4 positive integers:N(≤500) - the number of cities (and the cities are numbered from 0 toN−1),M- ...
2020-10-08 20:39:52
496
原创 tip:java设置小数转字符串的小数位数
java设置小数转字符串的小数位数 DecimalFormat df = new DecimalFormat("#.0"); Double value = entry.getValue(); String v = df.format(value);
2020-10-08 15:55:39
129
原创 使用Puppeteer导出PDF文件
https://github.com/puppeteer/puppeteer项目以前是使用phantomjs运行JS,生成PDF文件。后来因为phantomjs不维护了,改使用Puppeteer。Puppeteer是node module,需要在nodeJS环境下运行。所需文件:node.exe、JS文件(test.js)test.js:const puppeteer = require('puppeteer');(async () => { const browser
2020-05-22 18:43:15
1044
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人