結果
| 問題 |
No.73 helloworld
|
| コンテスト | |
| ユーザー |
goodbaton
|
| 提出日時 | 2014-11-21 00:34:20 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 1,024 bytes |
| コンパイル時間 | 1,616 ms |
| コンパイル使用メモリ | 65,720 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-28 21:55:37 |
| 合計ジャッジ時間 | 1,401 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 14 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:23:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
23 | scanf("%d",&al[i]);
| ~~~~~^~~~~~~~~~~~~
ソースコード
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
using namespace std;
long long c2(long long a){
return a*(a-1)/2;
}
int main(){
int al[27],ch[6]={3,4,7,17,22};
long long k=1,sum=0,k1,k1_m=0;
for(int i=0;i<26;i++){
scanf("%d",&al[i]);
sum+=al[i];
}
if(al[4] && al[3] && al[7] && al[11]>=3 && al[14]>=2 && al[17] && al[22]){
for(int i=0;i<5;i++){
k*=al[ch[i]];
}
for(int j=1;j<al[14];j++){
k1=j*(al[14]-j);
if(k1>k1_m) k1_m=k1;
}
k*=k1_m;
k1_m=0;
for(int j=2;j<al[11];j++){
k1=c2(j)*(al[11]-j);
if(k1>k1_m) k1_m=k1;
}
k*=k1_m;
}else{
puts("0");
return 0;
}
printf("%lld\n",k);
return 0;
}
goodbaton