結果

問題 No.45 回転寿司
ユーザー T101010101T101010101
提出日時 2022-11-29 22:38:22
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
MLE  
実行時間 -
コード長 1,307 bytes
コンパイル時間 3,909 ms
コンパイル使用メモリ 253,496 KB
実行使用メモリ 789,632 KB
最終ジャッジ日時 2024-04-16 13:31:54
合計ジャッジ時間 14,590 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 297 ms
336,256 KB
testcase_01 AC 419 ms
472,832 KB
testcase_02 MLE -
testcase_03 MLE -
testcase_04 WA -
testcase_05 AC 85 ms
95,616 KB
testcase_06 AC 420 ms
417,920 KB
testcase_07 MLE -
testcase_08 AC 203 ms
221,952 KB
testcase_09 MLE -
testcase_10 AC 318 ms
349,696 KB
testcase_11 AC 186 ms
202,368 KB
testcase_12 MLE -
testcase_13 AC 77 ms
87,040 KB
testcase_14 WA -
testcase_15 AC 347 ms
381,824 KB
testcase_16 AC 231 ms
251,648 KB
testcase_17 AC 306 ms
331,648 KB
testcase_18 AC 238 ms
262,016 KB
testcase_19 MLE -
testcase_20 AC 48 ms
53,248 KB
testcase_21 AC 71 ms
79,872 KB
testcase_22 AC 7 ms
8,576 KB
testcase_23 AC 7 ms
8,704 KB
testcase_24 AC 9 ms
11,008 KB
testcase_25 AC 4 ms
6,272 KB
testcase_26 AC 336 ms
373,120 KB
testcase_27 MLE -
testcase_28 AC 374 ms
405,248 KB
testcase_29 MLE -
testcase_30 MLE -
testcase_31 AC 6 ms
7,808 KB
testcase_32 WA -
testcase_33 MLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma region Macros

#include <bits/extc++.h>
using namespace std;
using namespace __gnu_pbds;
// using namespace __gnu_cxx;

#define TO_STRING(var) # var
#define pb emplace_back
#define int ll
#define endl '\n'

using ll = long long;
using ld = long double;
const ld PI = acos(-1);
const ld EPS = 1e-10;
const int INF = 1 << 30;
const ll INFL = 1LL << 62;
// const int MOD = 998244353;
const int MOD = 1000000007;

int ceil(int x, int y) {return (x > 0 ? (x + y - 1) / y : x / y);}
int POW(int x, int y) {
    if (y != (int)(y) or y < 0 or x != 0 && x != 1 && y > 64) {cout << "Error" << endl;return 0;}
    if (y == 0) return 1;
    if (y % 2 == 0) return POW(x * x, y / 2);
    return x * POW(x, y - 1);
}

__attribute__((constructor))
void constructor() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(15);
}

#pragma endregion

signed main(){
    int N;
	cin >> N;

	vector<int> V(N);
	for (int i = 0; i < N; i++) cin >> V[i];

	vector<vector<int>> dp(N + 2,vector<int>(100101));
	dp[0][0] = true;
	for (int i = 0; i < N; i++) {
		for (int j = 0; j <= 100000; j++) {
			if (dp[i][j]) {
				dp[i + 1][j] = true;
				dp[i + 2][j + V[i]] = true;
			}
		}
	}
	for (int i = 100000; i >= 0; i--) {
		if (dp[N + 1][i]) {
			cout << i << endl;
			return 0;
		}
	}
}
0