結果
| 問題 |
No.73 helloworld
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-04-15 06:17:51 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 5,000 ms |
| コード長 | 463 bytes |
| コンパイル時間 | 3,714 ms |
| コンパイル使用メモリ | 190,656 KB |
| 最終ジャッジ日時 | 2025-01-09 19:13:44 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 14 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:10:24: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
10 | rep(i,26) scanf("%lld",&a[i]);
| ~~~~~^~~~~~~~~~~~~~
ソースコード
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
using lint=long long;
int main(){
lint a[26];
rep(i,26) scanf("%lld",&a[i]);
lint ans=1,tmp;
ans*=a['h'-'a'];
ans*=a['e'-'a'];
ans*=a['w'-'a'];
ans*=a['r'-'a'];
ans*=a['d'-'a'];
tmp=0;
rep(i,a['l'-'a']+1) tmp=max(tmp,i*(i-1)/2*(a['l'-'a']-i));
ans*=tmp;
tmp=0;
rep(i,a['o'-'a']+1) tmp=max(tmp,i*(a['o'-'a']-i));
ans*=tmp;
printf("%lld\n",ans);
return 0;
}