QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#231901 | #7063. Space Station | ucup-team1001 | WA | 1ms | 7528kb | C++20 | 1.2kb | 2023-10-29 17:52:30 | 2023-10-29 17:52:31 |
Judging History
answer
#include<bits/stdc++.h>
#define ull unsigned long long
using namespace std;
#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define ll long long
int tot = 0;
#define irep(i, l, r) for(int i = l; i <= r; ++ i)
int state[1380000][55];
int sum[1380000];
array<ll, 55> temp;
ll pw[55] = {1, 1};
int n0 = 52;
const int N = 1380000;
struct my_hash {
auto operator()(const array<ll, 55> &arr) const {
int hs = 0;
irep(i, 1, 50) {
hs += arr[i] * pw[i];
}
return hs;
}
};
unordered_map<array<ll, 55>, int, my_hash> mp;
inline int read() {
int x;
cin >> x;
return x;
}
void dfs(int n, int lst) {
if (n < 0)return;
// int hs = 0;
irep(i, 1, 50) {
// hs += temp[i] * pw[i];
state[tot][i] = temp[i];
}
mp[temp] = tot;
sum[tot] = n0 - n;
++tot;
for (int i = lst; i <= n; ++i) {
temp[i]++;
dfs(n - i, i);
temp[i]--;
}
}
const int mod = 1e9 + 7;
ll f[N];
int main() {
IOS
int n = read();
irep(i, 2, 52) {
pw[i] = pw[i - 1] * 13331;
}
dfs(n, 1);
}
/*
204226 * 50
*/
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 7528kb
input:
3 2 1 2 3
output:
result:
wrong answer 1st lines differ - expected: '4', found: ''