Submission #1186770
Source Code Expand
import java.util.Scanner; public class Main { public static void main(String[] args) { System.out.println("整数Kの値(2 <= K <= 2500)"); Scanner scan = new Scanner(System.in); int k = scan.nextInt(); System.out.println("整数Sの値(0 <= S <= 3K)"); int s = scan.nextInt(); int xay[] = new int[k+1]; int yay[] = new int[k+1]; int zay[] = new int[k+1]; for(int i = 0; i <= k; i++) { xay[i] += i; } for(int i = 0; i <= k; i++) { yay[i] += i; } for(int i = 0; i <= k; i++) { zay[i] += i; } int count = 0; for(int i = 0; i <= k; i++) { for(int j = 0; j <= k; j++) { for(int h = 0; h <= k; h++) { if((xay[i] + yay[j] + zay[h]) == s) { count++; } } } } System.out.println(count); } }
Submission Info
Submission Time | |
---|---|
Task | B - Sum of Three Integers |
User | ne280119 |
Language | Java8 (OpenJDK 1.8.0) |
Score | 0 |
Code Size | 798 Byte |
Status | WA |
Exec Time | 2109 ms |
Memory | 22824 KB |
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 200 | ||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample_01.txt, sample_02.txt |
All | sample_01.txt, sample_02.txt, subtask_1_01.txt, subtask_1_02.txt, subtask_1_03.txt, subtask_1_04.txt, subtask_1_05.txt, subtask_1_06.txt, subtask_1_07.txt, subtask_1_08.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
sample_01.txt | WA | 91 ms | 19412 KB |
sample_02.txt | WA | 92 ms | 18644 KB |
subtask_1_01.txt | TLE | 2104 ms | 21716 KB |
subtask_1_02.txt | WA | 1253 ms | 20052 KB |
subtask_1_03.txt | TLE | 2108 ms | 20052 KB |
subtask_1_04.txt | WA | 1794 ms | 21120 KB |
subtask_1_05.txt | WA | 121 ms | 22824 KB |
subtask_1_06.txt | WA | 594 ms | 20996 KB |
subtask_1_07.txt | TLE | 2109 ms | 20816 KB |
subtask_1_08.txt | WA | 301 ms | 21972 KB |