package 第十一届蓝桥杯; public class Main01 { public static void main(String[] args) {
int t = 10000; int time = 0; boolean b = true; boolean flag = true; while(flag)
{ for(int i=0;i<60;i++) { if(b) { t-=10; time++; }else { t+=5; time++; } if(t<=0
) { flag = false; break; } } if(b) { b = false; }else { b = true; } } System.out
.println(time); } }

package 第十一届蓝桥杯; import java.text.ParseException; import java.text.
SimpleDateFormat; import java.util.Date; public class Main02 { public static
void main(String[] args) throws ParseException { SimpleDateFormat s = new
SimpleDateFormat("yyyy-MM-dd HH-mm-ss"); Date d1 = s.parse("1921-7-23 12-00-00")
; Date d2 = s.parse("2020-7-1 12-00-00"); long t1 = d2.getTime()-d1.getTime();
System.out.println(t1/60000); } }

package 第十一届蓝桥杯; public class Main03 { public static void main(String[] args) {
//我们假设一共有100人 其中有一人被感染 int k = 0; int s = 1000; int t = 0; for(int i=1;i<=100;i
++) { //假设每组i个人 if(100%i==0) { t = i +100/i; }else { t = 100/i+1+i; } if(t<s) {
k= i; s = t; } } System.out.println(k); } }

package 第十一届蓝桥杯; import java.util.Scanner; public class Main06 { public static
void main(String[] args) { Scanner sc = new Scanner(System.in); long n = sc.
nextLong(); while(n>0) { System.out.print(n+" "); n/=2; } } }

package 第十一届蓝桥杯; import java.util.Scanner; public class Main07 { public static
void main(String[] args) { Scanner sc = new Scanner(System.in); char[] ch = sc.
next().toCharArray(); for(int i=0;i<ch.length;i++) { if(ch[i]>='a'&&ch[i]<='z'||
ch[i]>='A'&&ch[i]<='Z') { if(i+1<ch.length&&ch[i+1]>='0'&&ch[i+1]<='9') { int t
= ch[i+1]-'0'; for(int k=0;k<t;k++) { System.out.print(ch[i]); } if(i+1<ch.
length) { i++; } }else { System.out.print(ch[i]); } } } } }

package 第十一届蓝桥杯; import java.util.Scanner; public class Main08 { static int n,m
,ans; static int[][] book = new int[31][31]; static int[][] dp = new int[31][31]
; public static void main(String[] args) { Scanner sc = new Scanner(System.in);
n= sc.nextInt(); m = sc.nextInt(); dfs(1,1); System.out.println(ans); if(!(n%2==
0&&m%2==0)) { book[n][m]=1; } System.out.println(dfs01(1,1)); for(int i=1;i<=n;i
++) { dp[i][1]=1; } for(int i=1;i<=m;i++) { dp[1][i]=1; } for(int i=2;i<=n;i++)
{ for(int j=2;j<=m;j++) { if(!(i%2==0&&j%2==0)) { dp[i][j]=dp[i-1][j]+dp[i][j-1]
; } } } System.out.println(dp[n][m]); } public static int dfs01(int x,int y) {
//记忆化搜索可以ac if((x&1)==1||(y&1)==1) { if(book[x][y]>0) return book[x][y]; if(x<n)
book[x][y]+=dfs01(x+1,y); if(y<m) book[x][y]+=dfs01(x,y+1); } return book[x][y]
; } public static void dfs(int x,int y) { //爆搜超时 if(x==n&&y==m) { ans++; return
; } int tx,ty; tx=x; ty=y+1; if(tx>=1&&ty>=1&&tx<=n&&ty<=m&&!(tx%2==0&&ty%2==0))
{ dfs(tx,ty); } tx=x+1; ty=y; if(tx>=1&&ty>=1&&tx<=n&&ty<=m&&!(tx%2==0&&ty%2==0)
) { dfs(tx,ty); } } }

a[j]%k )%k=0 ， 考虑到这里 此题就结束了

package 第十一届蓝桥杯; import java.util.Scanner; public class Main09 { static int n,k
; static long ans; static long[] arr ; static int[][] book = new int[11][100005]
; public static void main(String[] args) { Scanner sc = new Scanner(System.in);
n= (int) sc.nextLong(); k = (int) sc.nextLong(); arr = new long[n]; for(int i=0;
i<n;i++) { arr[i] = sc.nextLong(); for(int j=1;j<=10;j++) { int t =(int) (arr[i]
* Math.pow(10, j)%k); book[j][t]++; } } for(int i=0;i<n;i++) { int len =(arr[i]+
"").length(); int t = (int) (arr[i]%k); int tt = (int) (arr[i]* Math.pow(10, len
)%k); if(t==0) { if(tt!=0) { ans+=book[len][0]; }else { ans+=book[len][0]-1; } }
else { if(tt+t!=k) { ans+=book[len][k-t]; }else { ans+=book[len][tt]-1; } } }
System.out.println(ans); } }

GitHub

Gitee