結果
問題 | No.490 yukiソート |
ユーザー |
![]() |
提出日時 | 2017-03-10 23:38:20 |
言語 | Fortran (gFortran 14.2.0) |
結果 |
AC
|
実行時間 | 16 ms / 2,000 ms |
コード長 | 648 bytes |
コンパイル時間 | 1,248 ms |
コンパイル使用メモリ | 33,152 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-24 10:27:15 |
合計ジャッジ時間 | 2,527 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 34 |
コンパイルメッセージ
Main.f90:28:30: 28 | write(cformat(5:9),'(i0)'),size(array) | 1 Warning: Legacy Extension: Comma before i/o item list at (1)
ソースコード
program mainimplicit noneinteger::n,i,p,q,tmpinteger,allocatable::a(:)read *,nallocate(a(0:n-1))read *,a(0:n-1)do i=1,2*n-4do p=0, n-1q = i-pif(q.lt.0.or.q.ge.n.or.p.ge.q) cycleif(a(p).gt.a(q)) thentmp = a(p)a(p) = a(q)a(q) = tmpend if! print *,i,p,q! call aprinter(a)end doend docall aprinter(a)containssubroutine aprinter(array)integer*4::array(:)character*32::cformat='(i0, (1x,i0))'write(cformat(5:9),'(i0)'),size(array)write(*,cformat) arrayend subroutine aprinterend program main