結果

問題 No.73 helloworld
ユーザー atetubouatetubou
提出日時 2014-11-21 08:53:17
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 1,648 bytes
コンパイル時間 1,479 ms
コンパイル使用メモリ 166,716 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-11 07:26:25
合計ジャッジ時間 2,225 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 1 ms
4,380 KB
testcase_12 AC 1 ms
4,376 KB
testcase_13 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef ll li;
typedef pair<ll,ll> PI;
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define REP(i, n) rep (i, n)
#define F first
#define S second
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define SZ(a) (int)((a).size())
#define ALL(a) (a).begin(),(a).end()
#define FLL(a,b) memset((a),b,sizeof(a))
#define CLR(a) memset((a),0,sizeof(a))
#define FOR(it,a) for(__typeof(a.begin())it=a.begin();it!=a.end();++it)
#define FORR(it,a) for(__typeof(a.rbegin())it=a.rbegin();it!=a.rend();++it)
template<typename T,typename U> ostream& operator<< (ostream& out, const pair<T,U>& val){return out << "(" << val.F << ", " << val.S << ")";}
template<class T> ostream& operator<< (ostream& out, const vector<T>& val){out << "{";rep(i,SZ(val)) out << (i?", ":"") << val[i];return out << "}";}
#define declare(a,it) __typeof(a) it=a
const double EPS = 1e-8;

const int dx[]={1,0,-1,0,1,1,-1,-1,0};
const int dy[]={0,1,0,-1,-1,1,-1,1,0};

#define endl '\n'


int main(int argc, char *argv[])
{
  int a[26];
  rep(i,26) cin >> a[i];
  ll ans = 1;
  ans *= a['h'-'a'];
  ans *= a['e'-'a'];
  ans *= a['w'-'a'];
  ans *= a['r'-'a'];
  ans *= a['d'-'a'];
  int o = 1;
  if(a['o'-'a']<2) o = 0;
  for(int i = 0; i <= a['o'-'a']; ++i){
    o = max(o, i * (a['o'-'a']-i));
  }

  ans *= o;
  int l = 1;
  if(a['l'-'a'] < 3) l = 0;
  
  for(int i = 0; i <= a['l'-'a']; ++i){
    l = max(l, i * (i-1) / 2 * (a['l'-'a']-i));
  }  
  ans *= l;
  cout << ans << endl;
  return 0;
}
0