結果
| 問題 |
No.1010 折って重ねて
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-03-27 16:46:36 |
| 言語 | Java (openjdk 23) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 657 bytes |
| コンパイル時間 | 2,047 ms |
| コンパイル使用メモリ | 76,648 KB |
| 実行使用メモリ | 56,312 KB |
| 最終ジャッジ日時 | 2025-01-02 08:44:11 |
| 合計ジャッジ時間 | 8,709 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 27 WA * 16 |
ソースコード
import java.util.*;
public class Main {
public static void main(String[] args) throws Exception {
Scanner sc=new Scanner(System.in);
long X=sc.nextLong();
long Y=sc.nextLong();
int H=sc.nextInt();
X*=1000;
Y*=1000;
if(X<Y){// X,Y must be X>Y
long tmp=X;
X=Y;
Y=tmp;
}
int ans=0;
while(Y>H){
ans++;
Y/=2;
H*=2;
}
while(X>H){
ans++;
X/=2;
H*=2;
}
System.out.println(ans);
}
}