Submission #1167305
Source Code Expand
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws IOException { proconScan proScan = new proconScan(" "); proScan.scan(); Long xInteger = proScan.nextLong(); Long buf = new Long(0); Long ans = new Long(1); while (true) { buf+=ans; if (xInteger <= buf) { break; } ans++; } System.out.println(ans); proScan.proconEnd(); } } class proconScan { private BufferedReader br; private String inLine; private String[] inString; private Integer idx; private String splitChar; public proconScan() { br = new BufferedReader(new InputStreamReader(System.in)); idx = 0; splitChar = " "; } public proconScan(String split) { br = new BufferedReader(new InputStreamReader(System.in)); idx = 0; splitChar = split; } public void proconEnd() throws IOException { // TODO 自動生成されたメソッド・スタブ br.close(); } public String scan() throws IOException { idx = 0; inLine = br.readLine(); inString = inLine.split(splitChar, 0); return inLine; } public Integer scanInteger1() throws IOException { scan(); return Integer.parseInt(inString[0]); } public String backLine() { return inLine; } public String nextString() { return inString[idx++]; } public String[] getString() { return inString; } public Long nextLong() { Long num; try { num = Long.parseLong(inString[idx++]); } catch (NumberFormatException e) { num = null;// TODO: handle exception } return num; } public Integer nextInteger() { Integer num; try { num = Integer.parseInt(inString[idx++]); } catch (NumberFormatException e) { num = null;// TODO: handle exception } return num; } public Integer[] getInteger() { Integer[] num = new Integer[this.getLen()]; for (int i = 0; i < this.getLen(); i++) { num[i] = Integer.parseInt(inString[i]); } return num; } public Float nextFloat() { Float num; try { num = Float.parseFloat(inString[idx++]); } catch (NumberFormatException e) { num = null;// TODO: handle exception } return num; } public Float[] getFloat() { Float[] num = new Float[this.getLen()]; for (int i = 0; i < this.getLen(); i++) { num[i] = Float.parseFloat(inString[i]); } return num; } public Integer getLen() { return inString.length; } public int[] getInt() { int[] num = new int[this.getLen()]; for (int i = 0; i < this.getLen(); i++) { num[i] = Integer.parseInt(inString[i]); } return num; } }
Submission Info
Submission Time | |
---|---|
Task | C - Go Home |
User | unirita34 |
Language | Java8 (OpenJDK 1.8.0) |
Score | 200 |
Code Size | 2720 Byte |
Status | AC |
Exec Time | 83 ms |
Memory | 23252 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 200 / 200 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | 0_000.txt, 0_001.txt, 0_002.txt |
All | 0_000.txt, 0_001.txt, 0_002.txt, 1_003.txt, 1_004.txt, 1_005.txt, 1_006.txt, 1_007.txt, 1_008.txt, 1_009.txt, 1_010.txt, 1_011.txt, 1_012.txt, 1_013.txt, 1_014.txt, 1_015.txt, 1_016.txt, 1_017.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
0_000.txt | AC | 69 ms | 19028 KB |
0_001.txt | AC | 70 ms | 21076 KB |
0_002.txt | AC | 72 ms | 21332 KB |
1_003.txt | AC | 81 ms | 22228 KB |
1_004.txt | AC | 81 ms | 21204 KB |
1_005.txt | AC | 69 ms | 19668 KB |
1_006.txt | AC | 81 ms | 20052 KB |
1_007.txt | AC | 83 ms | 22868 KB |
1_008.txt | AC | 81 ms | 21332 KB |
1_009.txt | AC | 79 ms | 19668 KB |
1_010.txt | AC | 83 ms | 21204 KB |
1_011.txt | AC | 81 ms | 19796 KB |
1_012.txt | AC | 81 ms | 21332 KB |
1_013.txt | AC | 80 ms | 19924 KB |
1_014.txt | AC | 82 ms | 23252 KB |
1_015.txt | AC | 81 ms | 21332 KB |
1_016.txt | AC | 82 ms | 21588 KB |
1_017.txt | AC | 81 ms | 21972 KB |