結果
| 問題 |
No.1010 折って重ねて
|
| コンテスト | |
| ユーザー |
ntk3264
|
| 提出日時 | 2020-04-03 02:38:35 |
| 言語 | Java (openjdk 23) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 862 bytes |
| コンパイル時間 | 1,776 ms |
| コンパイル使用メモリ | 74,052 KB |
| 実行使用メモリ | 54,516 KB |
| 最終ジャッジ日時 | 2024-06-28 17:38:07 |
| 合計ジャッジ時間 | 8,106 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 40 WA * 3 |
ソースコード
import java.io.PrintWriter;
import java.util.*;
public class Main {
Scanner sc = new Scanner(System.in);
PrintWriter out = new PrintWriter(System.out);
public static void main(String[] args) {
new Main().run();
}
void run() {
long x = sc.nextLong()*1000;
long y = sc.nextLong()*1000;
long h = sc.nextLong();
int ans = 0;
label:
while (x>h || y>h) {
if (y<x) {
long tmp = y;
y = x;
x = tmp;
}
if (x>h) {
x /= 2;
h *= 2;
ans++;
continue label;
}
if (y>h) {
y /= 2;
h *= 2;
ans++;
}
}
out.print(ans);
out.flush();
}
}
ntk3264