結果
| 問題 |
No.915 Plus Or Multiple Operation
|
| コンテスト | |
| ユーザー |
htensai
|
| 提出日時 | 2020-01-22 10:23:12 |
| 言語 | Java (openjdk 23) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 851 bytes |
| コンパイル時間 | 3,713 ms |
| コンパイル使用メモリ | 84,648 KB |
| 実行使用メモリ | 121,756 KB |
| 最終ジャッジ日時 | 2024-11-07 03:45:22 |
| 合計ジャッジ時間 | 8,446 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 3 |
| other | TLE * 1 -- * 9 |
ソースコード
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
StringBuilder sb = new StringBuilder();
for (int i = 0; i < n; i++) {
int a = sc.nextInt();
long b = sc.nextInt();
int c = sc.nextInt();
long total = 0;
while (a >= 2 * c) {
if (a % c != 0) {
total++;
a = a / c * c;
} else {
a /= Math.min(c, a / c);
total++;
}
}
if (a >= c) {
total += 2;
} else {
total++;
}
sb.append(total * b).append("\n");
}
System.out.println(sb);
}
}
htensai