結果

問題 No.73 helloworld
ユーザー goodbatongoodbaton
提出日時 2014-11-21 00:34:20
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 1,024 bytes
コンパイル時間 463 ms
コンパイル使用メモリ 66,132 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-11 07:27:50
合計ジャッジ時間 1,258 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#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;
}
0