Submission #1551360
Source Code Expand
import java.util.ArrayList; import java.util.Scanner; import java.util.stream.IntStream; public class Main{ static IntStream REPS(int v){return IntStream.range(0,v);} static IntStream REPS(int l,int r){return IntStream.rangeClosed(l,r);} static IntStream INS(int n) {return REPS(n).map(i->getInt());} static Scanner s=new Scanner(System.in); static int getInt(){return Integer.parseInt(s.next());} public static void main(String[]$){ int n=getInt(); ArrayList<Integer>l=new ArrayList<>(); int i=1; for(;true;++i) { l.add(i); if(i*(i+1)/2>n) break; } l.remove(Integer.valueOf(i*(i+1)/2-n)); l.forEach(System.out::println); } }
Submission Info
Submission Time | |
---|---|
Task | B - Exactly N points |
User | fal_rnd |
Language | Java8 (OpenJDK 1.8.0) |
Score | 300 |
Code Size | 681 Byte |
Status | AC |
Exec Time | 232 ms |
Memory | 27984 KB |
Judge Result
Set Name | sample | dataset1 | dataset2 | ||||||
---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 200 / 200 | 100 / 100 | ||||||
Status |
|
|
|
Set Name | Test Cases |
---|---|
sample | sample-01.txt, sample-02.txt, sample-03.txt |
dataset1 | sample-01.txt, sample-02.txt, sample-03.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt, 01-10.txt |
dataset2 | sample-01.txt, sample-02.txt, sample-03.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt, 01-10.txt, 02-01.txt, 02-02.txt, 02-03.txt, 02-04.txt, 02-05.txt, 02-06.txt, 02-07.txt, 02-08.txt, sample-01.txt, sample-02.txt, sample-03.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01-01.txt | AC | 168 ms | 26196 KB |
01-02.txt | AC | 168 ms | 26836 KB |
01-03.txt | AC | 164 ms | 26324 KB |
01-04.txt | AC | 173 ms | 26572 KB |
01-05.txt | AC | 171 ms | 26064 KB |
01-06.txt | AC | 167 ms | 26964 KB |
01-07.txt | AC | 162 ms | 26580 KB |
01-08.txt | AC | 163 ms | 26068 KB |
01-09.txt | AC | 164 ms | 23888 KB |
01-10.txt | AC | 168 ms | 23124 KB |
02-01.txt | AC | 230 ms | 24144 KB |
02-02.txt | AC | 219 ms | 24532 KB |
02-03.txt | AC | 232 ms | 26448 KB |
02-04.txt | AC | 229 ms | 26580 KB |
02-05.txt | AC | 224 ms | 26324 KB |
02-06.txt | AC | 203 ms | 24788 KB |
02-07.txt | AC | 196 ms | 26324 KB |
02-08.txt | AC | 215 ms | 24532 KB |
sample-01.txt | AC | 161 ms | 27984 KB |
sample-02.txt | AC | 164 ms | 26192 KB |
sample-03.txt | AC | 170 ms | 25812 KB |