Submission #1127084
Source Code Expand
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(),k = scanner.nextInt(); int[] a = new int[n]; for(int i=0;i<n;i++){ a[i] = scanner.nextInt(); } long total = 0; for(int i=0;i<n-k+1;i++){ for(int j=i;j<i+k;j++){ total += a[j]; } } System.out.println(total); } }
Submission Info
Submission Time | |
---|---|
Task | C - 総和 |
User | m8618 |
Language | Java7 (OpenJDK 1.7.0) |
Score | 100 |
Code Size | 423 Byte |
Status | AC |
Exec Time | 1227 ms |
Memory | 50192 KB |
Judge Result
Set Name | sample | subtask1 | subtask2 | ||||||
---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 50 / 50 | 50 / 50 | ||||||
Status |
|
|
|
Set Name | Test Cases |
---|---|
sample | sample01.txt, sample02.txt |
subtask1 | 00.txt, 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, sample01.txt, sample02.txt |
subtask2 | 00.txt, 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 16.txt, 17.txt, 18.txt, 19.txt, sample01.txt, sample02.txt, sample01.txt, sample02.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
00.txt | AC | 94 ms | 17104 KB |
01.txt | AC | 100 ms | 18772 KB |
02.txt | AC | 115 ms | 21204 KB |
03.txt | AC | 170 ms | 24660 KB |
04.txt | AC | 161 ms | 20180 KB |
05.txt | AC | 152 ms | 23892 KB |
06.txt | AC | 165 ms | 22100 KB |
07.txt | AC | 172 ms | 22844 KB |
08.txt | AC | 166 ms | 22660 KB |
09.txt | AC | 163 ms | 20180 KB |
10.txt | AC | 172 ms | 20512 KB |
11.txt | AC | 407 ms | 48020 KB |
12.txt | AC | 416 ms | 48068 KB |
13.txt | AC | 1227 ms | 47896 KB |
14.txt | AC | 954 ms | 47836 KB |
15.txt | AC | 410 ms | 49884 KB |
16.txt | AC | 411 ms | 47868 KB |
17.txt | AC | 1223 ms | 49836 KB |
18.txt | AC | 753 ms | 50192 KB |
19.txt | AC | 1188 ms | 49768 KB |
sample01.txt | AC | 94 ms | 18900 KB |
sample02.txt | AC | 94 ms | 18772 KB |