結果
| 問題 |
No.398 ハーフパイプ(2)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-11-14 22:42:21 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 1,221 ms / 2,000 ms |
| コード長 | 3,547 bytes |
| コンパイル時間 | 5,304 ms |
| コンパイル使用メモリ | 302,088 KB |
| 実行使用メモリ | 110,356 KB |
| 最終ジャッジ日時 | 2024-11-14 22:42:50 |
| 合計ジャッジ時間 | 26,304 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 17 |
ソースコード
// あの花はまだどこかに咲いているに違いない
// 我们会慢慢长大成人,在不断流逝的季节之中,盛开在路旁的花儿们,也在渐渐变化,盛开在那个季节里的花朵叫什么名字呢,在风中小小摇曳,伸手触碰便被扎得疼痛,把脸凑近,就能闻到一股淡淡的青涩的太阳芳香,那股芳香渐渐消散,而我们渐渐长大,但是,那朵花一定依旧盛开在某处。
// Code by ttq012.
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/hash_policy.hpp>
#define eb emplace_back
#define int long long
using namespace std;
const int N = 4000010;
const int mod = 1e9 + 7;
const int base = 256;
const int inf = 0x0d000721ll << 2 | 0xAC66666;
namespace ttq012 {
int read() {
int o = 1, x = 0;
char ch;
while (!isdigit(ch = getchar())) {
if (ch == '-') {
o = -o;
}
}
x = ch & 15;
while (isdigit(ch = getchar())) {
x = (x << 3) + (x << 1) + (ch & 15);
}
return x * o;
}
int exgcd(int a, int b, int &x, int &y) {
if (!b) {
x = 1, y = 0;
return a;
}
int g, xp, yp;
g = exgcd(b, a % b, xp, yp);
x = yp, y = xp - yp * (a / b);
return g;
}
int ksm(int a, int b, int c) {
int ans = 1;
while (b) {
if (b & 1) {
ans = ans * a % c;
}
a = a * a % c;
b >>= 1;
}
return ans;
}
int Inv(int a, int Mod) {
return ksm(a, Mod - 2, Mod);
}
int gcd(int a, int b) {
return b ? gcd(b, a % b) : a;
}
int lcm(int a, int b) {
return a / gcd(a, b) * b;
}
inline int max(const int &a, const int &b) noexcept {
return a > b ? a : b;
}
inline int min(const int &a, const int &b) noexcept {
return a < b ? a : b;
}
void swap(int &a, int &b) {
a ^= b ^= a ^= b;
} } // using namespace ttq012;
namespace ttq012 {
int f[101][101][606], g[101][101][730];
struct myhash{
static uint64_t rand(uint64_t x){
x^=x<<13;
x^=x>>7;
return x^=x<<17;
}
size_t operator()(size_t x)const{
static const uint64_t f_rand=chrono::steady_clock::now().time_since_epoch().count();
return rand(x+f_rand);
}
};
__gnu_pbds::gp_hash_table<int, int> h;
void run() {
clock_t stc = clock();
int a, b;
scanf("%lld.%lld", &a, &b);
a = a * 4 + b / 25;
for (int i = 0; i < 101; ++i) {
f[i][i][i] = 1;
}
for (int i = 1; i < 6; ++i) {
for (int k = 0; k < 101; ++k) {
for (int x = 0; x < 101; ++x) {
for (int y = x; y < 101; ++y) {
for (int s = 0; s < 101 * i; ++s) {
g[min(x, k)][max(y, k)][s + k] += f[x][y][s];
}
}
}
}
for (int i = 0; i < 101; ++i) {
for (int j = 0; j < 101; ++j) {
for (int k = 0; k < 606; ++k) {
f[i][j][k] = g[i][j][k];
g[i][j][k] = 0;
}
}
}
}
for (int i = 0; i < 101; ++i) {
for (int j = i; j < 101; ++j) {
for (int k = 0; k < 6 * 101; ++k) {
if (f[i][j][k] > 0) {
h[k - i - j] += f[i][j][k];
}
}
}
}
if (b % 25 == 0) {
cout << h[a] << '\n';
} else {
cout << "0\n";
}
clock_t edc = clock();
} }
signed main() {
ttq012::run();
return 0;
}
/*
*/