結果
| 問題 | No.1010 折って重ねて |
| コンテスト | |
| ユーザー |
tenten
|
| 提出日時 | 2020-12-01 10:05:01 |
| 言語 | Java (openjdk 26.0.2.1) |
| 結果 |
AC
|
| 実行時間 | 61 ms / 2,000 ms |
| + 660µs | |
| コード長 | 719 bytes |
| 記録 | |
| コンパイル時間 | 1,521 ms |
| コンパイル使用メモリ | 83,896 KB |
| 実行使用メモリ | 43,224 KB |
| 最終ジャッジ日時 | 2026-08-25 21:01:57 |
| 合計ジャッジ時間 | 6,666 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 43 |
ソースコード
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
double x = sc.nextInt() * 1000L;
double y = sc.nextInt() * 1000L;
double h = sc.nextInt();
int count = 0;
while (true) {
if (x < y && x > h) {
count++;
x /= 2;
h *= 2;
} else if (y > h) {
count++;
y /= 2;
h *= 2;
} else if (x > h) {
count++;
x /= 2;
h *= 2;
} else {
break;
}
}
System.out.println(count);
}
}
tenten