結果
| 問題 |
No.149 碁石の移動
|
| コンテスト | |
| ユーザー |
koukonko
|
| 提出日時 | 2015-12-13 00:45:37 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 50 ms / 2,000 ms |
| コード長 | 844 bytes |
| コンパイル時間 | 1,852 ms |
| コンパイル使用メモリ | 75,820 KB |
| 実行使用メモリ | 36,796 KB |
| 最終ジャッジ日時 | 2024-12-24 03:13:51 |
| 合計ジャッジ時間 | 3,371 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 13 |
ソースコード
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) {
BufferedReader read = new BufferedReader(new InputStreamReader(System.in));
try {
String[] abox = read.readLine().split(" ");
String[] bbox = read.readLine().split(" ");
String[] cbox = read.readLine().split(" ");
int[] a = new int[2];
int[] b = new int[2];
int[] c = new int[2];
for (int i = 0; i < 2; ++i) {
a[i] = Integer.parseInt(abox[i]);
b[i] = Integer.parseInt(bbox[i]);
c[i] = Integer.parseInt(cbox[i]);
}
if (a[1] - c[0] < 0) {
b[0] += Math.abs(a[1] - c[0]);
a[0] += a[1] - c[0];
}
if (b[0] - c[1] < 0) {
a[0] += b[0];
} else {
a[0] += c[1];
}
System.out.println(a[0]);
} catch (Exception e) {
e.printStackTrace();
}
}
}
koukonko