! 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) THEN mx = a(i) ELSE IF (a(i) > ans .and. a(i) < mx) ans = a(i) END IF END DO PRINT '(I0)', ans STOP END PROGRAM yukicoder