Submission #992173
Source Code Expand
import static java.lang.System.in; import static java.lang.System.out; import java.io.*; import java.util.*; public class Main { static final double EPS = 1e-10; static final double INF = 1L << 31; static final double PI = Math.PI; public static Scanner sc = new Scanner(in); StringBuilder sb = new StringBuilder(); BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); public void run() throws IOException { String input; String[] inputArray; input = br.readLine(); inputArray = input.split(" "); int n = Integer.valueOf(inputArray[0]); // for (int z=1; z<20; z++){ // sb.append(z+":\n"); // int n=z; while(n>0){ int i = (int)((Math.sqrt(8*n+1)-1)/2+0.99999); sb.append(i+"\n"); n-=i; } // sb.append("\n"); // } ln(sb); } public static void main(String[] args) throws IOException { new Main().run(); } public static void ln(Object obj) { out.print(obj); } }
Submission Info
Submission Time | |
---|---|
Task | B - Exactly N points |
User | batchunag |
Language | Java7 (OpenJDK 1.7.0) |
Score | 300 |
Code Size | 977 Byte |
Status | AC |
Exec Time | 151 ms |
Memory | 10836 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 |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01-01.txt | AC | 122 ms | 9044 KB |
01-02.txt | AC | 117 ms | 8916 KB |
01-03.txt | AC | 117 ms | 8916 KB |
01-04.txt | AC | 116 ms | 9044 KB |
01-05.txt | AC | 118 ms | 8916 KB |
01-06.txt | AC | 117 ms | 8916 KB |
01-07.txt | AC | 117 ms | 8916 KB |
01-08.txt | AC | 117 ms | 8916 KB |
01-09.txt | AC | 124 ms | 8916 KB |
01-10.txt | AC | 117 ms | 8916 KB |
02-01.txt | AC | 147 ms | 10580 KB |
02-02.txt | AC | 148 ms | 10452 KB |
02-03.txt | AC | 151 ms | 10836 KB |
02-04.txt | AC | 147 ms | 10708 KB |
02-05.txt | AC | 150 ms | 10636 KB |
02-06.txt | AC | 124 ms | 9300 KB |
02-07.txt | AC | 123 ms | 9168 KB |
02-08.txt | AC | 148 ms | 10452 KB |
sample-01.txt | AC | 116 ms | 8916 KB |
sample-02.txt | AC | 117 ms | 8916 KB |
sample-03.txt | AC | 117 ms | 8916 KB |