結果
問題 | No.73 helloworld |
ユーザー |
![]() |
提出日時 | 2019-07-07 18:55:58 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 1,153 bytes |
コンパイル時間 | 1,097 ms |
コンパイル使用メモリ | 106,700 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-05 05:07:36 |
合計ジャッジ時間 | 1,584 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 14 |
ソースコード
#include <iostream>#include <string>#include <algorithm>#include <vector>#include <stack>#include <queue>#include <list>#include <set>#include <map>#include <numeric>#include <regex>#include <tuple>#include <iomanip>#include <cmath>using namespace std;typedef long long ll;typedef pair<int, int> P;#define MOD 1000000007 // 10^9 + 7#define INF 1000000000 // 10^9#define LLINF 1LL<<60ll C[26];// aCbll comb(ll a, ll b) {ll res = 1;for (ll i = 0; i < b; i++) res *= (a - i);for (ll i = 1; i <= b; i++) res /= i;//cout << res << " ";return res;}int main() {cin.tie(0);ios::sync_with_stdio(false);for (int i = 0; i < 26; i++) cin >> C[i];if (C[3] > 0 && C[4] > 0 && C[7] > 0 && C[11] > 2 && C[14] > 1 && C[17] > 0 && C[22] > 0) {//cout << "ok" << endl;ll ans = 1;ans *= C[3];ans *= C[4];ans *= C[7];ll res = 1;for (ll i = 2; i < C[11]; i++) {ll tmp = comb(i, 2)*(C[11] - i);res = max(res, tmp);}ans *= res;//cout << res << " ";ans *=( C[14] / 2*(C[14] - C[14] / 2));ans *= C[17];ans *= C[22];cout << ans << endl;}else cout << 0 << endl;return 0;}