Submission #25023420
Source Code Expand
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;
/**
* Built using CHelper plug-in
* Actual solution is at the top
*/
public class Main {
public static void main(String[] args) {
InputStream inputStream = System.in;
OutputStream outputStream = System.out;
MyScanner in = new MyScanner(inputStream);
PrintWriter out = new PrintWriter(outputStream);
B solver = new B();
solver.solve(1, in, out);
out.close();
}
static class B {
public void solve(int testNumber, MyScanner in, PrintWriter out) {
int S = in.Int();
int T = in.Int();
int cnt = 0;
for (int a = 0; a <= S; a++) {
for (int b = 0; b <= S; b++) {
for (int c = 0; c <= S; c++) {
if (a + b + c <= S && a * b * c <= T) cnt++;
}
}
}
out.println(cnt);
}
}
static class MyScanner {
private BufferedReader in;
private StringTokenizer st;
public MyScanner(InputStream stream) {
in = new BufferedReader(new InputStreamReader(stream));
}
public String next() {
while (st == null || !st.hasMoreTokens()) {
try {
String rl = in.readLine();
if (rl == null) {
return null;
}
st = new StringTokenizer(rl);
} catch (IOException e) {
return null;
}
}
return st.nextToken();
}
public int Int() {
return Integer.parseInt(next());
}
}
}
Submission Info
| Submission Time | |
|---|---|
| Task | B - How many? |
| User | daira4000 |
| Language | Java (OpenJDK 11.0.6) |
| Score | 200 |
| Code Size | 2041 Byte |
| Status | AC |
| Exec Time | 94 ms |
| Memory | 32844 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 200 / 200 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | sample_00.txt, sample_01.txt, sample_02.txt, sample_03.txt |
| All | case_00.txt, case_01.txt, case_02.txt, case_03.txt, case_04.txt, case_05.txt, case_06.txt, case_07.txt, case_08.txt, case_09.txt, case_10.txt, case_11.txt, case_12.txt, case_13.txt, sample_00.txt, sample_01.txt, sample_02.txt, sample_03.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| case_00.txt | AC | 94 ms | 32728 KiB |
| case_01.txt | AC | 75 ms | 32540 KiB |
| case_02.txt | AC | 78 ms | 32584 KiB |
| case_03.txt | AC | 86 ms | 32800 KiB |
| case_04.txt | AC | 76 ms | 32596 KiB |
| case_05.txt | AC | 83 ms | 32788 KiB |
| case_06.txt | AC | 77 ms | 32628 KiB |
| case_07.txt | AC | 76 ms | 32520 KiB |
| case_08.txt | AC | 82 ms | 32776 KiB |
| case_09.txt | AC | 73 ms | 32608 KiB |
| case_10.txt | AC | 78 ms | 32692 KiB |
| case_11.txt | AC | 83 ms | 32584 KiB |
| case_12.txt | AC | 73 ms | 32404 KiB |
| case_13.txt | AC | 84 ms | 32844 KiB |
| sample_00.txt | AC | 77 ms | 32836 KiB |
| sample_01.txt | AC | 75 ms | 32576 KiB |
| sample_02.txt | AC | 75 ms | 32544 KiB |
| sample_03.txt | AC | 78 ms | 32552 KiB |