摘要:
题目 String类型 解答 class Solution { public boolean checkTwoChessboards(String s, String t) { int a = (s.charAt(0) + s.charAt(1)) % 2; int b = (t.charAt(0) 阅读全文
摘要:
N皇后 dfs模板 点击查看代码 class Solution { private int ans; public int totalNQueens(int n) { boolean[] col = new boolean[n]; boolean[] diag1 = new boolean[n*2 阅读全文
摘要:
循环数组问题,指针问题 代码 比较好实现的,只需要对右端点维护,如果达到了>=k便可以被计数,循环数组可以两边循环做到 点击查看代码 class Solution { public int numberOfAlternatingGroups(int[] colors, int k) { int n 阅读全文
摘要:
网络延迟时间 迪杰斯特拉的朴素算法流程: 邻接矩阵的方法 点击查看代码 class Solution { public int networkDelayTime(int[][] times, int n, int k) { //初始化一些必要参数 int INF = Integer.MAX_VALU 阅读全文
摘要:
题目 p = 177077389675257695042507998165006460849 n = 37421829509887796274897162249367329400988647145613325367337968063341372726061 c = ==gMzYDNzIjMxUTNy 阅读全文
摘要:
题目 点击查看代码 from random import choice from Crypto.Util.number import isPrime, sieve_base as primes from flag import flag def getPrime(bits): while True: 阅读全文