# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1127268 | salmon | Uplifting Excursion (BOI22_vault) | C++20 | 5092 ms | 360 KiB |
#include <bits/stdc++.h>
using namespace std;
int N;
int M;
long long int lst[210];
long long int L;
int main(){
scanf(" %d",&M);
scanf(" %lld",&L);
int memo[M * 2 * 100 + 5];
for(int i = 0; i <= M * 100 * 2; i++){
memo[i] = -1;
}
memo[M * 100] = 0;
for(int i = 0; i <= M * 2; i++){
scanf(" %lld",&lst[i]);
for(int j = 0; j < lst[i]; j++){
int num = i - M;
if(num <= 0){
for(int i = -num; i <= M * 100 * 2; i++){
if(memo[i] != -1) memo[i + num] = max(memo[i + num],memo[i] + 1);
}
}
else{
for(int i = M * 100 * 2 - num; i >= 0; i--){
if(memo[i] != -1) memo[i + num] = max(memo[i + num],memo[i] + 1);
}
}
}
}
if(memo[L + M * 100] != -1)printf("%d\n",memo[L + M * 100]);
else printf("impossible");
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |