結果

問題 No.73 helloworld
ユーザー goodbatongoodbaton
提出日時 2014-11-21 00:28:33
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 911 bytes
コンパイル時間 448 ms
コンパイル使用メモリ 66,084 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-08-30 22:01:36
合計ジャッジ時間 1,227 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 WA -
testcase_06 AC 2 ms
4,376 KB
testcase_07 WA -
testcase_08 AC 1 ms
4,376 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 1 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,14,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]){
        
        al[14]--;
    
        for(int i=0;i<6;i++){
            k*=al[ch[i]];
        }
        
        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