結果

問題 No.1334 Multiply or Add
ユーザー penguinmanpenguinman
提出日時 2020-11-04 03:19:50
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 447 bytes
コンパイル時間 1,627 ms
コンパイル使用メモリ 169,956 KB
実行使用メモリ 4,832 KB
最終ジャッジ日時 2023-09-29 21:22:17
合計ジャッジ時間 5,853 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 30 ms
4,644 KB
testcase_05 AC 31 ms
4,460 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 27 ms
4,628 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 27 ms
4,524 KB
testcase_13 AC 27 ms
4,588 KB
testcase_14 AC 29 ms
4,604 KB
testcase_15 AC 28 ms
4,648 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 28 ms
4,580 KB
testcase_23 WA -
testcase_24 AC 28 ms
4,600 KB
testcase_25 AC 27 ms
4,660 KB
testcase_26 AC 27 ms
4,664 KB
testcase_27 AC 28 ms
4,584 KB
testcase_28 AC 28 ms
4,460 KB
testcase_29 WA -
testcase_30 AC 31 ms
4,600 KB
testcase_31 AC 30 ms
4,708 KB
testcase_32 WA -
testcase_33 AC 27 ms
4,648 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 AC 29 ms
4,600 KB
testcase_39 AC 2 ms
4,376 KB
testcase_40 AC 13 ms
4,376 KB
testcase_41 AC 5 ms
4,376 KB
testcase_42 AC 6 ms
4,376 KB
testcase_43 AC 21 ms
4,376 KB
testcase_44 AC 12 ms
4,376 KB
testcase_45 AC 5 ms
4,376 KB
testcase_46 AC 14 ms
4,380 KB
testcase_47 AC 20 ms
4,380 KB
testcase_48 AC 15 ms
4,380 KB
testcase_49 AC 28 ms
4,404 KB
testcase_50 WA -
testcase_51 WA -
testcase_52 WA -
testcase_53 WA -
testcase_54 WA -
testcase_55 WA -
testcase_56 AC 1 ms
4,376 KB
testcase_57 AC 1 ms
4,376 KB
testcase_58 AC 1 ms
4,380 KB
testcase_59 WA -
testcase_60 AC 1 ms
4,376 KB
testcase_61 WA -
testcase_62 WA -
testcase_63 WA -
testcase_64 AC 1 ms
4,376 KB
testcase_65 WA -
testcase_66 WA -
testcase_67 WA -
testcase_68 WA -
testcase_69 WA -
testcase_70 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using std::cin;
using std::cout;
using std::endl;
using std::vector;
using ll=long long;
const int mod=1e9+7;
int main(){
    int N; cin>>N;
    vector<int> A(N);
    for(int i=0;i<N;i++) cin>>A[i];
    {
        vector<int> B=A;
        sort(B.begin(),B.end());
        if(B[N-1]==1){
            cout<<N<<endl;
            return 0;
        }
    }
    ll ans=0;
    for(int i=0;i<N;i++) ans+=A[i];
    cout<<ans<<endl;
}
0