第五题 import java.util.*; public class Main { static int MOD = 998244353; static int m; static int n; public static void main(String[] args) { Scanner sc = new Scanner(System.in); m = sc.nextInt(); n = sc.nextInt(); int[][] dp = new int[n + 1][m + 1]; for (int i = 1; i <= m; i++) { dp[1][i] = m / i; } for (int i = 2; i <= n; i++) { for (int j = 1; j <= m; j++) { for (int k = j; k <= m; k += j) { dp[i][j] = (dp[i][j] + dp[i - 1][k]) % MOD; } } } System.out.println(dp[n][1]); } }
1 6

相关推荐

牛客网
牛客企业服务