結果
問題 |
No.1031 いたずら好きなお姉ちゃん
|
ユーザー |
|
提出日時 | 2020-05-04 20:18:49 |
言語 | Fortran (gFortran 14.2.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 696 bytes |
コンパイル時間 | 1,487 ms |
コンパイル使用メモリ | 32,380 KB |
実行使用メモリ | 7,424 KB |
最終ジャッジ日時 | 2024-06-24 22:19:04 |
合計ジャッジ時間 | 7,513 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | TLE * 1 -- * 52 |
ソースコード
module yukicoder1031 implicit none integer :: n integer, allocatable :: p(:) contains subroutine read_input read *, n allocate(p(n)) read *, p end subroutine read_input end module yukicoder1031 program main use yukicoder1031 implicit none integer :: r = 0 integer :: i, j integer :: max_index, min_index call read_input do i = 1, n do j = i+1, n max_index = maxloc(p(i:j), 1) min_index = minloc(p(i:j), 1) r = r + merge(1, 0, abs(max_index - min_index) == j - i) end do end do print '(I0)', r end program main