結果
問題 | No.638 Sum of "not power of 2" |
ユーザー |
|
提出日時 | 2018-04-19 23:19:47 |
言語 | Fortran (gFortran 14.2.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 488 bytes |
コンパイル時間 | 571 ms |
コンパイル使用メモリ | 32,256 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-27 04:56:09 |
合計ジャッジ時間 | 1,112 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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,1000000) 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