結果
問題 | No.345 最小チワワ問題 |
ユーザー |
![]() |
提出日時 | 2016-07-31 19:37:42 |
言語 | Fortran (gFortran 14.2.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 690 bytes |
コンパイル時間 | 2,037 ms |
コンパイル使用メモリ | 31,104 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-25 11:50:54 |
合計ジャッジ時間 | 2,947 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 29 |
ソースコード
integer::i,c1,c2,w,mincwwcharacter*100::Sdata c1,c2,w,mincww/0,0,0,101/read *,Sdo i=1,LEN_TRIM(S)if(S(i:i).eq.'c') thenif(w.eq.0) thenc1 = ielsec2 = iend ifelse if (S(i:i).eq.'w') thenif (c1.eq.0) cycleif (w.ne.0) thenmincww = MIN(mincww, i-c1+1)if (c2.ne.0) thenc1 = c2c2 = 0w = ielsec1 = 0w = 0end ifelsew = iend ifend ifend doif (mincww.eq.101) thenprint '(a)',"-1"elseprint '(i0)',mincwwend ifend program