# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
923028 | penguin133 | Bootfall (IZhO17_bootfall) | C++17 | 1037 ms | 18264 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pi pair<int, int>
#define pii pair<int, pi>
#define fi first
#define se second
#ifdef _WIN32
#define getchar_unlocked _getchar_nolock
#endif
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
bitset <271*271*2>dp[505], dp2[505];
int n, A[505];
const int os = 270 * 270;
bool chk(int a, int b){
if(os - a - b >= 0 && dp[n & 1][os - a - b])return 1;
if(os - a + b >= 0 && os - a + b <= 2 * os && dp[n & 1][os - a + b])return 1;
if(os + a - b >= 0 && os + a - b <= 2 * os && dp[n & 1][os + a - b])return 1;
if(os + a + b <= 2 * os && dp[n & 1][os + a + b])return 1;
return 0;
}
void solve(){
cin >> n;
for(int i = 1; i <= n; i++)cin >> A[i];
//for(int i = 0; i <= 2 * os; i++)dp[0][i] = 0
dp[0][os] = dp2[n + 1][os] = 1;
Compilation message (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... |