結果

問題 No.1010 折って重ねて
ユーザー N_Gakuto7
提出日時 2020-04-02 22:33:00
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 800 bytes
コンパイル時間 2,302 ms
コンパイル使用メモリ 74,768 KB
実行使用メモリ 41,520 KB
最終ジャッジ日時 2024-06-28 15:21:30
合計ジャッジ時間 9,445 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10 WA * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
         
class Main{
    public static void main(String[] args) {
        
        try(Scanner sc = new Scanner(System.in)){
 
            int tate = Integer.parseInt(sc.next()) * 1000;
            int yoko = Integer.parseInt(sc.next()) * 1000;
            int atsumi = Integer.parseInt(sc.next());

            int count = 0;

            while(tate > atsumi || yoko > atsumi){
                if(tate > atsumi){
                    tate = tate /2;
                    atsumi = atsumi * 2;
                } else {
                    yoko = yoko /2;
                    atsumi = atsumi * 2;
                } 
                count++;
            }

            System.out.println(count);

        }catch(Exception e){
            e.printStackTrace();
        }        
    }
}
0