一、Problem
21
二、Solution
方法一:暴力
…
import java.util.*;
import java.math.*;
import java.io.*;
public class Main{
static class Solution {
void init() {
Scanner sc = new Scanner(new BufferedInputStream(System.in));
int res = 0;
for (int x = 1; x <= 21000; x++)
for (int y = 1; y <= 21000; y++) {
if (2*x + 100*y == 50000 && x + y >= 20000 && x + y <= 21000)
res++;
}
System.out.println(res);
}
}
public static void main(String[] args) throws IOException {
Solution s = new Solution();
s.init();
}
}
复杂度分析
- 时间复杂度: ,
- 空间复杂度: ,