結果

問題 No.112 ややこしい鶴亀算
ユーザー s0j1san
提出日時 2018-01-07 22:57:20
言語 Fortran
(gFortran 14.2.0)
結果
WA  
実行時間 -
コード長 299 bytes
コンパイル時間 163 ms
コンパイル使用メモリ 32,640 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-23 11:13:49
合計ジャッジ時間 1,006 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 18 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

program main
    implicit none
    integer n,m
    integer,allocatable,dimension(:)::a
    read(*,*)n
    allocate(a(n))
    read(*,*)a
    if(minval(a)==maxval(a).and.a(2)==2*(n-1))then
        write(*,*)n,0
    else
        m=maxval(a)+2
        write(*,*)2*n-m/2,m/2-n
    endif
end program main
0