結果
| 問題 |
No.149 碁石の移動
|
| コンテスト | |
| ユーザー |
fkwnw3_1243
|
| 提出日時 | 2017-04-29 20:15:52 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 59 ms / 2,000 ms |
| コード長 | 982 bytes |
| コンパイル時間 | 2,191 ms |
| コンパイル使用メモリ | 75,160 KB |
| 実行使用メモリ | 36,756 KB |
| 最終ジャッジ日時 | 2024-12-24 03:23:52 |
| 合計ジャッジ時間 | 4,017 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 13 |
ソースコード
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;
import static java.lang.System.in;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(in));
String[] inputs = reader.readLine().split(" ");
int aw = Integer.parseInt(inputs[0]);
int ab = Integer.parseInt(inputs[1]);
inputs = reader.readLine().split(" ");
int bw = Integer.parseInt(inputs[0]);
int bb = Integer.parseInt(inputs[1]);
inputs = reader.readLine().split(" ");
int c = Integer.parseInt(inputs[0]);
int d = Integer.parseInt(inputs[1]);
if (ab < c) {
aw = aw - (c - ab);
bw = bw + (c-ab);
}
if (bw < d) {
aw = aw + bw;
} else {
aw = aw + d;
}
System.out.println(aw);
}
}
fkwnw3_1243