結果
| 問題 |
No.149 碁石の移動
|
| コンテスト | |
| ユーザー |
htensai
|
| 提出日時 | 2019-11-30 10:05:55 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 138 ms / 2,000 ms |
| コード長 | 410 bytes |
| コンパイル時間 | 2,159 ms |
| コンパイル使用メモリ | 74,616 KB |
| 実行使用メモリ | 43,448 KB |
| 最終ジャッジ日時 | 2024-11-21 01:01:26 |
| 合計ジャッジ時間 | 5,537 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 13 |
ソースコード
import java.util.*;
public class Main {
public static void main (String[] args) {
Scanner sc = new Scanner(System.in);
int aw = sc.nextInt();
int ab = sc.nextInt();
int bw = sc.nextInt();
int bb = sc.nextInt();
int c = sc.nextInt();
int d = sc.nextInt();
bw += Math.max(c - ab, 0);
aw -= Math.max(c - ab, 0);
bb += Math.min(ab, c);
aw += Math.min(d, bw);
System.out.println(aw);
}
}
htensai