結果
問題 | No.398 ハーフパイプ(2) |
ユーザー |
![]() |
提出日時 | 2016-07-15 22:47:11 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 153 ms / 2,000 ms |
コード長 | 1,286 bytes |
コンパイル時間 | 895 ms |
コンパイル使用メモリ | 102,964 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-27 14:31:57 |
合計ジャッジ時間 | 2,560 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 17 |
ソースコード
#include <iostream>#include <cstdio>#include <cassert>#include <cstring>#include <vector>#include <valarray>#include <array>#include <queue>#include <set>#include <unordered_set>#include <map>#include <unordered_map>#include <algorithm>#include <cmath>#include <complex>#include <random>using namespace std;using ll = long long;using ull = unsigned long long;constexpr int TEN(int n) {return (n==0)?1:10*TEN(n-1);}using Q = array<int, 6>;int coun(Q q) {sort(q.begin(), q.end());int u = 0;do {u++;} while (next_permutation(q.begin(), q.end()));return u;}int main() {double _x;cin >> _x;_x *= 4;int x = int(round(_x));ll co = 0;for (int i = 0; i <= 100; i++) {for (int j = i; j <= 100; j++) {for (int k = j; k <= 100; k++) {for (int l = k; l <= 100; l++) {if (i+j+k+l != x) continue;int x = i, y = 100-l;co += x*y*coun(Q{-1, i, j, k, l, 101});co += y*coun(Q{i, i, j, k, l, 101});co += x*coun(Q{-1, i, j, k, l, l});co += coun(Q{i, i, j, k, l, l});}}}}cout << co << endl;return 0;}