Submission #1606787
Source Code Expand
import java.io.*; import java.util.*; public class Main { // "Main" should be used for most online judges public static void main(String[] args) { Scanner sc = new Scanner(System.in); int dist = sc.nextInt(); int i = 1; int loc = 0; int seconds = 0; while(loc!= dist) { if( (loc + i) + (i+1) <= dist || loc + i == dist ) { loc += i; i++; seconds++; } else { i++; seconds++; } } System.out.println(seconds); } }
Submission Info
Submission Time | |
---|---|
Task | C - Go Home |
User | vjudge5 |
Language | Java7 (OpenJDK 1.7.0) |
Score | 0 |
Code Size | 464 Byte |
Status | WA |
Exec Time | 117 ms |
Memory | 23124 KB |
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 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 | 102 ms | 20564 KB |
0_001.txt | AC | 94 ms | 17108 KB |
0_002.txt | AC | 94 ms | 19028 KB |
1_003.txt | WA | 108 ms | 19028 KB |
1_004.txt | WA | 109 ms | 23124 KB |
1_005.txt | AC | 99 ms | 19028 KB |
1_006.txt | AC | 114 ms | 19156 KB |
1_007.txt | WA | 108 ms | 20820 KB |
1_008.txt | AC | 107 ms | 19028 KB |
1_009.txt | WA | 117 ms | 19028 KB |
1_010.txt | AC | 108 ms | 19156 KB |
1_011.txt | WA | 98 ms | 19156 KB |
1_012.txt | AC | 98 ms | 21076 KB |
1_013.txt | WA | 107 ms | 21076 KB |
1_014.txt | AC | 99 ms | 21076 KB |
1_015.txt | WA | 108 ms | 19028 KB |
1_016.txt | AC | 108 ms | 20820 KB |
1_017.txt | WA | 100 ms | 21204 KB |