結果
問題 | No.149 碁石の移動 |
ユーザー |
![]() |
提出日時 | 2018-02-05 15:40:30 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 659 bytes |
コンパイル時間 | 658 ms |
コンパイル使用メモリ | 81,372 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-07 19:40:51 |
合計ジャッジ時間 | 1,417 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 13 |
ソースコード
#include<iostream> #include<string> #include<string.h> #include<algorithm> #include<stdio.h> #include<cmath> #include<vector> #include<utility> #include<stack> #include<queue> #include<list> #include<bitset> #include<functional> #define FOR(i, a, b) for(int i=(a);i<=(b);i++) #define RFOR(i, a, b) for(int i=(a);i>=(b);i--) #define MOD 1000000007 #define INF 1000000000 using namespace std; typedef pair<int, int> P; int main(void) { long long int aw, ab, bw, bb, c, d; cin >> aw >> ab >> bw >> bb >> c >> d; if (c - ab > 0) { aw -= (c - ab); bw += (c - ab); } if (d > bw) { aw += bw; } else { aw += d; } cout << aw << endl; return 0; }