답안 #604359

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
604359 2022-07-25T04:52:58 Z Plurm Uplifting Excursion (BOI22_vault) C++11
0 / 100
5000 ms 3360 KB
#include <bits/stdc++.h>
using namespace std;

map<int, int> a, knapsack;
int main() {
  int m;
  long long l;
  cin >> m >> l;
  knapsack[0] = 0;
  for (int i = -m; i <= m; i++) {
    cin >> a[i];
    for (int rep = 0; rep < a[i]; rep++) {
      map<int, int> tmp;
      for (auto p : knapsack) {
        tmp[p.first + i] = max(tmp[p.first + i], p.second + 1);
      }
      for (auto p : tmp) {
        knapsack[p.first] = max(knapsack[p.first], p.second);
      }
    }
  }
  if (l >= 1e9)
    printf("impossible\n");
  else if (knapsack.count(l))
    printf("%d\n", knapsack[l]);
  else
    printf("impossible\n");
  return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Execution timed out 5053 ms 3360 KB Time limit exceeded
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Execution timed out 5053 ms 3360 KB Time limit exceeded
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Execution timed out 5062 ms 1412 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Execution timed out 5062 ms 1412 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Execution timed out 5062 ms 1412 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Execution timed out 5053 ms 3360 KB Time limit exceeded
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Execution timed out 5062 ms 1412 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Execution timed out 5053 ms 3360 KB Time limit exceeded
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Execution timed out 5062 ms 1412 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Execution timed out 5053 ms 3360 KB Time limit exceeded
6 Halted 0 ms 0 KB -