結果
| 問題 |
No.73 helloworld
|
| コンテスト | |
| ユーザー |
tottoripaper
|
| 提出日時 | 2014-11-20 23:53:08 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 5,000 ms |
| コード長 | 673 bytes |
| コンパイル時間 | 193 ms |
| コンパイル使用メモリ | 34,132 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-28 21:52:46 |
| 合計ジャッジ時間 | 732 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 14 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:14:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
14 | scanf("%lld", cs+i);
| ~~~~~^~~~~~~~~~~~~~
ソースコード
#include <cstdio>
#include <algorithm>
typedef long long ll;
ll cs[26];
ll at(char c){
return cs[c-'a'];
}
int main(){
for(int i=0;i<26;i++){
scanf("%lld", cs+i);
// printf("%c: %lld\n", 'a'+i, cs[i]);
}
if(at('h') >= 1 && at('e') >= 1 && at('l') >= 3 &&
at('o') >= 2 && at('w') >= 1 && at('r') >= 1 &&
at('d') >= 1){
ll mx = 0;
for(int x=2;at('l')-x>0;x++){
mx = std::max(mx, at('h') * at('e') * (at('o')/2) * ((at('o')+1)/2) * at('w') * at('r') * at('d') * x * (x-1) / 2 * (at('l')-x));
}
printf("%lld\n", mx);
}else{
puts("0");
}
}
tottoripaper