Submission #1610922


Source Code Expand

import java.util.Scanner;
import java.util.TreeSet;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    TreeSet<Integer> set = new TreeSet<Integer>();
    int n = sc.nextInt();
    for(int a=0;a<n;a++){
      set.add(sc.nextInt());
    }
    System.out.println(set.last()-set.first());
  }
}

Submission Info

Submission Time
Task B - Traveling AtCoDeer Problem
User BLOND
Language Java8 (OpenJDK 1.8.0)
Score 200
Code Size 359 Byte
Status AC
Exec Time 101 ms
Memory 21076 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 2
AC × 6
Set Name Test Cases
Sample s1.txt, s2.txt
All in1.txt, in2.txt, in3.txt, in4.txt, s1.txt, s2.txt
Case Name Status Exec Time Memory
in1.txt AC 98 ms 21076 KB
in2.txt AC 95 ms 19284 KB
in3.txt AC 94 ms 20052 KB
in4.txt AC 101 ms 20948 KB
s1.txt AC 93 ms 18900 KB
s2.txt AC 93 ms 19924 KB