結果

問題 No.341 沈黙の期間
ユーザー jjjj
提出日時 2016-07-28 23:38:49
言語 Fortran
(gFortran 13.2.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 549 bytes
コンパイル時間 120 ms
コンパイル使用メモリ 31,232 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-24 10:38:53
合計ジャッジ時間 628 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

program main
  character(len=600)::str
  character(3),parameter::silence=CHAR(226)//CHAR(128)//CHAR(166)
  integer,parameter::undef=-2
  integer::prev=undef,len=0,maxlen=0,diff
  read *,str
  do i=1,LEN_TRIM(str)
     if ((i-prev).eq.2) cycle
     if ( str(i:i+2) .eq. silence ) then
        diff = i-prev
        prev   = i
        if( diff.eq.3 ) then
           len    = len + 1
           maxlen = MAX(len, maxlen)
        else if(diff.gt.3) then
           len    = 1
        end if
     end if
  end do
  print '(i0)', maxlen
end program main
0