結果

問題 No.232 めぐるはめぐる (2)
ユーザー jjjj
提出日時 2017-01-26 22:58:51
言語 Fortran
(gFortran 13.2.0)
結果
WA  
実行時間 -
コード長 1,374 bytes
コンパイル時間 958 ms
コンパイル使用メモリ 28,080 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-25 00:23:39
合計ジャッジ時間 3,577 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
4,380 KB
testcase_01 AC 61 ms
4,380 KB
testcase_02 AC 25 ms
4,376 KB
testcase_03 AC 38 ms
4,380 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 WA -
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 39 ms
4,376 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 1 ms
4,380 KB
testcase_12 AC 1 ms
4,380 KB
testcase_13 WA -
testcase_14 AC 1 ms
4,380 KB
testcase_15 AC 1 ms
4,376 KB
testcase_16 AC 1 ms
4,380 KB
testcase_17 WA -
testcase_18 AC 2 ms
4,376 KB
testcase_19 AC 1 ms
4,376 KB
testcase_20 AC 1 ms
4,376 KB
testcase_21 AC 1 ms
4,376 KB
testcase_22 WA -
testcase_23 AC 1 ms
4,376 KB
testcase_24 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

program main
  implicit none
  integer::T,A,B,i
  integer::maxab,up
  read *,T,A,B
  maxab = MAX(A,B)
  if(T.lt.maxab) then
     print '(a)', "NO"
     return
  else if(T.eq.maxab) then
     print '(a)', "YES"
     do i=1,maxab
        if(A.gt.0) write(*,'(a)',advance='no') "^"
        if(B.gt.0) write(*,'(a)',advance='no') ">"
        print *,
        A = A - 1
        B = B - 1
     end do
     return
  else if(MOD(T,2).eq.MOD(maxab,2)) then
     print '(a)', "YES"
     do i=1,maxab
        if(A.gt.0) write(*,'(a)',advance='no') "^"
        if(B.gt.0) write(*,'(a)',advance='no') ">"
        print *,
        A = A - 1
        B = B - 1
     end do
     do i=1,(T-maxab)/2
        print '(a)', ">"
        print '(a)', "<"
     end do
     return
  else
     print '(a)', "YES"
     if(A.gt.B) then
        A = A - 1
        up = 1
     else
        B = B - 1
        up = 0
     endif
     maxab = MAX(A,B)
     do i=1,maxab
        if(A.gt.0) write(*,'(a)',advance='no') "^"
        if(B.gt.0) write(*,'(a)',advance='no') ">"
        print *,
        A = A - 1
        B = B - 1
     end do

     do i=1,(T-1-maxab)/2
        print '(a)', ">"
        print '(a)', "<"
     end do

     if(up.eq.1) then
        print '(a)', ">"
        print '(a)', "<^"
     else
        print '(a)', "^"
        print '(a)', "v>"
     endif
     return
  end if
end program main
0