Submission #1516028
Source Code Expand
import java.util.*; import java.util.stream.*; class Main{ public static void main(String[]$){ Scanner s=new Scanner(System.in); int n=s.nextInt(),k=s.nextInt(); System.out.println(IntStream.range(0,n).map(i->s.nextInt()).sorted().skip(n-k).sum()); } }
Submission Info
Submission Time | |
---|---|
Task | B - Snake Toy |
User | fal_rnd |
Language | Java8 (OpenJDK 1.8.0) |
Score | 200 |
Code Size | 292 Byte |
Status | AC |
Exec Time | 264 ms |
Memory | 28372 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 200 / 200 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | 00_example_01.txt, 00_example_02.txt |
All | 00_example_01.txt, 00_example_02.txt, 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
00_example_01.txt | AC | 264 ms | 27860 KB |
00_example_02.txt | AC | 170 ms | 24148 KB |
01.txt | AC | 174 ms | 26576 KB |
02.txt | AC | 174 ms | 24916 KB |
03.txt | AC | 171 ms | 26452 KB |
04.txt | AC | 173 ms | 26320 KB |
05.txt | AC | 171 ms | 25044 KB |
06.txt | AC | 173 ms | 28372 KB |
07.txt | AC | 171 ms | 24532 KB |
08.txt | AC | 170 ms | 26452 KB |