class Solution {public void moveZeroes(int[] nums) {int l 0;//慢指针但先走for (int r 0; r < nums.length; r) {//快指针,遍历次数if (nums[r] 0) continue;//l比r先到,在此处定住l,r继续移动int t nums[l];nums[l] nums[r];num…
A.Hcode OnlineJudge 先用欧拉筛把质数预处理出来,然后枚举左端点的质数,只需要询问右端点是不是质数并取差值的min就行了
#include<bits/stdc.h>
#define endl \n
#define mk make_pair
#define int long long
using namespace std;
typedef lon…