Submission #757501

# Submission time Handle Problem Language Result Execution time Memory
757501 2023-06-13T09:10:52 Z vjudge1 Lightning Conductor (POI11_pio) Java 11
27 / 100
1000 ms 38660 KB
import java.util.*;

public class pio {
    public static void main(String args[]) {
        Scanner s = new Scanner(System.in);
        
        int n = s.nextInt();
        ArrayList<Integer> arr = new ArrayList<Integer>();
        for (int i=0; i<n; i++){
            arr.add(s.nextInt());
        }
        for (int i=0; i<n; i++){
            System.out.println(operate(n, i, arr));
        }
        
    }
    
    public static int operate(int n, int ind, ArrayList<Integer> arr){
        int min = 0;
        int hi = arr.get(ind);
        for (int i=0; i<n; i++){
            if (n == ind){ continue; }
            int a = (int) Math.ceil(Math.sqrt(Math.abs(ind-i))) + arr.get(i) - hi;
            if (a>min){
                min = a;
            }
        }
        return min;
    }
}
# Verdict Execution time Memory Grader output
1 Correct 158 ms 11364 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 160 ms 10980 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 244 ms 12828 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 1072 ms 19144 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1070 ms 19812 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1063 ms 20104 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1059 ms 21304 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1068 ms 26220 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1060 ms 30836 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1057 ms 37628 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1036 ms 38660 KB Time limit exceeded
2 Halted 0 ms 0 KB -