結果

問題 No.341 沈黙の期間
ユーザー jjjj
提出日時 2016-07-28 23:08:55
言語 Fortran
(gFortran 13.2.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 580 bytes
コンパイル時間 152 ms
コンパイル使用メモリ 26,268 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-06 15:10:43
合計ジャッジ時間 865 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,384 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 1 ms
4,380 KB
testcase_12 AC 1 ms
4,376 KB
testcase_13 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

program main
  character(len=600)::str
  integer::prev=-1,len=0,maxlen=0
  read *,str

  do i=1,LEN_TRIM(str)
     if ( ICHAR(str(i  :i  )).eq.226 .and. &
          ICHAR(str(i+1:i+1)).eq.128 .and. &
          ICHAR(str(i+2:i+2)).eq.166 ) then

        if( (i-prev.eq.3) .or. (prev.eq.-1)) then
           prev   = i
           len    = len + 1
           maxlen = MAX(len, maxlen)
        else
           prev   = -1
           len    = 0
        end if
     else if(i-prev.eq.3) then
        prev = -1
        len = 0
     end if
  end do
  print '(i0)', maxlen
end program main
0