結果

問題 No.158 奇妙なお使い
ユーザー sugim48sugim48
提出日時 2015-02-26 23:41:44
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,540 bytes
コンパイル時間 822 ms
コンパイル使用メモリ 83,616 KB
実行使用メモリ 46,884 KB
最終ジャッジ日時 2023-09-06 02:48:29
合計ジャッジ時間 4,812 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 93 ms
46,752 KB
testcase_04 AC 82 ms
46,868 KB
testcase_05 AC 81 ms
46,800 KB
testcase_06 AC 80 ms
46,800 KB
testcase_07 AC 80 ms
46,884 KB
testcase_08 WA -
testcase_09 AC 80 ms
46,716 KB
testcase_10 AC 80 ms
46,764 KB
testcase_11 AC 80 ms
46,880 KB
testcase_12 AC 81 ms
46,720 KB
testcase_13 AC 81 ms
46,744 KB
testcase_14 AC 81 ms
46,812 KB
testcase_15 AC 80 ms
46,816 KB
testcase_16 WA -
testcase_17 AC 81 ms
46,760 KB
testcase_18 AC 80 ms
46,760 KB
testcase_19 WA -
testcase_20 AC 80 ms
46,804 KB
testcase_21 AC 80 ms
46,736 KB
testcase_22 AC 93 ms
46,752 KB
testcase_23 AC 82 ms
46,880 KB
testcase_24 AC 82 ms
46,880 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 80 ms
46,292 KB
testcase_28 AC 81 ms
46,688 KB
testcase_29 WA -
testcase_30 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _USE_MATH_DEFINES
#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstring>
#include <cmath>
#include <fstream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;
typedef pair<ll, int> ll_i;
typedef pair<double, int> d_i;
typedef pair<ll, ll> ll_ll;
typedef pair<double, double> d_d;
struct edge { ll B, T, F, P; };

unsigned MOD = 1000000007;
ll _MOD = 1000000009;
double EPS = 1e-10;
int UNKO = INT_MAX;

int dp[11][101][10001];

int main() {
	int a4, a3, a1;
	cin >> a4 >> a3 >> a1;
	int Db; cin >> Db;
	int b4, b3, b1;
	cin >> b4 >> b3 >> b1;
	int Dc; cin >> Dc;
	int c4, c3, c1;
	cin >> c4 >> c3 >> c1;
	for (int i = 0; i <= 10; i++)
		for (int j = 0; j <= 100; j++)
			for (int k = 0; k <= 10000; k++) {
				int& x = dp[i][j][k];
				int _Db = Db;
				int B4 = min(i, _Db / 1000); _Db -= B4 * 1000;
				int B3 = min(j, _Db / 100); _Db -= B3 * 100;
				int B1 = min(k, _Db / 1); _Db -= B1 * 1;
				if (!_Db) x = max(x, dp[i - B4 + b4][j - B3 + b3][k - B1 + b1] + 1);
				int _Dc = Dc;
				int C4 = min(i, _Dc / 1000); _Dc -= C4 * 1000;
				int C3 = min(j, _Dc / 100); _Dc -= C3 * 100;
				int C1 = min(k, _Dc / 1); _Dc -= C1 * 1;
				if (!_Dc) x = max(x, dp[i - C4 + c4][j - C3 + c3][k - C1 + c1] + 1);
			}
	cout << dp[a4][a3][a1] << endl;
}
0