結果
問題 |
No.73 helloworld
|
ユーザー |
|
提出日時 | 2016-11-26 18:48:15 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 751 bytes |
コンパイル時間 | 1,530 ms |
コンパイル使用メモリ | 167,236 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-27 11:38:28 |
合計ジャッジ時間 | 2,155 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 4 WA * 10 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long ll; signed main(){ vector< int > cnt( 256 ); for( int i = 'a'; i <= 'z'; ++i ) cin >> cnt[ i ]; if( cnt[ 'h' ] < 1 or cnt[ 'e' ] < 1 or cnt[ 'l' ] < 3 or cnt[ 'o' ] < 2 or cnt[ 'w' ] < 1 or cnt[ 'r' ] < 1 or cnt[ 'd' ] < 1 ) cout << 0 << endl, exit( 0 ); ll ans = 1; ans *= cnt[ 'h' ]; ans *= cnt[ 'e' ]; ans *= cnt[ 'w' ]; ans *= cnt[ 'r' ]; ans *= cnt[ 'd' ]; ll x = 0; for( int i = 2; cnt[ 'l' ] - i >= 1; ++i ){ x = max( x, 1LL * ( cnt[ 'l' ] - i ) * i * ( i - 1 ) / 2 ); } ans *= x; x = 0; for( int i = 1; cnt[ 'o' ] - i >= 1; ++i ){ x = max( x, 1LL * ( cnt[ 'o' ] - i ) * i / 2 ); } ans *= x; cout << ans << endl; return 0; }