Submission #10103281


Source Code Expand

Copy
import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int w = sc.nextInt(),a = sc.nextInt(),b = sc.nextInt();
    int dis;
    if(a < b){
      dis = b-a;
    }else{
      dis = a-b;
    }
    if(dis <= w){
      System.out.println(0);
    }else{
      System.out.println(dis - w);
    }
  }
}

Submission Info

Submission Time
Task B - NarrowRectanglesEasy
User yasu_salmon
Language Java8 (OpenJDK 1.8.0)
Score 200
Code Size 384 Byte
Status
Exec Time 114 ms
Memory 21844 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 0_000.txt, 0_001.txt, 0_002.txt, 0_003.txt
All 200 / 200 0_000.txt, 0_001.txt, 0_002.txt, 0_003.txt, 1_004.txt, 1_005.txt, 1_006.txt, 1_007.txt, 1_008.txt, 1_009.txt
Case Name Status Exec Time Memory
0_000.txt 114 ms 21204 KB
0_001.txt 91 ms 19156 KB
0_002.txt 92 ms 21844 KB
0_003.txt 93 ms 21204 KB
1_004.txt 92 ms 19796 KB
1_005.txt 93 ms 20948 KB
1_006.txt 91 ms 21460 KB
1_007.txt 92 ms 20560 KB
1_008.txt 92 ms 21844 KB
1_009.txt 93 ms 19028 KB