結果
問題 |
No.638 Sum of "not power of 2"
|
ユーザー |
|
提出日時 | 2018-04-19 23:21:22 |
言語 | Fortran (gFortran 14.2.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 483 bytes |
コンパイル時間 | 154 ms |
コンパイル使用メモリ | 32,256 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-27 04:56:12 |
合計ジャッジ時間 | 849 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 12 |
ソースコード
module mdl contains function ispower2(n) integer*8,value::n logical::ispower2 do while(mod(n,2)==0.and.n>0) n=n/2 end do ispower2=n==1 end function end module program main use mdl implicit none integer*8::n,i read*,n do i=1,min(n-1,10) if(.not.ispower2(i).and..not.ispower2(n-i))then print"(i0,' ',i0)",i,n-i return end if end do print*,-1 end program