結果
| 問題 |
No.380 悪の台本
|
| コンテスト | |
| ユーザー |
jj
|
| 提出日時 | 2016-08-30 21:20:32 |
| 言語 | Fortran (gFortran 14.2.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 2,133 bytes |
| コンパイル時間 | 573 ms |
| コンパイル使用メモリ | 32,640 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-06 23:09:43 |
| 合計ジャッジ時間 | 2,061 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 2 |
| other | WA * 2 RE * 6 |
コンパイルメッセージ
Main.f90:7:33:
7 | read (*,'(a)',advance='yes'),str
| 1
Warning: Legacy Extension: Comma before i/o item list at (1)
ソースコード
program main
implicit none
integer::N
character*102400::str
do
read (*,'(a)',advance='yes'),str
if(str(1:1).eq." ") exit
if(check(str).eqv..true.) then
print '(a)', "CORRECT (maybe)"
else
print '(a)', "WRONG!"
end if
end do
contains
logical function check(str) result(l)
integer::i
character*7::strend
character*102400::str
l = .false.
if(str(1:5).eq."rabi ") then
do i=6,LEN(str)
if((ICHAR(str(i:i)).ge.ICHAR('a').and. &
ICHAR(str(i:i)).le.ICHAR('z')).or. &
(ICHAR(str(i:i)).ge.ICHAR('A').and. &
ICHAR(str(i:i)).le.ICHAR('Z')).or. &
(ICHAR(str(i:i)).ge.ICHAR('0').and. &
ICHAR(str(i:i)).le.ICHAR('9'))) then
l = .true.
return
end if
end do
end if
if(LEN(str).lt.7) return
call get_capital_str(str,strend)
if(str(1:5).eq."digi ") then
do i=2,5
if(strend(i:i+2).eq."NYO") then
l = .true.
exit
end if
end do
else if(str(1:5).eq."petit ") then
do i=2,5
if(strend(i:i+2).eq."NYU") then
l = .true.
exit
end if
end do
else if(str(1:5).eq."gema ") then
do i=1,4
if(strend(i:i+3).eq."GEMA") then
l = .true.
exit
end if
end do
else if(str(1:5).eq."piyo ") then
do i=2,5
if(strend(i:i+2).eq."PYO") then
l = .true.
exit
end if
end do
end if
end function check
character function get_capital(c) result(cc)
character::c
if(ICHAR(c).ge.ICHAR('a').and.ICHAR(c).le.ICHAR('z')) then
cc = CHAR(ICHAR(c)-ICHAR('a')+ICHAR('A'))
else
cc = c
end if
end function get_capital
subroutine get_capital_str(str, strend)
integer::i
character*7::strend
character*102400::str
do i=1,7
strend(i:i) = get_capital(str(i+LEN_TRIM(str)-7:i+LEN_TRIM(str)-7))
end do
end subroutine get_capital_str
end program main
jj