! yukicoder My Practice ! author: Leonardone @ NEETSDKASU PROGRAM yukicoder INTEGER :: n, a(100000), ans, mx READ(*,*) n READ(*,*) a(1:n) mx = a(1) ans = 0 DO i = 2, n IF (a(i) > mx) mx = a(i) IF (a(i) > ans .and. a(i) < mx) ans = a(i) END DO PRINT '(I0)', ans STOP END PROGRAM yukicoder